I think Jelmini Carlo wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> It seems that the following code, proposed as a FORALL equivalent in the
> manual, doesn't work anymore in versions 6.1b2 nor 6.1b3:
> 
> Jess> (defrule forall-example
>     (not (and (a ?x) (not (b ?x))))
>     =>)
> Jess> (assert (a 1))
> Jess> (assert (a 2))
> Jess> (assert (b 1))
> Jess> (assert (b 2))
> Jess> (run)
> 0

It looks like you've neglected to call (reset) first. Most (not) CEs
won't work unless you've called (reset) to assert the
initial-fact. The manual tries to very plain about this. If you
pretty-print this rule, you'll see that an initial-fact pattern has
been inserted -- this is just how the (not) CE works.

> 
> With version 6.0 (and 6.1b1 I believe, but I cannot test anymore), the
> result of (run) is correctly 2.

The right answer is 1, not 2. Either it is, or is not, true that there
are a's without corresponding b's. The rule corectly fires once under
Jess 6.1b3 if you've reset first.

> Is there a workaround I can use while waiting for a new version?



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

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to