Here are two examples using ?f .i The first succeeds because (+ 3 4) is indeed 7,
Question:
Here are two examples using ?f .i The first succeeds because (+ 3 4) is indeed 7, and the second fails because (> 3 4 is false.
> (pat-match '(?x ?op ?y i s ?z (?if (eql (?op ?x ?y) ?z)))
'(3 + 4 i s 7))
((?Z . 7) (?Y . 4) (?OP . +) (?X . 3))
> (pat-match '(?x ?op ?y (?if (?op ?x ?y)))
'(3 > 4))
NIL
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Paradigms Of Artificial Intelligence Programming Case Studies In Common Lisp
ISBN: 9781558601918
1st Edition
Authors: Peter Norvig
Question Posted: