20-Inference in First-Order Logic (FOL), Unification-05!03!2024
20-Inference in First-Order Logic (FOL), Unification-05!03!2024
6. The general form of a proposition is the general form of a truth function, which
is: [p¯, ξ¯, N (ξ¯)]. This is the general form of a proposition.
why?
● Functions: father of, best friend, third inning of, one more than, end of . . .
Higher-order logic:
relations and functions operate not only on objects,
but also on relations and functions
● Constants: K i n g J o h n , 2, U C B , . . .
● Predicates: B r other, >, . . .
● Functions: Sqrt, L e ft L e g O f, . . .
● Variables: x, y, a, b, . .
● .
Connectives: ∧ ∨ ¬ =⇒ ⇔
●
● Quantifiers:
∀∃
B rother(KingJohn, RichardTheLionheart)
● E.g., >(
L e n g t h ( L eft L e g O f (Richard)), L e n g t h ( L eft L e g O f ( K i n g J o h n ) ) )
¬S, S1 ∧ S2 , S1 ∨ S2 , S1 = ⇒ S2 , S1 ⇔ S2
● For instance
● Object symbols
– Richard → Richard the Lionheart
– J o h n → the evil King John
● Predicat symbol
– Brother → the brotherhood relation
● Atomic sentence
– B r other(R ichard, J ohn)
true iff Richard the Lionheart and the evil King John
are in the brotherhood relation in the model
● E veryone at J H U is smart:
∀
x At (x, J H U ) = ⇒ S mart(x )
∧
At (K ing J ohn, J H U )
( Artificial Intelligence: First Order Logic 29 February 2024
=⇒
A Common Mistake to Avoid 16
∀ x At (x, J H U ) ∧ S mart(x )
● Correct
∀ ( ) =⇒ ( )
x At x, J H U
Smar t x
● Someone at J H U is smart:
∃ x At (x, J H U ) ∧ S mart(x )
At (K ing J ohn, J H U ) ∧
∨ (
S mart(K ing J ohn))
At (R ichard, J H U ) ∧
∨ (
S mart(R ichard))
Artificial Intelligence: (J H
AtFirst U, Logic
Order JHU ) ∧ S mart(J H29UFebruary 2024
∨
Another Common Mistake to Avoid 18
∃ x At (x, J H U ) = ⇒ S mart(x )
● Correct
∃ ( )∧ ( )
x At x, J H U
Smar t x
●∀ x ∀ y is the same as ∀ y ∀ x
●∃ x ∃ y is the same as ∃ y ∃ x
● ∃ x ∀ y Lov es(x, y)
“There is a person who loves everyone in the world”
●∀ y ∃ x Lov es(x, y)
“Everyone in the world is loved by at least one person”
● For instance
– 1 = 2 and ∀ x ×(S qr t(x ), S qr t(x )) = x are satisfiable
– 2 = 2 is true
(note: syntax does not imply anything about the semantics of 1, 2, Sqrt(x), etc.)
● “Sibling” is symmetric
∀ x, y F i r st C o u s i n ( x , y) ⇔ ∃ p, ps Parent(p, x) ∧ Sibling(ps, p) ∧
Parent(ps, y)
∀ p ∃ t F ool(p, t)
∧
∃ p ∀ t F ool(p, t)
∧
¬ ∀ p ∀ t F ool(p, t)
Artificial Intelligence: First Order Logic 29 February 2024
26
wampus world
● P roperties of locations:
∀
x, t At (Ag ent, x, t) ∧ S melt(t) = ⇒ S melly(x )
∀
x, t At (Ag ent, x, t) ∧ B r eeze(t) = ⇒
B r eezy(x )
true
∨
∀ a, s H olding(Gold, a, s)) ⇔
● ForRholding
esult( the gold:
[ (a = G r ab ∧ AtGold(s))
∨ (
H olding(Gold, s) ∧ a ≠
R elease)]
● This assumes that the agent is interested in plans starting at S 0 and that S 0 is the
only situation described in the KB
● First-order logic
– objects and relations are semantic primitives
– syntax: constants, functions, predicates, equality, quantifiers
● Situation calculus
– conventions for describing actions and change in FOL
– can formulate planning as inference on a situation calculus KB