;;; Robot and Tools

;;; Assertion types:
;;; (on <object>)  -- applies to robot
;;; (holds <object>) -- applies to robot
;;; (at <location>) -- applies to robot
;;; (<object> on <object>)
;;; (<object> at <location>)

RULES

(end
 IF 
 (goal ?g)
 ?g
 ADD (stop))

(climb-down
 IF     
 (on ?support)
 AND-IF (not (equal? '?support 'floor)) ;<-- note vars have to be quoted
 SAYING "CLIMB down to floor"
 ADD    (on floor)
 DELETE (on ?support))

(walk
 IF     
 (on floor)
 (at ?old-loc)
 (loc ?new-loc)
 AND-IF (not (equal? '?old-loc '?new-loc)) ;<-- note vars have to be quoted
 SAYING "WALK to " ?new-loc
 ADD    (at ?new-loc)
 DELETE (at ?old-loc))

(climb-up
 IF     
 (on floor)
 (at ?loc)
 (?object at ?loc)
 SAYING "CLIMB onto " ?object
 ADD    (on ?object)
 DELETE (on floor))

ASSERTIONS

(loc (9 5))
(loc (3 4))
(loc (5 6))
(at (9 5))
(on floor)
(table at (5 6))
(stool at (3 4))
(goal: (on table))

