830 likes | 943 Views
SNePS: A Logic for Natural Language Understanding and Commonsense Reasoning. Stuart C. Shapiro Department of Computer Science and Engineering and Center for Cognitive Science State University of New York at Buffalo shapiro@cse.buffalo.edu. Based on.
E N D
SNePS: A Logic for Natural Language Understanding and Commonsense Reasoning Stuart C. Shapiro Department of Computer Science and Engineering and Center for Cognitive Science State University of New York at Buffalo shapiro@cse.buffalo.edu
Based on Stuart C. Shapiro, “SNePS: A Logic for Natural Language Understanding and Commonsense Reasoning,” in Lucja Iwanska and Stuart C. Shapiro, Eds., Natural Language Processing and Knowledge Representation: Language for Knowledge and Knowledge for Language, AAAI Press/The MIT Press, 2000.
Abstract Design a better logic Than FOPL For NLU and CSR SNePS
Presentation Approach • Problem • Difficulties of FOPL • Solution in SNePS • Use SNePSLOG.
Outline • Set-Oriented Logical Connectives • The Unique Variable Binding Rule • Set Arguments • “Higher-Order” Logic • Intensional Representation • The Numerical Quantifiers • Contexts • Relevance Logic • Circular and Recursive Rules • Practical Donkey Sentences
Twenty Questions • Everything is an animal, a vegetable, or a mineral. • Squash is a vegetable • Is squash an animal? • a mineral? • Marble is neither an animal nor a vegetable. • Is marble a mineral?
+ + Twenty Questions in FOPL? x[Animal(x) Vegetable(x) Mineral(x)] but don’t want inclusive or x[Animal(x) Vegetable(x) Mineral(x)] T T T F T So don’t want exclusive or either
andor andor(i, j){Pi, ..., Pn} True iff at least i, and at most j of the Pi are True
Twenty Questions in SNePSLOG : all(x)(andor(1,1){animal(x), vegetable(x), mineral(x)}). : vegetable(squash)! VEGETABLE(SQUASH) ~ANIMAL(SQUASH) ~MINERAL(SQUASH)
Twenty Questions in SNePSLOG II : andor(0,0){animal(marble), vegetable(marble)}! ~ANIMAL(MARBLE) ~VEGETABLE(MARBLE) MINERAL(MARBLE)
Equivalent Statements • For every object, the following statements are equivalent: • It is human. It is a featherless biped. It is a rational animal. • Socrates is human. • Is Socrates a featherless biped? A rational animal? • Snoopy is not a featherless biped. • Is Snoopy a rational animal? A human?
Equivalent Statements in FOPL? x[Human(x) Featherless-Biped(x) Rational-Animal(x)] wrong: F F T T T
thresh thresh(i, j){Pi, ..., Pn} True iff either fewer than i, or more than j of the Pi are True Note: thresh(i, j) ~andor(i, j)
thresh Abbreviation thresh(i){Pi, ..., Pn} for thresh(i, n-1){Pi, ..., Pn}
Equivalent Statementsin SNePSLOG 1 : all(x)(thresh(1){human(x), featherless-biped(x), rational-animal(x)}). : human(Socrates)! HUMAN(SOCRATES) FEATHERLESS-BIPED(SOCRATES) RATIONAL-ANIMAL(SOCRATES)
Equivalent Statementsin SNePSLOG 2 : ~featherless-biped(Snoopy)! ~RATIONAL-ANIMAL(SNOOPY) ~FEATHERLESS-BIPED(SNOOPY) ~HUMAN(SNOOPY)
Putative Inclusive or • If Hilda is in Boston or Kathy is in Las Vegas, then Eve is in Providence. • What if Hilda is in Boston and Kathy is in Las Vegas? • Rips 1983: ___ ___ ___
or-entailment {Pi, ..., Pn} v=> {Qi, ..., Qn} True iff for all i, j Pi Qj
Hilda and Kathy in SNePSLOG : {in(Hilda, Boston), in(Kathy, Las_Vegas)} v=> {in(Eve, Providence)}. : in(Hilda, Boston)! Since {IN(HILDA,BOSTON),IN(KATHY,LAS_VEGAS)} v=> {IN(EVE,PROVIDENCE)} and IN(HILDA,BOSTON) I infer IN(EVE,PROVIDENCE)
Outline • Set-Oriented Logical Connectives • The Unique Variable Binding Rule • Set Arguments • “Higher-Order” Logic • Intensional Representation • The Numerical Quantifiers • Contexts • Relevance Logic • Circular and Recursive Rules • Practical Donkey Sentences
Disappointed Voter Problem “If someone votes for X and someone votes for Y, one of them will be disappointed” : all(u,v,x,y)( {votesfor(u,x), votesfor(v,y)} &=> {andor(1,1){disappointed(u), disappointed(v)}}). : all(u,x)({votesfor(u,x),wins(x)} &=> {~disappointed{u}}).
Hillary and Elizabeth Vote : votesfor(Hillary, Bill). : votesfor(Elizabeth, Bob). : wins(Bill). : disappointed(?x)? DISAPPOINTED(ELIZABETH) ~DISAPPOINTED(HILLARY)
FOPL Disappointment {votesfor(Hillary, Bill), votesfor(Hillary, Bill)} &=> {andor(1,1) {disappointed(Hillary), disappointed(Hillary)}} disappointed(Hillary)
Unique Variable Binding Rule (UVBR) Two variables in one wff cannot be replaced by the same term. or Two terms in an mgu cannot be equal.
Outline • Set-Oriented Logical Connectives • The Unique Variable Binding Rule • Set Arguments • “Higher-Order” Logic • Intensional Representation • The Numerical Quantifiers • Contexts • Relevance Logic • Circular and Recursive Rules • Practical Donkey Sentences
Sisters “Mary, Sue, and Sally are sisters.”
Sisters in FOPL Sisters(Mary, Sue) Sisters(Sue, Sally) (x,y)[Sisters(x,y) Sisters(y,x)] (x,z)[x z ((y)[sisters(x,y) sisters(y,z)] Sisters(x,z))]
Reduction Inference P(s1,...,si,,si+1,...,sm), ’ P(s1,...,si,’,si+1,...,sm) P(s1,...,si,{t1,…,tn},si+1,...,sm) P(s1,...,si,ti,si+1,...,sm)
Sisters in SNePSLOG : sisters({Mary, Sue, Sally}). : all(x,y)(sisters({x,y}) => {likes(x,y), likes(y,x)}). : likes(?x,?y)? LIKES(SUE,MARY) LIKES(MARY,SUE) LIKES(SALLY,SUE) LIKES(SUE,SALLY) LIKES(MARY,SALLY) LIKES(SALLY,MARY)
Outline • Set-Oriented Logical Connectives • The Unique Variable Binding Rule • Set Arguments • “Higher-Order” Logic • Intensional Representation • The Numerical Quantifiers • Contexts • Relevance Logic • Circular and Recursive Rules • Practical Donkey Sentences
Inadequacy of FOPL 1 • If R is a transitive relation and R(x, y) and R(y, z) then R(x, z).
Term Logic Every expression in SNePS is a term.
SNePSLOG Transitivity Rule : all(R)(Transitive(R) => all(x,y,z)({R(x,y), R(y,z)} &=> {R(x,z)})). : Transitive(bigger). : bigger(elephant,lion). : bigger(lion,mouse). : bigger(elephant,mouse)? BIGGER(ELEPHANT,MOUSE)
Inadequacy of FOPL 2 • Everything Bob believes is true. • Bob believes everything Bill believes. • Bill believes Kevin’s favorite proposition. • Kevin’s favorite proposition is that John is taller than Mary. • Is John taller than Mary?
Quantifying Over Propositions : all(p)(Believes(Bob, p) => p). : all(p)(Believes(Bill, p) => Believes(Bob, p)). : all(p) (Favorite-proposition(Kevin, p) => Believes(Bill, p)). : Favorite-proposition(Kevin, Taller(John, Mary)). : Taller(John, Mary)? TALLER(JOHN,MARY)
Outline • Set-Oriented Logical Connectives • The Unique Variable Binding Rule • Set Arguments • “Higher-Order” Logic • Intensional Representation • The Numerical Quantifiers • Contexts • Relevance Logic • Circular and Recursive Rules • Practical Donkey Sentences
Opaque Contexts “George IV wished to know whether Scott was the author of Waverly” [Russell 1906]
Intensional Representation Every SNePS term represents (denotes) an intensional (mental) entity.
Uniqueness Principle No two SNePS terms denote the same entity.
McCarthy’s Telephone Number Problem : all(R)(Transparent(R) => all(a,x,y)({R(a,x), =({x,y})} &=> {R(a,y)})). : Transparent(Dial). : =({Telephone(Mike), Telephone(Mary)}). : Know(Pat, Telephone(Mike)). : Dial(Pat, Telephone(Mike)).
Correct Answer to Telephone Number Problem : ?what(Pat, ?which)? DIAL(PAT,TELEPHONE(MARY)) KNOW(PAT,TELEPHONE(MIKE)) DIAL(PAT,TELEPHONE(MIKE))
Outline • Set-Oriented Logical Connectives • The Unique Variable Binding Rule • Set Arguments • “Higher-Order” Logic • Intensional Representation • The Numerical Quantifiers • Contexts • Relevance Logic • Circular and Recursive Rules • Practical Donkey Sentences
Reasoning by Elimination • No one has more than one mother. • Jane is John's mother. • Is Mary John's mother? • The committee members are Chris, Leslie, Pat, and Stevie. At least two of them are women. • Leslie and Stevie are men. • Is Pat a man or a woman?
Numerical Quantifiers nexists(i,j,k)(x) ({P1(x),..., Pn(x)}: {Q(x)})} There are k individuals that satisfy P1(x) ... Pn(x) and, of them, at least i and at most j also satisfy Q(x)
Numerical QuantifierRule of Inference 1 • If j individuals are known that satisfy P1(x) … Pn(x) Q(x) then every other individual that satisfies P1(x) ... Pn(x) also satisfies ~Q(x)
Numerical QuantifierRule of Inference 2 • If k-i individuals are known that satisfy P1(x) … Pn(x) ~ Q(x) then every other individual that satisfies P1(x) … Pn(x) also satisfies Q(x)
Numerical Quantifier Forms • nexists(i,j,k) • nexists(_,j,_) • nexists(i,_,k)
Reasoning by Eliminationin SNePSLOG 1 : all(x)(Person(x) => nexists(_,1,_)(y)({Person(y)}: {Mother(y,x)})). : Person({John, Jane, Mary}). : Mother(Jane, John). : Mother(Mary, John)? ~MOTHER(MARY,JOHN)
Reasoning by Eliminationin SNePSLOG 2 : Member({Chris, Leslie, Pat, Stevie}). : nexists(2,_,4)(x) ({Member(x)}: {Woman(x)}). : all(x)(Member(x) => andor(1,1){Man(x), Woman(x)}).
Committee Problem Answer : Man({Leslie, Stevie}). : ?What(Pat)? WOMAN(PAT) MEMBER(PAT) ~MAN(PAT)