ruby 1 % scm satisfy_test.sch
scm satisfy_test.sch
> (load "rule.sch")
(load "rule.sch")
#<unspecified>
> (load "rl.sch")
(load "rl.sch")
#<unspecified>
> (load "match.sch")
(load "match.sch")
#<unspecified>
> (load "update.sch")
(load "update.sch")
#<unspecified>
> (load "nl.sch")
(load "nl.sch")
#<unspecified>
> (load "env.sch")
(load "env.sch")
#<unspecified>
> (satisfy myp1 nlflist)
(satisfy myp1 nlflist)
(((?sy . 15) (?sx . 12) (?y . c) (?x . b)))
> myp1
myp1
((on ?x ?y) (size ?x ?sx) (size ?y ?sy) (! (< ?sx ?sy)) (! (= ?sx 12)))
> nlflist
nlflist
(((on a b) (on b c) (on c d)) ((size a 10) (size b 12) (size c 15)) ((age w 30) (age u 10)))
> (update rule-list nlflist)
(update rule-list nlflist)
Rule adds a new fact : Rule :(older-rule (if ((age ?x ?agex) (age ?y ?agey) (! (> ?agex ?agey))) then (older ?x ?y)))
New Fact :(older w u)
Rule adds a new fact : Rule :(myp1-rule (if ((on ?x ?y) (size ?x ?sx) (size ?y ?sy) (! (< ?sx ?sy)) (! (= ?sx 12))) then (myp1-result ?sx ?sy)))
New Fact :(myp1-result 12 15)
(((on a b) (on b c) (on c d)) ((size a 10) (size b 12) (size c 15)) ((age w 30) (age u 10)) ((older w u)) ((myp1-result 12 15)))
> ruby 2 % 
