![Page 1: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/1.jpg)
First-order Logic
![Page 2: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/2.jpg)
Prop logic
First order predicate logic(FOPC)
Prob. Prop. logic
Objects,relations
Degree ofbelief
First order Prob. logic
Objects,relations
Degree ofbelief
Degree oftruth
Fuzzy Logic
Time
First order Temporal logic(FOPC)
Assertions;t/f
Epistemological commitment
Ontological commitment
t/f/u Degbelief
facts
FactsObjectsrelations
Proplogic
Probproplogic
FOPC ProbFOPC
![Page 3: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/3.jpg)
AtomicPropositionalRelationalFirst order
• Atomic representations: States as blackboxes..
• Propositional representations: States as made up of state variables
• Relational representations: States made up of objects and relations between them– First-order: there are
functions which “produce” objects.. (so essentially an infinite set of objects
• Propositional can be compiled to atomic (with exponential blow-up)
• Relational can be compiled to propositional (with exponential blo-up) if there are no functions– With functions, we
cannot compile relational representations into any finite propositional representation
“hig
her-
orde
r” r
epre
sent
atio
ns
can
(som
etim
es)
be c
ompi
led
to lo
wer
ord
er
Expressiveness of Representations
![Page 4: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/4.jpg)
![Page 5: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/5.jpg)
Connection to propositional logic: Think of “atomic sentences” as propositions…
general object referent
Can’t have predicates of predicates.. thus first-order
![Page 6: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/6.jpg)
![Page 7: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/7.jpg)
![Page 8: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/8.jpg)
![Page 9: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/9.jpg)
Important facts about quantifiers
• Forall and There-exists are related through negation..– ~[forall x P(x)] = Exists x ~P(x)– ~[exists x P(x)] = forall x ~P(x)
• Quantification is allowed only on variables – can’t quantify on predicates; can’t say– [Forall P Reflexive(P) forall x,y P(x,y) => P(y,x)
—you have to write it once per relation)
• Order of quantifiers matters
![Page 10: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/10.jpg)
Family Values:Falwell vs. Mahabharata
• According to a recent CTC study,
“….90% of the men surveyed said they will marry the same woman..”
“…Jessica Alba.”
English is Expressive but Ambiguous.
),( yxwillMaryxy),( yxwillMarryyx
Intuitively, x depends on y as it is in the scope of the quantification on y (foreshadowing Skolemization)
![Page 11: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/11.jpg)
Caveat: Order of quantifiers matters
),( yxlovesyx),( yxlovesxy
)],(),([
)],(),([
)],(),([),(
)],(),([
)],(),([
)],(),([),(
TweetyTweetylovesTweetyFidoloves
FidoTweetylovesFidoFidoloves
yTweetylovesyFidolovesyyxlovesxy
TweetyTweetylovesFidoTweetyloves
TweetyFidolovesFidoFidoloves
TweetyxlovesFidoxlovesxyxlovesyx
TweetyandFidowithworldaConsider
“either Fido loves both Fido and Tweety; or Tweety loves both Fido and Tweety”
“ Fido or Tweety loves Fido; and Fido or Tweety loves Tweety”
Loves(x,y) means x loves y
Intuitively, x depends on y as it is in the scope of the quantification on y (foreshadowing Skolemization)
![Page 12: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/12.jpg)
![Page 13: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/13.jpg)
Two different Tarskian Interpretations
This is the same as the one on The left except we have green guy for Richard
Problem: There are too darned many Tarskian interpretations. Given one, you can change it by just substituting new real-world objects Substitution-equivalent Tarskian interpretations give same valuations to the FOPC statements (and thus do not change entailment) Think in terms of equivalent classes of Tarskian Interpretations (Herbrand Interpretations)
We had this in prop logic too—The realWorld assertion corresponding to a proposition
![Page 14: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/14.jpg)
Connection to propositional logic: Think of “atomic sentences” as propositions…
![Page 15: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/15.jpg)
Herbrand Interpretations• Herbrand Universe
– All constants• Rao,Pat
– All “ground” functional terms • Son-of(Rao);Son-of(Pat);• Son-of(Son-of(…(Rao)))….
• Herbrand Base– All ground atomic sentences made with
terms in Herbrand universe• Friend(Rao,Pat);Friend(Pat,Rao);Friend(
Pat,Pat);Friend(Rao,Rao)• Friend(Rao,Son-of(Rao));• Friend(son-of(son-of(Rao),son-of(son-
of(son-of(Pat))– We can think of elements of HB as
propositions; interpretations give T/F values to these. Given the interpretation, we can compute the value of the FOPC database sentences
))(,(
),(
),(),(,
RaoofsonPatFriend
PatRaoFriend
yxLikesyxFriendyx
If there are n constants; andp k-ary predicates, then --Size of HU = n --Size of HB = p*nk
But if there is even one function, then |HU| is infinity and so is |HB|. --So, when there are no function symbols, FOPC is really just syntactic sugaring for a (possibly much larger) propositional database
Let us think of interpretations for FOPC that are more like interpretations for prop logic
![Page 16: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/16.jpg)
![Page 17: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/17.jpg)
But what about Godel?
• In First Order Logic– We have finite set of constants– Quantification allowed only over variables…
• Godel’s incompleteness theorem holds only in a system that includes “mathematical induction”—which is an axiom schema that requires infinitely many FOPC statements– If a property P is true for 0, and whenever it is true for number n, it is also
true for number n+1, then the property P is true for all natural numbers– You can’t write this in first order logic without writing it once for each P
(so, you will have to write infinite number of FOPC statements)• So, a finite FOPC database is still semi-decidable in that we can prove
all provably true theorems
![Page 18: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/18.jpg)
Proof-theoretic Inference in first order logic
• For “ground” sentences (i.e., sentences without any quantification), all the old rules work directly (think of ground atomic sentences as propositions)– P(a,b)=> Q(a); P(a,b) |= Q(a)– ~P(a,b) V Q(a) resolved with P(a,b) gives Q(a)
• What about quantified sentences?– May be infer ground sentences from them….– Universal Instantiation (a universally quantified statement entails every
instantiation of it)
– Existential instantiation (an existentially quantified statement holds for some term (not currently appearing in the KB).
• Can we combine these (so we can avoid unnecessary instantiations?) Yes. Generalized modus ponens
• Needs UNIFICATION
)(),()(),( aQbaentailsPxQyxyPx
)(),();(),( bqentailsbaPxQyxyPx
.1)1()( constnewaisskSKPentailsxxP
![Page 19: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/19.jpg)
UI can be applied several times to add new sentences --The resulting KB is equivalent to the old one
EI can only applied once --The resulting DB is not equivalent to the old one BUT will be satisfiable only when the old one is
![Page 20: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/20.jpg)
![Page 21: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/21.jpg)
Want mgu (maximal general unifiers)
![Page 22: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/22.jpg)
How about knows(x,f(x)) knows(u,u)? x/u; u/f(u)leads to infinite regress (“occurs check”)
![Page 23: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/23.jpg)
GMP can be used in the “forward” (aka “bottom-up”) fashion where we start from antecedents, and assert the consequent or in the “backward” (aka “top-down”) fashion where we start from consequent, and subgoal on proving the antecedents.
![Page 24: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/24.jpg)
Apt-pet
• An apartment pet is a pet that is small
• Dog is a pet• Cat is a pet• Elephant is a pet• Dogs, cats and skunks are
small. • Fido is a dog• Louie is a skunk• Garfield is a cat• Clyde is an elephant• Is there an apartment pet? )(?
)(.11
)(.10
)(.9
)(.8
)()(.7
)()(.6
)()(.5
)()(.4
)()(.3
)()(.2
)()()(.1
xaptPet
clydeelephant
garfieldcat
louieskunk
fidodog
xsmallxdog
xsmallxcat
xsmallxskunk
xpetxelephant
xpetxcat
xpetxdog
xaptPetxpetxsmall
![Page 25: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/25.jpg)
)(?
)(.11
)(.10
)(.9
)(.8
)()(.7
)()(.6
)()(.5
)()(.4
)()(.3
)()(.2
)()()(.1
xaptPet
clydeelephant
garfieldcat
louieskunk
fidodog
xsmallxdog
xsmallxcat
xsmallxskunk
xpetxelephant
xpetxcat
xpetxdog
xaptPetxpetxsmall
![Page 26: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/26.jpg)
![Page 27: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/27.jpg)
Efficiency can be improved by re-ordering subgoals adaptively e.g., try to prove Pet before Small in Lilliput Island; and Small before Pet in pet-store.
![Page 28: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/28.jpg)
Similar to “Integer Programming” or “Constraint Programming”
![Page 29: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/29.jpg)
Generate compilable matchers for each pattern, and use them
![Page 30: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/30.jpg)
![Page 31: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/31.jpg)
![Page 32: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/32.jpg)
![Page 33: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/33.jpg)
Example of FOPC Resolution..
Everyone is loved by someone
If x loves y, x will give a valentine card to y
Will anyone give Rao a valentine card?
)'),'((),( xxSKlovesxylovesyx
),(),(),(),( xyGVxylovesxyGVxylovesyx
),(),(),(),( RaozGVRaozGVzRaozzGVRaozzGV
y/z;x/Rao
~loves(z,Rao)
z/SK(rao);x’/rao
![Page 34: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/34.jpg)
Finding where you left your key..
Atkey(Home) V Atkey(Office) 1
Where is the key? Ex Atkey(x)
Negate Forall x ~Atkey(x)CNF ~Atkey(x) 2
Resolve 2 and 1 with x/homeYou get Atkey(office) 3
Resolve 3 and 2 with x/office You get empty clause
So resolution refutation “found” that there does exist a place where the key is… Where is it? what is x bound to? x is bound to office once and home once.
so x is either home or office
![Page 35: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/35.jpg)
Existential proofs..
• Are there irrational numbers p and q such that pq is rational?
22
22
2
Ration
al
2qp
222
qp
Irrational
This and the previous examples show that resolution refutation is powerful enough to model existential proofs. In contrast, generalized modus ponens is only able to model constructive proofs..
![Page 36: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/36.jpg)
Existential proofs..
• The previous example shows that resolution refutation is powerful enough to model existential proofs. In contrast, generalized modus ponens is only able to model constructive proofs..
• (We also discussed a cute example of existential proof—is it possible for an irrational number power another irrational number to be a rational number—we proved it is possible, without actually giving an example).
![Page 37: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/37.jpg)
GMP vs. Resolution Refutation
• While resolution refutation is a complete inference for FOPC, it is computationally semi-decidable, which is a far cry from polynomial property of GMP inferences.
• So, most common uses of FOPC involve doing GMP-style reasoning rather than the full theorem-proving..
• There is a controversy in the community as to whether the right way to handle the computational complexity is to – a. Develop “tractable subclasses” of languages and require the
expert to write all their knowlede in the procrustean beds of those sub-classes (so we can claim “complete and tractable inference” for that class) OR
– Let users write their knowledge in the fully expressive FOPC, but just do incomplete (but sound) inference.
– See Doyle & Patil’s “Two Theses of Knowledge Representation”
![Page 38: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/38.jpg)
![Page 39: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/39.jpg)
![Page 40: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/40.jpg)
![Page 41: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/41.jpg)
![Page 42: First-order Logic. Assertions; t/f Epistemological commitment Ontological commitment t/f/u Deg belief facts Facts Objects relations Prop logic Prob prop](https://reader036.vdocuments.us/reader036/viewer/2022062619/5516e376550346f5558b4620/html5/thumbnails/42.jpg)