I tried:
(defrule reflect
(reflexive ?rel)
(?rel ?obj1 ?obj2)
=>
(assert (?rel ?obj2 ?obj1))
)
(deffacts family
(reflexive love)
(love father mother)
(love brother sister)
)
(deffacts business
(reflexive hate)
(hate Sun Microsoft)
)
and realised that the pattern (?rel ?obj1 ?obj2) is not acceptable because
the head is not an atom.
I can work around by putting a dummy head to the pattern like:
(defrule reflect
(reflexive ?rel)
(relation ?rel ?obj1 ?obj2)
=>
(assert (relation ?rel ?obj2 ?obj1))
)
(deffacts family
(reflexive love)
(relation love father mother)
(relation love brother sister)
)
(deffacts business
(reflexive hate)
(relation hate Sun Microsoft)
)
The extra "relation" looks ugly. Is there a better solution for this
problem?
Thank you for your help.
PhiHo.
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------