Research in Knowledge Representation and Reasoning Stuart C. Shapiro Department of Computer Science & Engineering Center for MultiSource Information Fusion Center for Cognitive Science University at Buffalo, The State University of New York MGLAIR Agent Architecture Mind Body KL (SNePS) Independent of lower-body implementation PMLa PMLb I/P s o c k e t s Dependent on lower-body implementation PMLc Proprioception Speech W O R L D Hearing SAL Vision Motion Fall 2006 S. C. Shapiro 2 SNePS SNePS is a Logic-Based Frame-Based Network-Based knowledge representation, reasoning, and acting system. Fall 2006 S. C. Shapiro 3 SNePS Is Logic-Based wff1!: all(x)(Isa(x,dog) => Property(x,four-legged)) wff2!: Isa(Toto,dog) : Property(Toto,?x)? wff3!: Property(Toto,four-legged) : Isa(Fala,dog)! wff6!: Property(Fala,four-legged) wff5!: Isa(Fala,dog) : askwh Property(?x,four-legged) Fala: Fala Toto: Toto : list-wffs wff6!: Property(Fala,four-legged) wff5!: Isa(Fala,dog) wff3!: Property(Toto,four-legged) wff2!: Isa(Toto,dog) wff1!: all(x)(Isa(x,dog) => Property(x,four-legged)) Fall 2006 S. C. Shapiro 4 SNePS Is Frame-Based : %(describe *nodes) (m6! (a1 Fala) (a2 four-legged) (r Property)) (m5! (a1 Fala) (a2 dog) (r Isa)) (m3! (a1 Toto) (a2 four-legged) (r Property)) (m2! (a1 Toto) (a2 dog) (r Isa)) (m1! (forall v1) (ant (p1 (a1 v1) (a2 dog) (r Isa))) (cq (p2 (a1 v1) (a2 four-legged) (r Property)))) : %(describe (assert r Isa a1 (Fido Rover Lassie) a2 (dog pet))) (m7! (a1 Lassie Rover Fido) (a2 pet dog) (r Isa)) wff7!: Isa({Lassie,Rover,Fido},{pet,dog}) : Property(Rover, ?x)? wff8!: Property(Rover,four-legged) Fall 2006 S. C. Shapiro 5 SNePS Is Network-Based : define-frame Ako(nil subclass superclass) Ako(x1, x2) will be represented by {<subclass, x1>, <superclass, x2>} : Ako({man, dog}, mammal). wff1!: Ako({dog,man},mammal) : Ako({mammal, fish}, vertebrate). wff2!: Ako({fish,mammal},vertebrate) : Ako(vertebrate, animal). wff3!: Ako(vertebrate,animal) : %(define-path subclass (compose subclass (kstar (compose superclass- ! subclass)))) ... : askwh Ako(?x, animal) vertebrate: vertebrate fish: fish mammal: mammal dog: dog man: man Fall 2006 S. C. Shapiro 6 Procedural Attachment A predicate or function symbol may be attached to a user-written procedure so instances may be computed in the underlying programming language. Fall 2006 S. C. Shapiro 7 Example of Procedural Attachment : Diff(7,3,?x)? wff24!: Diff(7,3,4) : Diff(10,?x,7)? wff25!: Diff(10,3,7) : Diff(?x,5,7)? wff26!: Diff(12,5,7) : Diff(15,8,7)? wff314!: Diff(15,8,7) : Diff(15,8,9)? wff316!: ~Diff(15,8,9) Fall 2006 S. C. Shapiro 8 Building Domain all(x)(onFloor(x) => {(<(x,3) => location(belowGround)), (<(2,x) => location(aboveGround))}). Fall 2006 S. C. Shapiro 9 Primitive Acts A version of procedural attachment for implementing intelligent agents: : perform say(Welcome, "to you all.") Welcome to you all. Fall 2006 S. C. Shapiro 10 Policies Connect propositions and acts: wheneverdo(location(belowGround), withsome(f, onFloor(f), say("It's dark here on floor",f), say("Where am I?",""))). wheneverdo(location(aboveGround), withsome(f, onFloor(f), say("It's sunny outside floor",f), say("Where am I?",""))). Fall 2006 S. C. Shapiro 11 SNeBR: Belief Revision/ Assumption-Based Truth Maintenance • Identify possible culprits of contradictions. • Disbelieve implications of disbelieved hypotheses. • Use state constraints to adjust beliefs: andor(1,1){onFloor(1),onFloor(2),onFloor(3),onFloor(4)}. andor(1,1){location(belowGround),location(aboveGround)}. Fall 2006 S. C. Shapiro 12 Combined Use of SNeBR & Procedural Attachment : perform believe(onFloor(1)) It's dark here on floor 1 : location(?x)? wff24!: ~location(aboveGround) wff6!: location(belowGround) : perform believe(onFloor(4)) It's sunny outside floor 4 : location(?x)? wff33!: ~location(belowGround) wff7!: location(aboveGround) Fall 2006 S. C. Shapiro 13 BR with Multiple Sources wff1: all(x)(andor(0,1){mammal(x),fish(x)}) wff2: all(x)(fish(x) <=> has(x,scales)) wff4: all(x)(whale(x) => fish(x)) wff5: Source(Melville,all(x)(whale(x) => fish(x))) wff6: all(x)(whale(x) => mammal(x)) wff7: Source(Darwin,all(x)(whale(x) => mammal(x))) wff8: Sgreater(Darwin,Melville) wff11: free(Willy) and whale(Willy) Note: Source & Sgreater props are regular object-language props. Fall 2006 S. C. Shapiro 14 Finding the Contradiction : has(Willy, scales)? I infer fish(Willy) I infer has(Willy,scales) I infer mammal(Willy) I infer it is not the case that wff14: fish(Willy) Fall 2006 S. C. Shapiro 15 Using Source Credibility A contradiction was detected within context default-defaultct. The contradiction involves the newly derived proposition: wff17: ~fish(Willy) {<der,{wff1,wff6,wff11}>} and the previously existing proposition: wff14: fish(Willy) {<der,{wff4,wff11}>} The least believed hypothesis: (wff4) The most common hypothesis: (nil) The hypothesis supporting the fewest wffs: (wff1) I removed the following belief: wff4: all(x)(whale(x) => fish(x)) I no longer believe the following 2 propositions: wff14: fish(Willy) wff13: has(Willy,scales) Fall 2006 S. C. Shapiro 16 Conclusions • MGLAIR is an agent architecture – For connecting reasoning with sensing and acting • SNePS is a – – – – Logic-based Frame-based Network-based Knowledge representation, reasoning, and acting system. • Procedural attachment provides – Sensing, acting, computing at the “subcognitive” layers • SNeBR does belief revision & truth maintenance. • Source meta-knowledge may be entered and used. Fall 2006 S. C. Shapiro 17