;;Chris Becker ;;CVA Seminar ;;April 14, 2003 ;;Verb Algorithm Demonstration ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (resetnet t) ;;;load relations (intext "rels") ;;;load paths (intext "paths") ;;;load editted verb algorithm ^(load "verb_alg_edit") ;;^(load "preliminary") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; 1. Representation of: ;; ;; "If everything is unbolted, unscrewed, and unattached, ;; someone pries the door panel from the door using a screwdriver" ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;1.1 create a door panel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert member #dp class (build lex "door panel"))) ;;1.2 create a door ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert member #door class (build lex "door"))) ;;1.2.1 ;; doors and doorpanels are physical objects ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert subclass ((build lex "door") (build lex "door panel")) superclass (build lex "physical object"))) ;;1.3 ;; #sd is a screwdriver ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert member #sd class (build lex "screwdriver")= classSD)) ;;1.3.1 ;; The screwdriver is thin and wide ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert object *sd property ((build lex "wide") (build lex "thin")) )) ;;1.3.2 ;; Screwdrivers are tools ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert subclass *classSD superclass (build lex "tool"))) ;;1.3.3 ;; Screwdrivers can be used as levers, to screw, or to stab ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert object (build lex "screwdriver") property (build lex "stab"))) (describe (assert object (build lex "screwdriver") property (build lex "screw"))) (describe (assert object (build lex "screwdriver") property (build lex "lever"))) ;;1.4 ;; There is a human agent ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert member #agnt class (build lex "human"))) ;;1.5 ;; The agent pries the doorpanel from the door using a screwdriver ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert agent *agnt act (build action (build lex "pry") object *dp indobj *door)= actPry instrument *sd )= priesDP) ;;1.6 ;; for all r, if r is not bolted, screwed, or attached, ;; then prying will take place, ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;(describe (assert forall $r ;; ant (build min 0 max 0 ;; arg ((build object *r property (build lex "bolted")) ;; (build object *r property (build lex "screwed")) ;; (build object *r property (build lex "attached")))) ;; cq *priesDP ;;)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;1.6.1 ;; for all r, if r is unbolted, unscrewed, or unattached, ;; then prying will take place, ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert forall $r &ant( (build object *r property (build lex "unbolted")) (build object *r property (build lex "unscrewed")) (build object *r property (build lex "unattached")) ) cq *priesDP)) ;;1.7 ;; cause: "Everything being disconnected" ;; effect: prying takes place ;; ;; (* for testing cause-effect case frame on the algorithm ;; where something causes the action to take place) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert cause (build lex "Everything being disconnected") effect *priesDP) ) ;;1.7.1 ;; cause: prying takes place ;; effect: something is removed ;; ;; (* for testing cause-effect case frame on the algorithm ;; where the action causes something to take place) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert cause *priesDP effect (build lex "Something is removed") ) ) ;;1.8 ;; Rule: if p undergoes action z FROM q, then q is the source of p ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert forall ($p $q $z) ant (build action *z object *p indobj *q) cq (build object1 *p rel (build lex "the source of") object2 *q) )) ;;1.8.1 ;; Rule: if p is the source of q, then q can be removed from p ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert forall (*p *q) ant (build object1 *p rel (build lex "the source of") object2 *q) cq (build object1 *p rel (build lex "can be removed from") object2 *q) )) ;;1.8.2 ;; if prying is performed on an object p in relation to indobj q ;; AND p can be removed from q, then (possibly) the action 'pry' will cause ;; p to be removed from q. ;; ;; (to simplify matters, the consequent states that the action is ;; then a synonym of "remove" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (describe (assert forall (*p *q) ant (min 2 max 2 arg((build action (build lex "pry") object *p indobj *q) (build object1 *p rel (build lex "can be removed from") object2 *q)) ) cq (build synonym (build lex "pry") synonym (build lex "remove")) )) ;;Define it! ;;;;;;;;;;;;;;;;;;;; ^(defineVerb 'pry 0)