First-Order Logic - Artificial Inteligence - Lecture Slides, Slides of Artificial Intelligence

In the class of Artificial Inteligence we learn the basic concept of programming, here are some major points discuss in these lecture slides which I shared with you:First-Order Logic, Syntax and Semantics, Wumpus World, Knowledge Engineering, Propositional Logic, Declarative, Compositional, Context-Independent, Natural Language, Meaning Depends

Typology: Slides

2012/2013

Uploaded on 04/23/2013

saritae
saritae 🇮🇳

4.5

(10)

101 documents

1 / 27

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
First-Order Logic
Chapter 8
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download First-Order Logic - Artificial Inteligence - Lecture Slides and more Slides Artificial Intelligence in PDF only on Docsity!

First-Order Logic

Chapter 8

Docsity.com

Outline

• Why FOL?

• Syntax and semantics of FOL

• Using FOL

• Wumpus world in FOL

• Knowledge engineering in FOL

Docsity.com

First-order logic

• Whereas propositional logic assumes the

world contains facts,

• first-order logic (like natural language)

assumes the world contains

  • Objects: people, houses, numbers, colors,

baseball games, wars, …

  • Relations: red, round, prime, brother of,

bigger than, part of, comes between, …

  • Functions: father of, best friend, one more Docsity.com

Syntax of FOL: Basic elements

• Constants KingJohn, 2, NUS,...

• Predicates Brother, >,...

• Functions Sqrt, LeftLegOf,...

• Variables x, y, a, b,...

• Connectives ¬, ⇒, ∧, ∨, ⇔

• Equality =

• Quantifiers ∀, ∃

Docsity.com

Complex sentences

• Complex sentences are made from atomic

sentences using connectives

¬ S , S 1 ∧ S 2 , S 1 ∨ S 2 , S 1 ⇒ S 2 , S 1 ⇔ S 2 ,

E.g. Sibling(KingJohn,Richard) ⇒

Sibling(Richard,KingJohn)

Docsity.com

Truth in first-order logic

  • Sentences are true with respect to a model and an interpretation
  • Model contains objects (domain elements) and relations among them
  • Interpretation specifies referents for constant symbols → objects predicate symbols → relations function symbols → functional relations
  • An atomic sentence predicate(term 1 ,...,termn ) is true iff the objects referred to by term 1 ,...,termn are in the relation referred to by predicate Docsity.com

Universal quantification

  • ∀< variables > < sentence >

Everyone at NUS is smart: ∀x At(x,NUS) ⇒ Smart(x)

  • ∀x P is true in a model m iff P is true with x being each possible object in the model
  • Roughly speaking, equivalent to the conjunction of instantiations of P
  • At(KingJohn,NUS) ⇒ Smart(KingJohn) ∧ At(Richard,NUS) ⇒ Smart(Richard) Docsity.com

A common mistake to avoid

  • Typically, ⇒ is the main connective with ∀
  • Common mistake: using ∧ as the main

connective with ∀:

∀x At(x,NUS) ∧ Smart(x) means “Everyone is at NUS and everyone is smart”

Docsity.com

Another common mistake to

avoid

  • Typically, ∧ is the main connective with ∃
  • Common mistake: using ⇒ as the main

connective with ∃:

∃ x At(x,NUS) ⇒ Smart(x)

is true if there is anyone who is not at NUS!

Docsity.com

Properties of quantifiers

  • ∀x ∀y is the same as ∀y ∀x
  • ∃x ∃y is the same as ∃y ∃x
  • ∃x ∀y is not the same as ∀y ∃x
  • ∃x ∀y Loves(x,y)
    • “There is a person who loves everyone in the world”
  • ∀y ∃x Loves(x,y)
    • “Everyone in the world is loved by at least one person”
  • Quantifier duality: each can be expressed using the other
  • ∀x Likes(x,IceCream) ¬∃x ¬Likes(x,IceCream) Docsity.com

Using FOL

The kinship domain:

  • Brothers are siblings

∀x,y Brother(x,y)Sibling(x,y)

  • One's mother is one's female parent

∀m,c Mother(c) = m ⇔ (Female(m)Parent(m,c))

Docsity.com

Using FOL

The set domain:

  • ∀s Set(s) ⇔ (s = {} ) ∨ (∃x,s 2 Set(s2 ) ∧ s = {x|s2 })
  • ¬∃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 ,s2 s1 ⊆ s 2 ⇔ (∀x x ∈ s 1 ⇒ x ∈ s 2 )
  • ∀s 1 ,s2 (s 1 = s2 ) ⇔ (s1 ⊆ s 2 ∧ s 2 ⊆ s 1 )
  • Docsity.com

Knowledge base for the

wumpus world

• Perception

  • ∀t,s,b Percept([s,b,Glitter],t) ⇒ Glitter(t)

• Reflex

  • ∀t Glitter(t) ⇒ BestAction(Grab,t)

Docsity.com

Deducing hidden properties

  • ∀x,y,a,b Adjacent ([x,y],[a,b]) ⇔

[a,b] ∈ {[x+1,y], [x-1,y],[x,y+1],[x,y-1]}

Properties of squares:

  • ∀s,t At (Agent,s,t) ∧ Breeze(t) ⇒ Breezy(s)

Squares are breezy near a pit:

  • Diagnostic rule---infer cause from effect ∀s Breezy(s) ⇒ \Exi{r} Adjacent(r,s) ∧ Pit(r)$ Docsity.com