;(require-library "trace.ss") ;(require-library "tracec.ss") ; These are the test cases for Assignment 4 (define kb1 '( (capital_of_state California Sacramento) (a_kind_of capital_of_state capital) (filler_type capital capital_city) (a_kind_of capital_city city) (instance_of Los_Angeles city) (admitted_to_union California 1850) (instance_of California state_of_USA) (instance_of USA nation) (part_of state_of_USA USA) (a_kind_of city geographic_entity) (a_kind_of nation geographic_entity) (a_kind_of state_of_USA geographic_entity) (a_kind_of geographic_entity thing) (inverse has_as_part part_of) (instance_of part_of relation) (instance_of instance_of relation) (instance_of mother_of relation) (a_kind_of relation thing) (between Oregon Washington California) )) (define kb2 '( (a_kind_of human mammal) (a_kind_of mammal animal) (a_kind_of animal living_thing) (a_kind_of living_thing physical_object) (a_kind_of non_living_thing physical_object) (a_kind_of physical_object thing) (instance_of John human) (instance_of Mary human) (instance_of Kim human) (instance_of Sandy human) (instance_of Leslie human) (instance_of Robbie robot) (a_kind_of robot physical_object) (friend_of Mary Kim) (friend_of Mary Sandy) (friend_of Mary Robbie) (wife_of John Mary) (can_translate Mary English Japanese) (date_of_birth Mary 1950) (resident_of Mary Palo_Alto) (mother_of Mary Elizabeth) (instance_of Palo_Alto city) (has_degree Mary PhD Stanford mathematics) (female Mary) (male John) (instance_of female relation) (instance_of a_kind_of relation) (instance_of friend_of relation) (instance_of wife_of relation) (instance_of can_translate relation) (instance_of date_of_birth relation) (instance_of resident_of relation) (instance_of mother_of relation) (instance_of instance_of relation) (instance_of has_degree relation) (instance_of male relation) )) (define test-cases '( (all-specs-of 'geographic_entity kb1) (all-genls-of 'state_of_USA kb1) (all-specs-of 'San_Jose kb1) (all-genls-of 'San_Jose kb1) (all-specs-of 'USA kb1) (all-genls-of 'USA kb1) (check-all-things kb1) (check-all-relations kb1) (pp-frame (make-frame 'California kb1)) (pp-frame (make-frame 'USA kb1)) (pp-frame (make-frame 'geographic_entity kb1)) (pp-frame (make-frame 'part_of kb1)) (pp-frame (make-frame 'San_Jose kb1)) (all-genls-of 'human kb2) (all-specs-of 'human kb2) (check-all-things kb2) (check-all-relations kb2) (pp-frame (make-frame 'Mary kb2)) (pp-frame (make-frame 'John kb2)) (pp-frame (make-frame 'English kb2)) (pp-frame (make-frame 'Palo_Alto kb1)) )) ; This will test the test cases given above and print nicely each ; case and its value. (define (test) (for-each (lambda (x) (print x) (newline) (pretty-print (eval x)) (newline) (newline)) test-cases))