Documente Academic
Documente Profesional
Documente Cultură
Bernhard Beckert
Outline
Why rst-order logic? Syntax and semantics of rst-order logic Fun with sentences Wumpus world in rst-order logic
B. Beckert: KI fr IM p.2
B. Beckert: KI fr IM p.3
B. Beckert: KI fr IM p.3
B. Beckert: KI fr IM p.3
B. Beckert: KI fr IM p.3
First-order Logic
Propositional logic Assumes that the world contains facts
B. Beckert: KI fr IM p.4
First-order Logic
Propositional logic Assumes that the world contains facts First-order logic Assumes that the world contains Objects people, houses, numbers, theories, Donald Duck, colors, centuries, . . .
B. Beckert: KI fr IM p.4
First-order Logic
Propositional logic Assumes that the world contains facts First-order logic Assumes that the world contains Objects people, houses, numbers, theories, Donald Duck, colors, centuries, . . . Relations red, round, prime, multistoried, . . . brother of, bigger than, part of, has color, occurred after, owns, . . .
B. Beckert: KI fr IM p.4
First-order Logic
Propositional logic Assumes that the world contains facts First-order logic Assumes that the world contains Objects people, houses, numbers, theories, Donald Duck, colors, centuries, . . . Relations red, round, prime, multistoried, . . . brother of, bigger than, part of, has color, occurred after, owns, . . . Functions +, middle of, father of, one more than, beginning of, . . .
B. Beckert: KI fr IM p.4
B. Beckert: KI fr IM p.5
B. Beckert: KI fr IM p.6
B. Beckert: KI fr IM p.7
B. Beckert: KI fr IM p.7
B. Beckert: KI fr IM p.7
B. Beckert: KI fr IM p.7
B. Beckert: KI fr IM p.8
>
predicate
B. Beckert: KI fr IM p.8
>
predicate
B. Beckert: KI fr IM p.8
>
predicate
B. Beckert: KI fr IM p.8
S 1 S2
S1 S 2
S1 S 2
S1 S 2
B. Beckert: KI fr IM p.9
S 1 S2
S1 S 2
S1 S 2
S1 S 2
Example
B. Beckert: KI fr IM p.9
S 1 S2
S1 S 2
S1 S 2
S1 S 2
Example
B. Beckert: KI fr IM p.9
S 1 S2
S1 S 2
S1 S 2
S1 S 2
Example
atomic sentence
B. Beckert: KI fr IM p.9
S 1 S2
S1 S 2
S1 S 2
S1 S 2
Example
B. Beckert: KI fr IM p.9
B. Beckert: KI fr IM p.10
B. Beckert: KI fr IM p.10
B. Beckert: KI fr IM p.11
B. Beckert: KI fr IM p.11
B. Beckert: KI fr IM p.12
Universal Quantication:
Syntax
Syntax
variables sentence
B. Beckert: KI fr IM p.13
Universal Quantication:
Syntax
Syntax
variables sentence
Example Everyone studying in Koblenz is smart:
x
variables
B. Beckert: KI fr IM p.13
Universal Quantication:
Semantics
Semantics
xP is true in a model
iff for all domain elements d in the model: P is true in the model when x is interpreted by d
B. Beckert: KI fr IM p.14
Universal Quantication:
Semantics
Semantics
xP is true in a model
iff for all domain elements d in the model: P is true in the model when x is interpreted by d Intuition
B. Beckert: KI fr IM p.14
Universal Quantication:
Semantics
Semantics
xP is true in a model
iff for all domain elements d in the model: P is true in the model when x is interpreted by d Intuition
equivalent to:
StudiesAt (KingJohn, Koblenz) Smart (KingJohn) StudiesAt (Richard , Koblenz) Smart (Richard ) StudiesAt (Koblenz, Koblenz) Smart (Koblenz) ...
B. Beckert: KI fr IM p.14
B. Beckert: KI fr IM p.15
B. Beckert: KI fr IM p.15
Wrong:
Existential Quantication:
Syntax
Syntax
variables sentence
B. Beckert: KI fr IM p.16
Existential Quantication:
Syntax
Syntax
variables sentence
Example Someone studying in Landau is smart:
x
variables
B. Beckert: KI fr IM p.16
Existential Quantication:
Semantics
Semantics
xP is true in a model
iff there is a domain element d in the model such that: P is true in the model when x is interpreted by d
B. Beckert: KI fr IM p.17
Existential Quantication:
Semantics
Semantics
xP is true in a model
iff there is a domain element d in the model such that: P is true in the model when x is interpreted by d Intuition
B. Beckert: KI fr IM p.17
Existential Quantication:
Semantics
Semantics
xP is true in a model
iff there is a domain element d in the model such that: P is true in the model when x is interpreted by d Intuition
equivalent to:
StudiesAt (KingJohn, Landau) Smart (KingJohn) StudiesAt (Richard , Landau) Smart (Richard ) StudiesAt (Landau, Landau) Smart (Landau) ...
B. Beckert: KI fr IM p.17
B. Beckert: KI fr IM p.18
B. Beckert: KI fr IM p.18
Wrong:
Properties of Quantiers
Quantiers of same type commute
xy xy
yx yx
B. Beckert: KI fr IM p.19
Properties of Quantiers
Quantiers of different type do NOT commute
xy
Example
yx
xyLoves(x, y)
There is a person who loves everyone in the world
yxLoves(x, y)
Everyone in the world is loved by at least one person (Both hopefully true but different)
B. Beckert: KI fr IM p.20
Properties of Quantiers
Quantiers of different type do NOT commute
xy
Example
yx
xyMother(x, y)
Everyone has a mother (correct) (wrong)
yxMother(x, y)
There is a person who is the mother of everyone
B. Beckert: KI fr IM p.21
Properties of Quantiers
Quantier duality
B. Beckert: KI fr IM p.22
B. Beckert: KI fr IM p.23
B. Beckert: KI fr IM p.23
B. Beckert: KI fr IM p.23
Equality
Semantics
B. Beckert: KI fr IM p.24
Equality
Example Denition of (full) sibling in terms of Parent
x, y Sibling(x, y) ((x = y) m, f ((m = f ) Parent (m, x) Parent ( f , x) Parent (m, y) Parent ( f , y)))
B. Beckert: KI fr IM p.25
are dened for rst-order logic in the same way as for propositional logic
B. Beckert: KI fr IM p.26
are dened for rst-order logic in the same way as for propositional logic Calculi There are sound and complete calculi for rst-order logic (e.g. resolution) Whenever KB
B. Beckert: KI fr IM p.27