![Page 1: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/1.jpg)
1
First-Order Logic• Propositional logic does not represent and
cannot handle objects.
• First-order logic is to represent and reason on objects and their relations
• High-order logic is to deal with relations of relations
![Page 2: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/2.jpg)
2
First-Order Logic Syntax• Constant symbols: a, b, c, John, …
to represent primitive objects
• Variable symbols: x, y, z, …to represent unknown objects
• Predicate symbols: safe, married, love, …to represent relations
married(John)
love(John, Mary)
![Page 3: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/3.jpg)
3
First-Order Logic Syntax• Function symbols: square, father, …
to represent simple objects
safe(square(1, 2))
love(father(John), mother(John))
• Terms:to represent complex objects– Constant symbols
– If f is a function symbol, and t1, t2, …, tn are terms,
then so is f(t1, t2, …, tn)
love(mother(father(John)), John)
![Page 4: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/4.jpg)
4
First-Order Logic Syntax• Logical connectives: , , , ,
• Universal quantifier: x p(x)
x love(father(x), mother(x))
• Existential quantifier: x p(x) x p(x)
x married(x)
![Page 5: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/5.jpg)
5
First-Order Logic Syntax• Equality:
father(John) = Henry
x, y brother(x, Richard) brother(y, Richard) (x = y)
![Page 6: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/6.jpg)
6
First-Order Logic Syntax• Sentences:
– Atomic sentences: p(t1, t2, …, tn)
– If is a sentence, then so are and ()
– If and are sentences, then so are , and
– If is a sentence, then so are and
![Page 7: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/7.jpg)
7
First-Order Logic Semantics• Truth value with respect to an interpretation
(possible world)
• Possible world:– Set of objects– Constants objects– Functions mapping from objects to objects– Predicates relations on objects
![Page 8: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/8.jpg)
8
First-Order Logic Semantics x p(f(x), x)
W1:Set of objects: {John, Tom, Mary}Functions: f mother, mother(John) = Mary, mother(Tom) = MaryPredicates: p love, {love(Mary, John), love(Mary, Tom)}
W2:Set of objects: {John, Tom, Mary}Functions: f mother, mother(John) = Mary, mother(Tom) = MaryPredicates: p love, {love(Mary, John)}
is true with respect to W1 (?), but not W2
![Page 9: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/9.jpg)
9
FOL: Kinship Domain
m, c mother(c) = m female(m) parent(m, c)
w, h husband(h, w) male(h) spouse(h, w)
x male(x) female(x)
p, c parent(p, c) child(c, p)
g, c grand-parent(g, c) p parent(g, p) parent(p, c)
x, y sibling(x, y) x y p parent(p, x) parent(p, y)
![Page 10: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/10.jpg)
10
FOL: Number Domain
nat-num(0)
n nat-num(n) nat-num(S(n))
n 0 S(n)
m nat-num(m) +(0, m) = m
m, n nat-num(m) nat-num(n) +(S(m), n) = S(+(m, n))
![Page 11: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/11.jpg)
11
FOL: Set Domain
s set(s) (s = {}) (x, s2 set(s2) s = {x|s2})
x, s {x|s} = {}
x, s x s s = {x|s}
x, s x s y, s2 (s = {y|s2} (x = y x s2))
s1, s2 s1 s2 (x x s1 x s2)
s1, s2 s1 = s2 (s1 s2 s2 s1)
![Page 12: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/12.jpg)
12
FOL: Wumpus Game• Environment:
square(1, 2) [1, 2]
percept([stench, breeze, glitter, none, none], 5)
x, y, a, b adjacent([x, y], [a, b]) [a, b] {[x+1, y], [x-1, y],
[x, y+1], [x, y-1]}
s, t at(Agent, s, t) breeze(t) breezy(s)
![Page 13: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/13.jpg)
13
FOL: Wumpus Game• Diagnostic rules:
s breezy(s) r adjacent(r, s) pit(r)
s r adjacent(r, s) pit(r) breezy(s)
s breezy(s) r adjacent(r, s) pit(r)
![Page 14: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/14.jpg)
14
FOL: Wumpus Game• Causal rules:
r pit(r) (s adjacent(r, s) breezy(s))
s [r adjacent(r, s) pit(r)] breezy(s)
![Page 15: 1 First-Order Logic Propositional logic does not represent and cannot handle objects. First-order logic is to represent and reason on objects and their](https://reader036.vdocuments.us/reader036/viewer/2022072117/5697bfc01a28abf838ca3f5b/html5/thumbnails/15.jpg)
15
Homework• In Russell & Norvig’s AIMA (2nd ed.):
Exercises of Chapter 8.