All,
I meant to include the error stack trace with my original message. Sorry for
the omission, but here's the trace ...
Jess reported an error in routine HasLHS.addPattern
while executing (batch n.clp).
Message: First use of variable negated: *mti*.
Program text: ( batch n.clp ) at line 1.
at jess.HasLHS.findUndefinedVariables(HasLHS.java:191)
at jess.HasLHS.addPattern(HasLHS.java:126)
at jess.Defrule.addPattern(Defrule.java:55)
at jess.Pattern.addToLHS(Pattern.java:399)
at jess.Group.addToLHS(Group.java:377)
at jess.Jesp.addARule(Jesp.java:1015)
at jess.Jesp.doParseDefrule(Jesp.java:978)
at jess.Jesp.parseDefrule(Jesp.java:901)
at jess.Jesp.parseSexp(Jesp.java:159)
at jess.Jesp.parse(Jesp.java:62)
at jess.Batch.batch(Batch.java:43)
at jess.Batch.call(Batch.java:57)
at jess.FunctionHolder.call(FunctionHolder.java:37)
at jess.Funcall.execute(Funcall.java:270)
at jess.Jesp.parseAndExecuteFuncall(Jesp.java:1596)
at jess.Jesp.parseSexp(Jesp.java:183)
at jess.Jesp.parse(Jesp.java:62)
at org.jpsd.rule.GMain.execute(GMain.java:125)
at org.jpsd.rule.GMain.main(GMain.java:25)
Steve
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Steve Webster
Sent: Friday, March 01, 2002 7:51 AM
To: [EMAIL PROTECTED]
Cc: Scott Gallant
Subject: JESS: First use of variable negated
All,
I'm encountering a "First use of variable negated" error that I can not find
an explanation for in the documentation or this list's mail archive. In
summary, when first referencing a global variable in a predicate under Jess
6.0, a corresponding error is thrown.
The offending code is:
(defglobal ?*mti* = "Recon_PhaseLine")
(deftemplate foo
(slot instanceName)
)
(defrule create-salute-report-state
(foo (instanceName ?*mti*))
=>
(printout t "bar")
)
However, when I replace the predicate, "(foo (instanceName ?*mti*))," with
what I believe to be the equivalent, "(foo (instanceName ?i&:(eq ?i
?*mti*)))," no error results, and the clp file compiles.
Given how basic this scenario is, I can not help but think I have missed
something obvious. Can anyone tell me why the initial code gives an error on
compilation?
Thanks in advance for your help,
Steve
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------