Download presentation
Presentation is loading. Please wait.
Published byNickolas Curtis Modified over 9 years ago
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 relations High-order logic is to deal with relations of relations
2
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)
3
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 t 1, t 2, …, t n are terms, then so is f(t 1, t 2, …, t n ) love(mother(father(John)), John)
4
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)
5
5 First-Order Logic Syntax Equality: father(John) = Henry x, y brother(x, Richard) brother(y, Richard) (x = y)
6
6 First-Order Logic Syntax Sentences: –Atomic sentences: p(t 1, t 2, …, t n ) –If is a sentence, then so are and ( ) –If and are sentences, then so are , and –If is a sentence, then so are and
7
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
8
8 First-Order Logic Semantics x p(f(x), x) W 1 : Set of objects: {John, Tom, Mary} Functions: f mother, mother(John) = Mary, mother(Tom) = Mary Predicates: p love, {love(Mary, John), love(Mary, Tom)} W 2 : Set of objects: {John, Tom, Mary} Functions: f mother, mother(John) = Mary, mother(Tom) = Mary Predicates: p love, {love(Mary, John)} is true with respect to W 1 (?), but not W 2
9
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)
10
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))
11
11 FOL: Set Domain s set(s) (s = {}) ( x, s 2 set(s 2 ) s = {x|s 2 }) x, s {x|s} = {} x, s x s s = {x|s} x, s x s y, s 2 (s = {y|s 2 } (x = y x s 2 )) s 1, s 2 s 1 s 2 ( x x s 1 x s 2 ) s 1, s 2 s 1 = s 2 (s 1 s 2 s 2 s 1 )
12
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)
13
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)
14
14 FOL: Wumpus Game Causal rules: r pit(r) ( s adjacent(r, s) breezy(s)) s [ r adjacent(r, s) pit(r)] breezy(s)
15
15 Homework In Russell & Norvig’s AIMA (2 nd ed.): Exercises of Chapter 8.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.