Mahesh Ghandi writes about using variables in the
predicate position in Jess...
This is a very common limitation in reasoning systems and has both
theoretical and practical justifications. However, it's easy to work
around this, especially in a forward chaining reasoner like Jess. The
idea is to have explicit assertions that a symbol names a predicate
and has certain properties, and then to have rules that assert new
rules for each predicate. E.g.,
(assert (predicate parent))
(assert (inverse parent child))
(assert (symmetric inverse))
(assert (transitive ancestor))
(defrule process-inverse-assertion
(inverse ?p1 ?p2)
=>
(assert (inverse ?p2 ?p1))
(assert (predicate ?p1))
(assert (predicate ?p2))
(apply defrule
(gensym)
(str-cat "(" ?p1 " ?x ?y)")
"=>"
"(assert (" ?p2 " ?y ?x)))"))
Ok, I'm not sure that last expressions will work as typed,
but the idea is that it should assert the following rule:
(defrule g00034 (parent ?x ?y) => (assert (child ?y ?x)))
--------------------------------------------------------------------
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]
--------------------------------------------------------------------