;;; Reset the network (resetnet t) ;;; Don't trace infer ^(setq snip:*infertrace* nil) ;;; Introduce Marc's relations (intext "rels") ;;; Compose paths (intext "paths") ;;; Load Noun/Verb Algorithm ^(load "code") ;; Define the relations necessary (define lex act agent member class object1 rel object2 property object indobj cause effect kn_cat) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Example One - Demonstration of Ehrlich's verb algorithm with a verb not labeled as ;; bitransitive, transitive, etc. ;; The sentence: ;; "Derek threw the baseball." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Include background knowledge about a baseball. Assume that ball is its parent class ;; and that ball is basic level. (describe (assert subclass (build lex "baseball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #baseball class (build lex "baseball"))) ;; "Derek threw the baseball." ;; Represent the sentence without making reference to the fact that it is, at first ;; appearance, a transitive verb. This shows how Ehrlich's algorithim treats verbs ;; not labeled as bitransitive, transitive, etc. (describe (assert act (build lex "throw") agent (build lex "Derek") object *baseball)) ;; Model the fact that ball is a basic level category. This follows Ehrlich's case frames. (describe (assert object1 (build lex "baseball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Include background knowledge about Derek. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Derek") class (build lex "human"))) ;; Model the fact that human is a basic level category. This follows Ehrlich's case ;; frames (describe (assert object1 (build lex "human") rel ("ISA") object2 (build lex "basic ctgy"))) ;; The moment of truth... ^(defn_verb 'throw) (resetnet) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Example Two - Demonstration of Ehrlich's verb algorithm with a verb that is labeled ;; as transitive. ;; The sentence: ;; "Derek threw the baseball." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Include background knowledge about a baseball. Assume that ball is its parent class ;; and that ball is basic level. (describe (assert subclass (build lex "baseball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #baseball class (build lex "baseball"))) ;; "Derek threw the baseball." ;; Represent the sentence without making reference to the fact that it is, at first ;; appearance, a transitive verb. This shows how Ehrlich's algorithim treats verbs ;; not labeled as bitransitive, transitive, etc. (describe (assert act (build lex "throw") agent (build lex "Derek") object *baseball)) ;; Model the fact that ball is a basic level category. This follows Ehrlich's case frames. (describe (assert object1 (build lex "baseball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Include background knowledge about Derek. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Derek") class (build lex "human"))) ;; Model the fact that human is a basic level category. This follows Ehrlich's case ;; frames (describe (assert object1 (build lex "human") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Define throw as a transitive verb (at least in the context of the sentence) (describe (assert object (build lex "throw") property (build lex "transitive"))) ;; The moment of truth... ^(defn_verb 'throw) (resetnet) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Example Three - Demonstration of Ehrlich's verb algorithm with a verb that is ;; labeled as transitive when it is really bitransitive. ;; The sentence: ;; "Derek threw the baseball to Tino." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Include background knowledge about a baseball. Assume that ball is its parent class ;; and that ball is basic level. (describe (assert subclass (build lex "baseball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #baseball class (build lex "baseball"))) ;; "Derek threw the baseball." ;; Represent the sentence without making reference to the fact that it is, at first ;; appearance, a transitive verb. This shows how Ehrlich's algorithim treats verbs ;; not labeled as bitransitive, transitive, etc. (describe (assert act (build lex "throw") agent (build lex "Derek") object *baseball indobj(build lex "Tino"))) ;; Model the fact that ball is a basic level category. This follows Ehrlich's case frames. (describe (assert object1 (build lex "baseball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Include background knowledge about Derek. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Derek") class (build lex "human"))) ;; Include background knowledge about Tino. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Tino") class (build lex "human"))) ;; Model the fact that human is a basic level category. This follows Ehrlich's case ;; frames (describe (assert object1 (build lex "human") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Define throw as a transitive verb (at least in the context of the sentence) (describe (assert object (build lex "throw") property (build lex "transitive"))) ;; The moment of truth... ^(defn_verb 'throw) (resetnet) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Example Four - Demonstration of Ehrlich's verb algorithm with a verb that is ;; correctly labeled as bitransitive ;; The sentence: ;; "Derek threw the baseball to Tino." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Include background knowledge about a baseball. Assume that ball is its parent class ;; and that ball is basic level. (describe (assert subclass (build lex "baseball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #baseball class (build lex "baseball"))) ;; "Derek threw the baseball." ;; Represent the sentence without making reference to the fact that it is, at first ;; appearance, a transitive verb. This shows how Ehrlich's algorithim treats verbs ;; not labeled as bitransitive, transitive, etc. (describe (assert act (build lex "throw") agent (build lex "Derek") object *baseball indobj(build lex "Tino"))) ;; Model the fact that ball is a basic level category. This follows Ehrlich's case frames. (describe (assert object1 (build lex "baseball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Include background knowledge about Derek. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Derek") class (build lex "human"))) ;; Include background knowledge about Tino. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Tino") class (build lex "human"))) ;; Model the fact that human is a basic level category. This follows Ehrlich's case ;; frames (describe (assert object1 (build lex "human") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Define throw as a transitive verb (at least in the context of the sentence) (describe (assert object (build lex "throw") property (build lex "bitransitive"))) ;; The moment of truth... ^(defn_verb 'throw) (resetnet) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Example Five - Demonstration of Ehrlich's verb algorithm with multiple instances ;; of the same verb. ;; The sentences are: ;; "Derek threw the baseball to Tino." ;; "Bobo throws the rubber ball." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Include background knowledge about a baseball. Assume that ball is its parent class ;; and that ball is basic level. (describe (assert subclass (build lex "baseball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #baseball class (build lex "baseball"))) ;; "Derek threw the baseball." ;; Represent the sentence without making reference to the fact that it is, at first ;; appearance, a transitive verb. This shows how Ehrlich's algorithim treats verbs ;; not labeled as bitransitive, transitive, etc. (describe (assert act (build lex "throw") agent (build lex "Derek") object *baseball indobj(build lex "Tino"))) ;; Model the fact that ball is a basic level category. This follows Ehrlich's case frames. (describe (assert object1 (build lex "baseball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Include background knowledge about Derek. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Derek") class (build lex "human"))) ;; Include background knowledge about Tino. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Tino") class (build lex "human"))) ;; Model the fact that human is a basic level category. This follows Ehrlich's case ;; frames (describe (assert object1 (build lex "human") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Define throw as a transitive verb (at least in the context of the sentence) (describe (assert object (build lex "throw") property (build lex "bitransitive"))) ;; "Bobo throws the rubber ball" ;; Here assume that Bobo is a chimp. Assume that chimp is a basic level category as well ;; as rubber ball. ;; Note that the sentence uses throw in a transitive sense. Will the algoritm make a distinction ;; between the type of throwing a human can do and that which a chimp can do? ;; Include background knowledge about a rubber ball. Assume that ball is its parent class. (describe (assert subclass (build lex "rubber ball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #rubberBall class (build lex "rubber ball"))) ;; Model the action. (describe (assert act (build lex "throw") agent (build lex "Bobo") object *rubberBall )) ;; Model the fact that rubberball is a basic level category. ;; This follows Ehrlich's case frames. (describe (assert object1 (build lex "rubber ball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Model that Bobo is a chimp. (describe (assert member (build lex "Bobo") class (build lex "chimp"))) ;; Model that chimp is a basic level category. (describe (assert object1 (build lex "chimp") rel ("ISA") object2 (build lex "basic ctgy"))) ;; The moment of truth... ^(defn_verb 'throw) (resetnet) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Example Six - Demonstration of Ehrlich's verb algorithm with a verb used multiple ;; times in both transitive and bitransitive forms. However, the transitive and ;; bitransitive lexes are set for the verb each time! Will Ehrlich's algorithm ;; differentiate between the two? ;; The sentences are: ;; "Derek threw the baseball to Tino." ;; "Bobo throws the rubber ball." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Include background knowledge about a baseball. Assume that ball is its parent class ;; and that ball is basic level. (describe (assert subclass (build lex "baseball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #baseball class (build lex "baseball"))) ;; "Derek threw the baseball." ;; Represent the sentence without making reference to the fact that it is, at first ;; appearance, a transitive verb. This shows how Ehrlich's algorithim treats verbs ;; not labeled as bitransitive, transitive, etc. (describe (assert act (build lex "throw") agent (build lex "Derek") object *baseball indobj(build lex "Tino"))) ;; Model the fact that ball is a basic level category. This follows Ehrlich's case frames. (describe (assert object1 (build lex "baseball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Include background knowledge about Derek. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Derek") class (build lex "human"))) ;; Include background knowledge about Tino. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Tino") class (build lex "human"))) ;; Model the fact that human is a basic level category. This follows Ehrlich's case ;; frames (describe (assert object1 (build lex "human") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Define throw as a transitive verb (at least in the context of the sentence) (describe (assert object (build lex "throw") property (build lex "bitransitive"))) ;; "Bobo throws the rubber ball" ;; Here assume that Bobo is a chimp. Assume that chimp is a basic level category as well ;; as rubber ball. ;; Note that the sentence uses throw in a transitive sense. Will the algoritm make a distinction ;; between the type of throwing a human can do and that which a chimp can do? ;; Include background knowledge about a rubber ball. Assume that ball is its parent class. (describe (assert subclass (build lex "rubber ball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #rubberBall class (build lex "rubber ball"))) ;; Model the action. (describe (assert act (build lex "throw") agent (build lex "Bobo") object *rubberBall )) ;; Define throw as a transitive verb. Now it has been defined in two ways. Will this affect ;; Ehrlich's algorithm? (describe (assert object (build lex "throw") property (build lex "transitive"))) ;; Model the fact that rubberball is a basic level category. ;; This follows Ehrlich's case frames. (describe (assert object1 (build lex "rubber ball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Model that Bobo is a chimp. (describe (assert member (build lex "Bobo") class (build lex "chimp"))) ;; Model that chimp is a basic level category. (describe (assert object1 (build lex "chimp") rel ("ISA") object2 (build lex "basic ctgy"))) ;; The moment of truth... ^(defn_verb 'throw) (resetnet) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Example Seven - Demonstrate Ehrlich's algorithm with a verb that has a consequence ;; defined for it. ;; The sentences are: ;; "Derek threw the baseball to Tino." ;; "Bobo throws the rubber ball." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Include background knowledge about a baseball. Assume that ball is its parent class ;; and that ball is basic level. (describe (assert subclass (build lex "baseball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #baseball class (build lex "baseball"))) ;; "Derek threw the baseball." ;; Represent the sentence without making reference to the fact that it is, at first ;; appearance, a transitive verb. This shows how Ehrlich's algorithim treats verbs ;; not labeled as bitransitive, transitive, etc. (describe (assert act (build lex "throw") agent (build lex "Derek") object *baseball indobj(build lex "Tino"))) ;; Model the fact that ball is a basic level category. This follows Ehrlich's case frames. (describe (assert object1 (build lex "baseball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Include background knowledge about Derek. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Derek") class (build lex "human"))) ;; Include background knowledge about Tino. Assume that his parent class is human and ;; that human is a basic level. (describe (assert member (build lex "Tino") class (build lex "human"))) ;; Model the fact that human is a basic level category. This follows Ehrlich's case ;; frames (describe (assert object1 (build lex "human") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Define throw as a transitive verb (at least in the context of the sentence) (describe (assert object (build lex "throw") property (build lex "bitransitive"))) ;; "Bobo throws the rubber ball" ;; Here assume that Bobo is a chimp. Assume that chimp is a basic level category as well ;; as rubber ball. ;; Note that the sentence uses throw in a transitive sense. Will the algoritm make a distinction ;; between the type of throwing a human can do and that which a chimp can do? ;; Include background knowledge about a rubber ball. Assume that ball is its parent class. (describe (assert subclass (build lex "rubber ball") superclass (build lex "ball") )) ;; Make reference to the baseball without specifying which baseball it is. (describe (assert member #rubberBall class (build lex "rubber ball"))) ;; Model the action. (describe (assert act (build lex "throw") agent (build lex "Bobo") object *rubberBall )) ;; Define throw as a transitive verb. Now it has been defined in two ways. Will this affect ;; Ehrlich's algorithm? (describe (assert object (build lex "throw") property (build lex "transitive"))) ;; Model the fact that rubberball is a basic level category. ;; This follows Ehrlich's case frames. (describe (assert object1 (build lex "rubber ball") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Model that Bobo is a chimp. (describe (assert member (build lex "Bobo") class (build lex "chimp"))) ;; Model that chimp is a basic level category. (describe (assert object1 (build lex "chimp") rel ("ISA") object2 (build lex "basic ctgy"))) ;; Create a path-based inference we will need for subclasses ;; Notice the results this has on the verb algorithms output! (define-path class (compose class (kstar (compose subclass- ! superclass)))) ;; Create a consequence (in Ehrlichs terms) for throwing. This consequence is what ;; Ehrlich would have considered a life-rule2 ;; "If a person x throws a ball then he lofts it in the air (describe (assert forall ($h $b) &ant((build member *h class (build lex "human")) (build member *b class (build lex "ball")) (build agent *h act (build lex "throw") object *b)) cq (build agent *h act (build lex "loft") object *b location (build lex "through the air") ) kn_cat ("life-rule.2"))) ;; Proof that the rule is in working order (describe (deduce agent $whoever act (build lex "loft"))) ^(defn_verb 'throw) (resetnet)