The "forall" CE 

(forall (A) (B))

says that for every A, B matches. For example

;; Everyone owns a dog
(forall (person (name ?n)) (dog (owner ?n)))

You're saying something different: given a goal X in state nil, if
every goal Y is in state success, then modify goal X. You could write
something like

; Given goal X
?g<- (goal (name "X") (state nil))
;; There's at least one goal "Y"
(exists (goal (name "Y")))
;; All goals "Y" are in state success
(not (goal (name "Y") (state ~success)))

If there's always a goal "Y", you can omit the middle pattern.


I think Skeptic 2000 wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> 
> Hi,
> 
> I tried to use the forall in this way and it doesn't work, it's a bug or I 
> misunderstand how it is supposed to work ?
> 
> I have a deftemplate name goal with two slot, name and state.
> 
> My rule is :
> 
> (defrule example
> ?g<- (goal (name "X") (state nil))
> (forall (goal (name "Y") (state sucess))
> =>
> (modify ?g (state sucess)
> 
> In a few words, I put the goal "X" is in state sucess if every goal "Y" are 
> in state sucess.
> 
> Problem is that the 'sucess' criteria seems to not considered by the forall 
> CE.
> 
> Thanks for help.
> 
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software 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