Thanks,
Jordan
Le 20 oct. 07 à 20:49, jwar...@gmail.com a écrit :
Within the next few days I'm going to post some examples of how to
integrate CLIPS with Java, including 3 examples of a front end written
in Swing interfacing with a CLIPS program.
On Oct 21, 2:07 am, CLIPS Support <gdronline2...@swbell.net> wrote:
> Here's the prior thread discussing how to get jclips running on Mac OS
> X:http://groups.google.com/group/CLIPSESG/browse_thread/thread/f01ccbb4....
The modify function works differently in Clips and Jess.
In Jess, a modify that doesn't actually change any slots in a fact is
not given a new index (I don't know if it's avoiding the retract and
re-assert altogether or if it's just given the same index again, but
that doesn't matter). Whereas in Clips, if you modify a fact it will
be retracted, re-asserted and given a new fact-index and that will
make it activatable again!
This means that in Jess you can do:
CLIPS> (deftemplate foo
(slot bar))
CLIPS> (assert (foo (bar some_value)))
<Fact-4>
CLIPS> (defrule clear-foo
?foo <- (foo)
=>
(modify ?foo (bar nil)))
but in Clips, you get an infinite loop. So if you want to have code
that works in both environments you must do:
CLIPS> (defrule clear-foo
?foo <- (foo (bar ~nil))
=>
(modify ?foo (bar nil)))
BR
Johan Lindberg
jo...@pulp.se