Hi,

        If I am correct, the left and right memory represents the organisation
of your rules activations conditions (cf. chapt. 10 of Jess5. Manual). For 
example 
(defrule my-rule (a) (b) (c) =>)  will be fired if 
        ( (a) && (b) ) && (c) ) is verified in this PRIORITY order.

Therefore the conditions are organized as left and right condition :

left (a)        (one input-node)
right (b)       (one input-node)

left (a) && (b) which is true when (a) and (b) exists. (two input node)
right (c)                                                       (one input-node)

When a left condition is verified Jess tries the rigth one then "generate" a
new two-input-node "left memory" wich is compared with another right memory
until all the conditions are met.

Then the rule is put in the agenda...

Therefore when executing (matches <rule name> ) you print the facts that
matches these conditions.

if I have the (a), (b) and (c) 
in my facts base I will have after  (matches my rule)

------------------- PRINT ------------------------
[Node2 ntests=0 ;usecount = 1;unique = false]

Left Memory:
[Token: size=1;sortcode=0;tag=ADD;negcnt=0;facts=(a);]

RightMemory:
[Token: size=1;sortcode=1;tag=ADD;negcnt=0;facts=(b);]

[Node2 ntests=0 ;usecount = 1;unique = false]
Left Memory:
[Token: size=2;sortcode=1;tag=ADD;negcnt=0;facts=(a);(b);]

RightMemory:
[Token: size=1;sortcode=2;tag=ADD;negcnt=0;facts=(c);]

TRUE
------------------- END PRINT ------------------------

Try the view command! It is a good way to understand Jess representaion of
a rule. For example (view my-rule) describe (with colors :)) the rule
organisation.

Remark:

Strange enough, matches always return true!! Wouldn't it be better to have
true
only when the conditions are met?

Erwan


-------------------------------------
Erwan Tranvouez ([EMAIL PROTECTED])
Doctorant - (DIAM-IUSPIM)

Domaine Universitaire de St Jerome
Av. Escadrille Normandie-Niemen
13397 Marseille Cedex 20

Tel. : 06 09 58 36 96

En cas d'urgence vous pouvez egalement m'envoyer un 
texto sur mon portable a partir de www.sfr.fr
------------------------------------------------------
---------------------------------------------------------------------
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