Professional Documents
Culture Documents
1
More Definitions More Definitions
• Quantifiers: • Quantifiers:
Forall Forall
There exists There exists
• Examples • Examples
Dumbo is grey Dumbo is grey
grey(dumbo) grey(dumbo)
• Examples
KB:
KB
E
Every dog
d has
h s a tail
t il Every dog shares a tail! P1,1
B1,1
d t has(d,t) ? t d has(d,t)
"Pits cause breezes in adjacent squares"
B1,1 (P1,2 P2,1)
B2,1 (P1,1 P2,2 P3,1)
Someone is loved by everyone
x y loves(y, x)
12
© Daniel S. Weld 11
2
Wumpus world in prop logic Semantics
• Syntax: a description of the legal
Let pit(i,j) be true if there is a pit in [i, j]. arrangements of symbols
Let breeze(i,j) be true if breezy in [i, j]. (Def “sentences”)
• Semantics: what the arrangement of
symbols means in the world
KB:
KB Inference
pit(1,1) Sentences Sentences
breeze(1,1)
Semantics
Semantics
"Pits cause breezes in adjacent squares" Representation
i,j breeze(i,j) pit(i, add(j,1)) pit(i, add(j, -1)) …
World
Models Models
13
© Daniel S. Weld 15
• M(α)
M( ) is
i th
the sett of
f all d l of
ll models fα
18
© Daniel S. Weld 19
3
Interpretations=Mappings Interpretations=Mappings
syntactic tokens model elements syntactic tokens model elements
Depiction of one possible interpretation, assuming Another interpretation, same assumptions
Constants: Functions: Relations: Constants: Functions: Relations:
Richard John Leg(p,l) On(x,y) King(p) Richard John Leg(p,l) On(x,y) King(p)
• Unify(,
U if ( )) returns
t ““mgu”” • Unify(f(g(?x, dog), ?y)), f(g(cat, ?y), dog)
Unify(city(?a), city(kent)) returns ?a/kent
• Unify(f(g(?x)), f(?x))
• Substitute(expr, mapping) returns new expr
Substitute(connected(?a, ?b), {?a/kent})
returns connected(kent, ?b)
4
Compilation to Prop. Logic I Compilation to Prop. Logic II
• Typed Logic • Universe
city a,b connected(a,b) • Cities: seattle, tacoma, enumclaw
• Universe • Firms: IBM, Microsoft, Boeing
Cities: seattle,, tacoma,, enumclaw • First
First-Order
Order formula
• Equivalent propositional formula: city c firm f hasHQ(c, f)
• Equivalent propositional formula