On Mon, Apr 11, 2011 at 2:01 PM, Vagif Verdi <[email protected]> wrote:

> Can it be used as an inference (rule) engine ?


You can now -

(defrel man p)

(fact man 'Bob)
(fact man 'John)
(fact man 'Ricky)

(defrel woman p)
(fact woman 'Mary)
(fact woman 'Martha)
(fact woman 'Lucy)

(defrel likes p1 p2)
(fact likes 'Bob 'Mary)
(fact likes 'John 'Martha)
(fact likes 'Ricky 'Lucy)

(run* [q]
      (exist [x y]
             (likes x y)
             (== q [x y]))) ; ([Bob Mary] [John Martha] [Ricky Lucy])

Cheers!

David

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to