



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Draper; Class: Introduction to Artificial Intelligence; Subject: Computer Science; University: Colorado State University; Term: Fall 2008;
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!




These are the four elements that you should look for
in your critique. They should be clearly and correctly
identified, and not merely implicit
1,11,
1,21,
is derived from meaning of Bis derived from meaning of B
1,11,
andand
of Pof P
1,21,
context
context
(except by writing one sentence for each square)(except by writing one sentence for each square)
part of,part of, ……
Logics in General
Logics in General
not holdnot hold
Syntax of FOL
Syntax of FOL
E.g., Mary, 3E.g., Mary, 3
E.g., fatherE.g., father--of(Mary) = John, colorof(Mary) = John, color--of(Sky) = Blueof(Sky) = Blue
to truth values) E.g., greater(5,3), green(Grass),to truth values) E.g., greater(5,3), green(Grass),
color(Grass, Green)color(Grass, Green)
Syntax (cont.)
Syntax (cont.)
FOL supplies these primitives:
FOL supplies these primitives:
Atomic sentences
Atomic sentences
TermTerm == functionfunction (( termterm
11
,...,,..., termterm
nn
oror constantconstant oror variablevariable
Atomic sentence =Atomic sentence = predicatepredicate (( termterm
1
1
,...,,..., termterm
n
n
oror termterm
1
1
= term= term
2
2
Example terms:Example terms:
Brother(KingJohn,RichardTheLionheartBrother(KingJohn,RichardTheLionheart))
Greater(Length(LeftLegOf(RichardGreater(Length(LeftLegOf(Richard)),)),
Length(LeftLegOf(KingJohn
Length(LeftLegOf(KingJohn))))))
Complex sentencesComplex sentences
1
1
2
2
1
1
2
2
1
1
2
2
1
1
2
2
Examples:Examples:
Sibling(KingJohn,RichardSibling(KingJohn,Richard)) ⇒⇒ Sibling(Richard,KingJohnSibling(Richard,KingJohn))
greater(1,2)greater(1,2) ∨∨ less-less-oror--equalequal(1,2)(1,2)
∀∀x,y Sibling(x,y)x,y Sibling(x,y) ⇒⇒ Sibling(y,x)Sibling(y,x)
Truth in firstTruth in first--order logicorder logic
Recall that a model is the set of all possible worlds under cons
Recall that a model is the set of all possible worlds under consideration.ideration.
Sentences are true with respect to a
Sentences are true with respect to a modelmodel and anand an interpretationinterpretation
Model contains objects (domain elements) and relations among them Model contains objects (domain elements) and relations among them
Interpretation specifies referents for Interpretation specifies referents for
constant symbolsconstant symbols →→ objectsobjects
predicate symbolspredicate symbols →→ relationsrelations
function symbolsfunction symbols →→ functional relationsfunctional relations
An atomic sentence An atomic sentence predicate(termpredicate(term
11
,...,,...,termterm
nn
)) is trueis true
iff theiffthe objectsobjects referred to byreferred to by termterm
11
,...,,...,termterm
nn
are in the relation are in therelation referred to byreferred to by predicatepredicate ..
Existential quantification (cont.)
Existential quantification (cont.)
Typically,Typically, ∧∧ is the main connective withis the main connective with ∃∃
Common mistake: using
Common mistake: using ⇒
with
with ∃
∃ ∃ xx At(x,At(x, CSUCSU )) ⇒⇒ Smart(x)Smart(x)
When is this true?When is this true?
Properties of quantifiers
Properties of quantifiers
∀∀xx ∀∀yy is the same asis the same as ∀∀yy ∀∀xx
∃∃xx ∃∃yy is the same asis the same as ∃∃yy ∃∃xx
∃∃xx ∀∀yy isis notnot the same asthe same as ∀∀yy ∃∃x:x:
∃∃xx ∀∀yy Loves(x,y)Loves(x,y)
∀∀yy ∃∃x Loves(x,y)x Loves(x,y)
Quantifier duality
Quantifier duality: each can be expressed using the other: each can be expressed using the other
∀ ∀xx Likes(x,IceCreamLikes(x,IceCream)) ¬∃¬∃xx ¬¬Likes(x,IceCream)Likes(x,IceCream)
∃ ∃x Likes(x,Broccoli)x Likes(x,Broccoli) ¬∀¬∀xx ¬¬Likes(x,Broccoli)Likes(x,Broccoli)
Equality
Equality
1
1
2
2
11
22
WumpusWumpus World (World (reduxredux))
An agent (e.g. in
An agent (e.g. in wumpuswumpus world) may keepworld) may keep
a knowledge base of objects, predicates &a knowledge base of objects, predicates &
inference rulesinference rules
E.g. Stench([w,h E.g.Stench([w,h]),]), Glitter([w,hGlitter([w,h]),]), Breeze([w.hBreeze([w.h])])
These are asserted over time, as the agent
These are asserted over time, as the agent
explores
explores
E.g. Wumpus([w,h E.g.Wumpus([w,h]),]), Pit([w,hPit([w,h]),]), Gold([w,hGold([w,h])])
Warning: my presentation varies from
the book’s (which uses time, not location)
Interacting with FOL
Interacting with FOL KBsKBs
Suppose aSuppose a wumpuswumpus--world agent perceives a smell and aworld agent perceives a smell and a
breeze (but no glitter) in square [1,2]breeze (but no glitter) in square [1,2]
Tell(KB, Stench([1,2])Tell(KB, Stench([1,2])
Tell(KB
Tell(KB, Breeze([1,2])), Breeze([1,2]))
Tell(KB
Tell(KB,, ¬
Glitter([1,2]))
Glitter([1,2]))
Ask(KB, Safe([1,3]))Ask(KB, Safe([1,3]))
DeductionsDeductions
These use a set of inference rules stored in These use a set of inference rules stored in
the KB
the KB
Creating a KB using FOL
Creating a KB using FOL
Identify the task (what will the KB be used for)
Identify the task (what will the KB be used for)
2.2. Assemble the relevant knowledge
Assemble the relevant knowledge
Knowledge acquisition.Knowledge acquisition.
3.3. Decide on a vocabulary of predicates, functions, and constantsDecide on a vocabulary of predicates, functions, and constants
Translate domainTranslate domain--level knowledge into logiclevel knowledge into logic--level names.level names.
4.4. Encode general knowledge about the domainEncode general knowledge about the domain
define axiomsdefine axioms
Encode a description of the specific problem instance
Encode a description of the specific problem instance
6.6. Pose queries to the inference procedure and get answers
Pose queries to the inference procedure and get answers
7.7. Debug the knowledge baseDebug the knowledge base
Examples
Examples
The
The kinship
kinship domain
domain
Basic predicates: Female, Parent.
Basic predicates: Female, Parent.
Other predicates in this domain:Other predicates in this domain:
One's mother is one's female parentOne's mother is one's female parent
∀∀m,cm,c Mother(c)Mother(c) = m= m ⇔⇔ (Female(m)(Female(m) ∧∧ Parent(m,c))Parent(m,c))
∀∀ x,yx,y Sibling(x,y)Sibling(x,y) ⇔⇔ [[¬¬(x = y)(x = y) ∧∧ ∃∃m,fm,f ¬¬(m = f)(m = f) ∧∧ Parent(m,x)Parent(m,x) ∧∧
Parent(f,x)
Parent(f,x) ∧
Parent(m,y)
Parent(m,y) ∧
Parent(f,y)]
Parent(f,y)]
A first cousin is a child of a parent
A first cousin is a child of a parent’’s siblings sibling
x,y
x,y FirstCousin(x,y
FirstCousin(x,y)) ⇔
p,ps Parent(p,x)
p,ps Parent(p,x) ∧
Sibling(ps,p)
Sibling(ps,p) ∧
Parent(ps,y)Parent(ps,y)
These are the axioms of the domain (they are also definitions
These are the axioms of the domain (they are also definitions
since they usesince they use biconditionalsbiconditionals).).
Some sentences areSome sentences are ““theoremstheorems”” ---- they can be derived fromthey can be derived from
the axioms:the axioms:
∀∀x,yx,y Sibling(x,y)Sibling(x,y) ⇔⇔ Sibling(y,x)Sibling(y,x)
Examples (cont)
Examples (cont)
TheThe setset domaindomain
Notation:Notation: {x|s} is the set resulting from adding x to the set s.{x|s} is the set resulting from adding x to the set s.
∀∀s Set(s)s Set(s) ⇔⇔ (s = {} )(s = {} ) ∨∨ ((∃∃xx ∃∃ss
2
2
Set(sSet(s
2
2
)) ∧∧ s = {x|ss = {x|s
2
2
x
x ∃
s {x|s} = {}
s {x|s} = {}
x
x ∀
s x
s x ∈
s
s ⇔
y,s
y,s
22
} (s = {y|s
} (s = {y|s
22
(x = y
(x = y ∨
x
x ∈
s
s
22
x
x ∀
s x
s x ∈
s
s ⇔
s = {x|s}
s = {x|s}
s
s
11
s
s
22
s
s
11
s
s
22
x x
x x ∈
s
s
11
x
x ∈
s
s
22
∀∀ss
11
∀∀ss
22
(s(s
11
= s= s
22
)) ⇔⇔ (s(s
11
⊆⊆ ss
22
∧∧ ss
22
⊆⊆ ss
11
∀∀xx ∀∀ss
11
,s,s
22
xx ∈∈ (s(s
11
∩∩ ss
22
)) ⇔⇔ (x(x ∈∈ ss
11
∧∧ xx ∈∈ ss
22
∀∀xx ∀∀ss
11
,s,s
22
xx ∈∈ (s(s
11
∪∪ ss
22
)) ⇔⇔ (x(x ∈∈ ss
11
∨∨ xx ∈∈ ss
22
Examples (cont)
Examples (cont)
0 is a natural number: 0 is a natural number:
NatNum(0)NatNum(0)
The successor of a natural number is a natural number: The successor of a natural number is a natural number:
∀ ∀nn NatNum(nNatNum(n)) ⇒⇒ NatNum(S(nNatNum(S(n))))
Constraints on the successor function: Constraints on the successor function:
∀ ∀nn ¬¬(0 = S(n))(0 = S(n))
∀ ∀mm ∀∀nn ¬¬(m = n)(m = n) ⇒⇒ ¬¬(S(m) = S(n))(S(m) = S(n))
Defining addition:
Defining addition:
n
n NatNum(nNatNum(n)) ⇒
+(0, n) = n
+(0, n) = n
m
m ∀
n
n NatNum(mNatNum(m)) ∧
NatNum(n
NatNum(n)) ⇒
+(S(m), n) = S(+(m,n))
+(S(m), n) = S(+(m,n))