Hi,

I'm not sure if it's even possible to do this...

I would like to define a rule that when matched, will add a fact to the
KB that says "Paul have-object A or B or C"... I tried several syntaxes

(defrule person-have-at-least-1-of-these-objects
    ...
    =>
    (assert
       ...My ATLEAST fact here...
    )

First, with an OR. This does not work because "person-have-object" is a fact
and not a function which is what "or" expect.

 (assert
  (or
    (person-have-object ?person ?object1)
    (person-have-object ?person ?object2)
    (person-have-object ?person ?object3)
  )
 )

Switching the or and assert is not really what I need either because it will
assert all three facts.

 (or
  (assert
    (person-have-object ?person ?object1)
    (person-have-object ?person ?object2)
    (person-have-object ?person ?object3)
  )
 )

An "or" on 3 asserts will just take the first fact and add it to the KB.
This is not what I want.

 (or
  (assert (person-have-object ?person ?object1))
  (assert (person-have-object ?person ?object2))
  (assert (person-have-object ?person ?object3))
 )

How can I explicitly state that ?person have ?object1 OR ?object2 OR
?object3?

Is there a way to do 3 assert and negating them with (not)? Or do I need to
add a "special fact" that takes 3 arguments?

Thank you very much,

--
Jean-Francois Lassonde

Reply via email to