Hi,

Well, the left hand side of the rule (the "Node" classes on
the stack, see the manual) is applying the greater-than-or-equal
operator (GtOrEq, the third entry on the stack) to a 'nil' value - the
default value a slot has if no other value has been assigned. I
actually think this is a pretty clear error message; any suggestions
on how I could improve it?

Anyway, there are two ways to fix the problem: one is to use a
"default" qualifier in the deftemplate, so that all instances of the
fact are assured of having an integral value

(deftemplate foo (slot bar (default 0)))

The other way to fix this is to make sure you supply a value for this
slot whenever you assert a fact.

(assert (foo (bar 0)))

Obviously the first method is more fool-proof, but either way will
work.


P.S. Sending HTML mail to mailing lists is generally frowned
upon. Those of us who don't use Netscape as a mail reader see the
lovely mess you now see quoted below.

I think Srinivasa Rao wrote:
> 
> This is a multi-part message in MIME format.
> 
> ------=_NextPart_000_0029_01BE9CA8.A8C90E20
> Content-Type: text/plain;
>       charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> 
> Hello Users,
> 
> I have defined a deftemplate with slots and I have not given any =
> specific type for slots viz., ATOM, INTEGER etc.,
> In some rule I am trying to check the value in that slot, whether the =
> value is in a range, let us say 0-100. The program exits saying the =
> following=20
> error.=20
> 
> The error looks like this:
> Rete Exception in routine Value::intValue while executing rule LHS: =
> [Node1 comma
> nd=3DTEQ;data=3D(or (>=3D ?0,2,-1 0));type=3D0;idx=3D2;usecount =3D 1] =
> while executing defru
> le PlatformGetMaximumValue.
>   Message: Not a number: nil type =3D 1 at line 66:  ( run ) .
>         at jess.Value.typeError(Value.java:299)
>         at jess.Value.numericValue(Value.java:181)
>         at jess.GtOrEq.call(Funcall.java:1315)
>         at jess.Funcall.simpleExecute(Funcall.java:341)
>         at jess.Funcall.execute(Funcall.java:301)
>         at jess.Funcall.execute(Funcall.java:201)
>         at jess.Or.call(Funcall.java:1138)
>         at jess.Funcall.simpleExecute(Funcall.java:341)
>         at jess.Funcall.execute(Funcall.java:301)
>         at jess.Funcall.execute(Funcall.java:205)
>         at jess.Node1TEQ.callNode(Node1.java:528)
>         at jess.Node.passAlong(Node.java:163)
>         at jess.Node1TECT.callNode(Node1.java:607)
>         at jess.Rete.processTokenOneNode(Rete.java:919)    =20
> 
> Can somebody let me know how I can overcome this problem
> 
> Thanks in Advance
> 
> srinu
> 
> ------=_NextPart_000_0029_01BE9CA8.A8C90E20
> Content-Type: text/html;
>       charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
> <HTML>
> <HEAD>
> 
> <META content=3Dtext/html;charset=3Diso-8859-1 =
> http-equiv=3DContent-Type>
> <META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV>&nbsp;</DIV>
> <DIV><FONT color=3D#000000 size=3D2>Hello Users,</FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT color=3D#000000 size=3D2>I have defined a deftemplate with =
> slots and I=20
> have not given any specific type for slots viz., ATOM, INTEGER=20
> etc.,</FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2>In some rule I am trying to check =
> the value in=20
> that slot, whether the value is in a range, let us say 0-100. The =
> program exits=20
> saying the following </FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2>error. </FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT color=3D#000000 size=3D2>The error looks like =
> this:</FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2>Rete Exception in routine =
> Value::intValue while=20
> executing rule LHS: [Node1 comma<BR>nd=3DTEQ;data=3D(or (&gt;=3D ?0,2,-1 =
> 
> 0));type=3D0;idx=3D2;usecount =3D 1] while executing defru<BR>le=20
> PlatformGetMaximumValue.<BR>&nbsp; Message: Not a number: nil type =3D 1 =
> at line=20
> 66:&nbsp; ( run ) .<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at=20
> jess.Value.typeError(Value.java:299)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
> sp;&nbsp;=20
> at=20
> jess.Value.numericValue(Value.java:181)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
> &nbsp;&nbsp;=20
> at=20
> jess.GtOrEq.call(Funcall.java:1315)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
> p;&nbsp;=20
> at=20
> jess.Funcall.simpleExecute(Funcall.java:341)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;&nbsp;=20
> at=20
> jess.Funcall.execute(Funcall.java:301)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;=20
> at=20
> jess.Funcall.execute(Funcall.java:201)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;=20
> at =
> jess.Or.call(Funcall.java:1138)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
> bsp;=20
> at=20
> jess.Funcall.simpleExecute(Funcall.java:341)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;&nbsp;=20
> at=20
> jess.Funcall.execute(Funcall.java:301)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;=20
> at=20
> jess.Funcall.execute(Funcall.java:205)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;=20
> at=20
> jess.Node1TEQ.callNode(Node1.java:528)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;=20
> at=20
> jess.Node.passAlong(Node.java:163)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
> ;&nbsp;=20
> at=20
> jess.Node1TECT.callNode(Node1.java:607)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
> &nbsp;&nbsp;=20
> at jess.Rete.processTokenOneNode(Rete.java:919)&nbsp;&nbsp;&nbsp;&nbsp;=20
> </FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT color=3D#000000 size=3D2>Can somebody let me know how I can =
> overcome this=20
> problem</FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT color=3D#000000 size=3D2>Thanks in Advance</FONT></DIV>
> <DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT color=3D#000000 size=3D2>srinu</FONT></DIV></BODY></HTML>
> 
> ------=_NextPart_000_0029_01BE9CA8.A8C90E20--
> 
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list. List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> 
> 


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to