Hi Ernest!
I see the problems with logic that occur if there are
variable bindings in conditional CEs.
I want to use the (or) CE to enforce some kind of order
to the matching of facts.
Regarding the example below, the logic would be the following:
First, the existence of Fact1 is checked.
If Fact1 is not found Fact2 will be the next match and so on.
The variables are set as soon as a matching fact is found.
Without the order in the (or) CE, it is necessary to
write three rules that would have to be forced into the
desired order.
Is there a better way to achieve my goal ?
Regards,
Norman
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Dienstag, 13. Februar 2001 16:52
To: Gyhra, Norman (Student Assistant)
Subject: Re: (or) CE
I think Jess -should- reject an attempt to use ?slot1 on the RHS of
the rule; this kind of static analysis to enforce this isn't being
done yet, though. It's the same as binding a slot to a variable in a
(not) -- you can use the variable inside that same (not), but not in
subsequent patterns or on the rule's RHS.
I do need to do a bit more research on this, however, and I'm fairly
sure there will be some fundamental changes in the way (or) is being
implemented before 6.0 comes out.
I think Gyhra, Norman (Student Assistant) wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi Ernest!
>
> I have the following facts:
> (Fact1 (slot1 Fact1))
> (Fact2 (slot1 Fact2))
> (Fact3 (slot1 Fact3))
>
>
> If I use the (or) CE on the LHS like that:
>
> (or (Fact1 (slot1 ?slot1))
> (Fact2 (slot1 ?slot1))
> (Fact3 (slot1 ?slot1))
> )
>
>
> what will be the value of ?slot1 ?
>
> I would expect Jess to keep the order of the OR conditions.
> ?slot1 would be Fact1 because the first OR conditon matches immediately
> and the other two conditions are not tested anymore.
>
> I did some tests and came to the conclusion, that the current
> behaviour is different. However, I am not sure.
> Can you tell me what_s going on ?
>
> Regards,
> Norman
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------