next up previous
Next: ACKNOWLEDGMENTS Up: SNePS: AN INTERACTIVE APPROACH Previous: 9. PROGRAMMING PROJECT #2.


10. ANSWERS TO EXERCISES.

2.3
(define member class object ability)

2.7

(assert member Clyde class elephant)
(assert member Dumbo class elephant)

2.12

(describe (assert member Tweety class canary))
(describe (assert object Tweety ability fly))
(describe (assert member Opus class bird))

2.18
(find (member- class) canary (object- ability) fly)

2.25
(describe (assert agent John act believe
                  object (build object Clyde ability fly)))
(describe (assert agent Tweety act believe
                  object (build object Tweety ability fly)))
(find (member- ! class) elephant (object- ! ability) fly)

2.29

(find agent ?x act believe object (find object ?x ability fly))
*x

2.31
(describe (assert object (Tweety Dumbo) ability fly))

2.33
(describe (assert agent John act believe
                  object (build object (Opus Clyde)
                                ability fly)))

(find (member- ! class) elephant
       object- (find object- (find agent John act believe)
                     ability fly))

3.6
(describe (assert agent John act believe
                  object (build object (Orville Wilbur)
                                ability fly)))

(describe (deduce agent John act believe
                  object (build object Orville ability fly)))
SNePS is ``wondering'' whether it should believe M1. This means that it must consider that question. So, it must create (i.e., build) a node to represent what it is considering. It has not asserted M1, so it doesn't believe it (yet); it's just considering it.

4.6
(find prerequisites- *cs114)

4.8
(describe (assert department CS division grad
                  number 572
                  name "Introduction to Artificial Intelligence"
                  credits 3) = cs572)

(describe (assert department CS division grad
                  number 676
                  name "Knowledge Representation"
                  credits 3
                  prerequisites *cs572))

(find prerequisites- *cs572)

(find prerequisites- *cs676)

(find (name- prerequisites) *cs572)

5.4

(describe (assert member #elephant class elephant))
(describe (assert agent John act see object *elephant))


6.8
(define-path has (compose ! (kstar (compose isa object- !))
                          has (kstar (compose object- ! has))
                          (kstar (compose object- ! isa))))

(find object- (findassert has mouth))

(find has- (findassert object Dumbo))
7.3
(describe (assert member Barbara class lawyer))

(define object property)

(describe (assert forall $l
                  ant (build member *l class lawyer)
                  cq  (build object *l property rich)))

(describe (assert forall $r
                  ant (build object *r property rich)
                  cq ((build arg1 *r
                             rel owns 
                             arg2 (build skolem-function house\ of arg1 *r) = house)
                      (build member *house class house)
                      (build object *house property big))))

(describe (assert forall $h
                  &ant ((build member *h class house)
                        (build object *h property big))
                  cq (build object *h property lots\ of\ work)))

(describe (deduce object $x property lots\ of\ work))


next up previous
Next: ACKNOWLEDGMENTS Up: SNePS: AN INTERACTIVE APPROACH Previous: 9. PROGRAMMING PROJECT #2.
William J. Rapaport 2003-09-22