John,
When you use 'or' as you did in a rule, Jess actually
generates a rule for each of the or conditions. So in
your case if you executed the (rules) command you'd
see rules with names like:
gps1 and gps&1
The second rule is the 'missing' link. As you can see, if
you had a rule with 2 or clauses each with 3
conditions then Jess would generate 9 rules.
Bob.
> -----Original Message-----
> From: John Barr [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 15, 2002 11:14 AM
> To: [EMAIL PROTECTED]
> Subject: JESS: improper use of 'or' conditional?
>
>
> I am new to Jess and curious as to the ppdefrule output for my gps1
> rule below. The line containing the 'or' conditional results in
> only the first expression being output by ppdefrule. I imagine I am
> using the 'or' conditional incorrectly. Putting the 'or' conditional
> inside a 'test' conditional works for my problem. I am using
> Jess 6.0.
>
> (deftemplate tpf
> (slot id)
> (slot ls))
>
> (deftemplate suf
> (slot id)
> (slot cu)
> (slot nu))
>
> (defrule gps1
> (tpf (id ?tpf-id) (ls G))
> (suf
> (id ?tid&:(eq ?tid ?tpf-id))
> (cu ?c)
> (nu ?n))
> (or (> ?c 65) (> ?n 75))
> =>
> (printout t "Fired gps1 for " ?tid crlf))
>
> (defrule gps2
> (tpf (id ?tpf-id) (ls G))
> (suf
> (id ?tid&:(eq ?tid ?tpf-id))
> (cu ?c)
> (nu ?n))
> (test (or (> ?c 65) (> ?n 75)))
> =>
> (printout t "Fired gps2 for " ?tid crlf))
>
> The ppdefrule output for gps1 is:
>
> "(defrule MAIN::gps1
> (MAIN::tpf (id ?tpf-id) (ls G))
> (MAIN::suf (id ?tid&:(eq ?tid ?tpf-id)) (cu ?c) (nu ?n))
> (MAIN::> ?c 65)
> =>
> (printout t \"Fired gps1 for \" ?tid crlf))"
>
> The ppdefrule output for gps2 is:
>
> "(defrule MAIN::gps2
> (MAIN::tpf (id ?tpf-id) (ls G))
> (MAIN::suf (id ?tid&:(eq ?tid ?tpf-id)) (cu ?c) (nu ?n))
> (test (or (> ?c 65) (> ?n 75)))
> =>
> (printout t \"Fired gps2 for \" ?tid crlf))"
>
>
> _________________________________________________________________
> Join the world's largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
> --------------------------------------------------------------------
> 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]
--------------------------------------------------------------------