AIMA: Chapter 8 (Setions 8.1 and 8.2) Choueiry Setion - - PowerPoint PPT Presentation

aima chapter 8 se tions 8 1 and 8 2 choueiry se tion 8 3
SMART_READER_LITE
LIVE PREVIEW

AIMA: Chapter 8 (Setions 8.1 and 8.2) Choueiry Setion - - PowerPoint PPT Presentation

Title: First-Order Logi B.Y. AIMA: Chapter 8 (Setions 8.1 and 8.2) Choueiry Setion 8.3, disussed briey , is also required reading In tro dution to Artiial In telligene CSCE 476-876, Spring 2016


slide-1
SLIDE 1

✬ ✫ ✩ ✪

Title: First-Order Logi AIMA: Chapter 8 (Se tions 8.1 and 8.2) Se tion 8.3, dis ussed briey , is also required reading In tro du tion to Arti ial In telligen e CSCE 476-876, Spring 2016 URL:
  • www. se.unl.edu/
ho uei ry/ S1 6-4 76- 87 6 Berthe Y. Choueiry (Sh u-w e-ri) (402)472-5444 B.Y. Choueiry 1 Instru tor's notes #13 April 8, 2016
slide-2
SLIDE 2

✬ ✫ ✩ ✪

Outline
  • First-order
logi :
  • basi
elemen ts
  • syn
tax
  • seman
ti s
  • Examples
B.Y. Choueiry 2 Instru tor's notes #13 April 8, 2016
slide-3
SLIDE 3

✬ ✫ ✩ ✪

Pros and
  • ns
  • f
prop
  • sitional
logi
  • Prop
  • sitional
logi is de larativ e : pie es
  • f
syn tax
  • rresp
  • nd
to fa ts
  • Prop
  • sitional
logi allo ws partial/disjun tiv e/negated information (unlik e most data stru tures and databases)
  • Prop
  • sitional
logi is
  • mp
  • sitional
: meaning
  • f B1,1 ∧ P1,2
is deriv ed from meaning
  • f B1,1
and
  • f

P1,2

  • Meaning
in prop
  • sitional
logi is
  • n
text-indep enden t (unlik e natural language, where meaning dep ends
  • n
  • n
text)
  • but...
Prop
  • sitional
logi has v ery limited expressiv e p
  • w
er E.g., annot sa y pits ause breezes in adja en t squares ex ept b y writing
  • ne
sen ten e for ea h square B.Y. Choueiry 3 Instru tor's notes #13 April 8, 2016
slide-4
SLIDE 4

✬ ✫ ✩ ✪

Prop
  • sitional
Logi
  • is
simple
  • illustrates
imp
  • rtan
t p
  • in
ts: mo del, inferen e, v alidit y , satisabilit y , ..
  • is
restri tiv e: w
  • rld
is a set
  • f
fa ts
  • la
ks expressiv eness:

In PL, w
  • rld
  • n
tains fa ts First-Order Logi
  • more
sym b
  • ls
(ob je ts, prop erties, relations)
  • more
  • nne tiv
es (quan tier) B.Y. Choueiry 4 Instru tor's notes #13 April 8, 2016
slide-5
SLIDE 5

✬ ✫ ✩ ✪

First Order Logi

F OL pro vides more "primitiv es" to express kno wledge:
  • b
je ts (iden tit y & prop erties)
  • relations
among
  • b
je ts (in luding fun tions) Ob je ts: p eople, houses, n um b ers, Einstein, Husk ers, ev en t, .. Prop erties: smart, ni e, large, in telligen t, lo v ed,
  • urred,
.. Relations: brother-of, bigger-than, part-of,
  • urred-after,
.. F un tions: father-of, b est-friend, double-of, .. Examples: (ob je ts? fun tion? relation? prop ert y?)
  • ne
plus t w
  • equals
four [si ℄
  • squares
neigh b
  • ring
the wumpus are smelly B.Y. Choueiry 5 Instru tor's notes #13 April 8, 2016
slide-6
SLIDE 6

✬ ✫ ✩ ✪

Logi A ttra ts: mathemati ians, philosophers and AI p eople A dv an tages:
  • allo
ws to represen t the w
  • rld
and reason ab
  • ut
it
  • expresses
an ything that an b e programmed Non- ommittal to:
  • sym
b
  • ls
  • uld
b e
  • b
je ts
  • r
relations (e.g., King(Gusta v e), King(Sw eden, Gusta v e), Mer iless(King))
  • lasses,
ategories, time, ev en ts, un ertain t y .. but amenable to extensions: OO F OL, temp
  • ral
logi s, situation/ev en t al ulus, mo dal logi , et .

− →

Some p eople think F OL *is* the language
  • f
AI true/false? donno :( but it will remain around for some time.. B.Y. Choueiry 6 Instru tor's notes #13 April 8, 2016
slide-7
SLIDE 7

✬ ✫ ✩ ✪

T yp es
  • f
logi Logi s are hara terized b y what they
  • mmit
to as primitiv es On tologi al
  • mmitmen
t : what existsfa ts?
  • b
je ts? time? b eliefs? Epistemologi al
  • mmitmen
t : what states
  • f
kno wledge?

Language Ontological Commitment Epistemological Commitment (What exists in the world) (What an agent believes about facts) Propositional logic facts true/false/unknown First-order logic facts, objects, relations true/false/unknown Temporal logic facts, objects, relations, times true/false/unknown Probability theory facts degree of belief 0…1 Fuzzy logic degree of truth degree of belief 0…1

Higher-Order Logi : views relations and fun tions
  • f
F OL as
  • b
je ts B.Y. Choueiry 7 Instru tor's notes #13 April 8, 2016
slide-8
SLIDE 8

✬ ✫ ✩ ✪

Syn tax
  • f
F OL: w
  • rds
and grammar The w
  • rds:
sym b
  • ls
  • Constan
t sym b
  • ls
stand for
  • b
je ts: QueenMary , 2, UNL, et .
  • V
ariable sym b
  • ls
stand for
  • b
je ts: x , y , et .
  • Predi ate
sym b
  • ls
stand for relations: Odd, Ev en, Brother, Sibling, et .
  • F
un tion sym b
  • ls
stand for fun tions (viz. relation) F ather-of, Square-ro
  • t,
LeftLeg, et .
  • Quan
tiy ers ∀ , ∃
  • Conne tiv
es: ∧ , ∨ , ¬ , ⇒ , ⇔ ,
  • (Sometimes)
equalit y = Predi ates and fun tions an ha v e an y arit y (n um b er
  • f
argumen ts) B.Y. Choueiry 8 Instru tor's notes #13 April 8, 2016
slide-9
SLIDE 9

✬ ✫ ✩ ✪

Basi elemen ts in F OL (i.e., the grammar) In prop
  • sitional
logi , ev ery expression is a sen ten e In F OL,
  • T
erms
  • Sen
ten es:
  • atomi
sen ten es
  • mplex
sen ten es
  • Quan
tiers:
  • Univ
ersal quan tier
  • Existen
tial quan tier B.Y. Choueiry 9 Instru tor's notes #13 April 8, 2016
slide-10
SLIDE 10

✬ ✫ ✩ ✪

T erm logi al expression that refers to an
  • b
je t
  • built
with:
  • nstan
t sym b
  • ls,
v ariables, fun tion sym b
  • ls
T erm =

function(term1, . . . , termn)

  • r
  • nstan
t
  • r
v ariable
  • ground
term: term with no v ariable B.Y. Choueiry 10 Instru tor's notes #13 April 8, 2016
slide-11
SLIDE 11

✬ ✫ ✩ ✪

A tomi sen ten es state fa ts built with terms and predi ate sym b
  • ls
A tomi sen ten e =

predicate(term1, . . . , termn)

  • r term1 = term2
Examples: Brother (Ri hard, John) Married (F atherOf(Ri hard), MotherOf(John)) B.Y. Choueiry 11 Instru tor's notes #13 April 8, 2016
slide-12
SLIDE 12

✬ ✫ ✩ ✪

Complex Sen ten es built with atomi sen ten es and logi al
  • nne tiv
es

¬S S1 ∧ S2 S1 ∨ S2 S1 ⇒ S2 S1 ⇔ S2

Examples: Sibling(KingJohn,Ri hard) ⇒ Sibling(Ri hard,KingJohn)

>(1, 2) ∨ ≤(1, 2) >(1, 2) ∧ ¬>(1, 2)

B.Y. Choueiry 12 Instru tor's notes #13 April 8, 2016
slide-13
SLIDE 13

✬ ✫ ✩ ✪

T ruth in rst-order logi : Seman ti Sen ten es are true with resp e t to a mo del and an in terpretation Mo del
  • n
tains
  • b
je ts and relations among them In terpretation sp e ies referen ts for
  • nstant
symb
  • ls →
  • b
je ts pr e di ate symb
  • ls →
relations fun tion symb
  • ls →
fun tional relations An atomi sen ten e predicate(term1, . . . , termn) is true i the
  • b
je ts referred to b y term1, . . . , termn are in the relation referred to b y predicate B.Y. Choueiry 13 Instru tor's notes #13 April 8, 2016
slide-14
SLIDE 14

✬ ✫ ✩ ✪

Mo del in F OL: example

R J

$ left leg

  • n head

brother brother person person king crown left leg

The domain
  • f
a mo del is the set
  • f
  • b
je ts it
  • n
tains: v e
  • b
je ts In tended in terpretation: Ri hard refers Ri hard the Lion Heart, John refers to Evil King John, Brother refers to brotherho
  • d
relation, et . B.Y. Choueiry 14 Instru tor's notes #13 April 8, 2016
slide-15
SLIDE 15

✬ ✫ ✩ ✪

Mo dels for F OL: Lots! W e an en umerate the mo dels for a giv en KB v
  • abulary:
F
  • r
ea h n um b er
  • f
domain elemen ts n from 1 to ∞ F
  • r
ea h k
  • ary
predi ate Pk in the v
  • abulary
F
  • r
ea h p
  • ssible k
  • ary
relation
  • n n
  • b
je ts F
  • r
ea h
  • nstan
t sym b
  • l C
in the v
  • abulary
F
  • r
ea h hoi e
  • f
referen t for C from n
  • b
je ts . . . Computing en tailmen t b y en umerating mo dels is not going to b e easy! There are man y p
  • ssible
in terpretations, also some mo del domain are not b
  • unded

− →

Che king en tailmen t b y en umerating is not an
  • ption
B.Y. Choueiry 15 Instru tor's notes #13 April 8, 2016
slide-16
SLIDE 16

✬ ✫ ✩ ✪

Quan tiers allo w to mak e statemen ts ab
  • ut
en tire
  • lle tions
  • f
  • b
je ts
  • univ
ersal quan tier: mak e statemen ts ab
  • ut
ev erything
  • existen
tial quan tier: mak e statemen ts ab
  • ut
some things B.Y. Choueiry 16 Instru tor's notes #13 April 8, 2016
slide-17
SLIDE 17

✬ ✫ ✩ ✪

Univ ersal quan ti ation

∀ variables sentence

Example: all dogs lik e b
  • nes ∀ xDog(x) ⇒ LikeBones(x)
x = Indy is a dog x = Indiana Jones is a p erson

∀ x P

is equiv alen t to the
  • njun tion
  • f
instan tiations
  • f P

Dog(Indy) ⇒ LikeBones(Indy) ∧ Dog(Rebel) ⇒ LikeBones(Rebel) ∧ Dog(KingJohn) ⇒ LikeBones(KingJohn) ∧ . . .

T ypi ally: ⇒ is the main
  • nne tiv
e with ∀ Common mistak e: using ∧ as the main
  • nne tiv
e with ∀ Example: ∀ x Dog(x) ∧ LikeBones(x) all
  • b
je ts in the w
  • rld
are dogs, and all lik e b
  • nes
B.Y. Choueiry 17 Instru tor's notes #13 April 8, 2016
slide-18
SLIDE 18

✬ ✫ ✩ ✪

Existen tial quan ti ation

∃ variables sentence

Example: some studen t will talk at the T e hF air

∃ xStudent(x) ∧ TalksAtTechFair(x)

P at, Leslie, Chris are studen ts

∃ x P

is equiv alen t to the disjun tion
  • f
instan tiations
  • f P

Student(Pat) ∧ TalksAtTechFair(Pat) ∨ Student(Leslie) ∧ TalksAtTechFair(Leslie) ∨ Student(Chris) ∧ TalksAtTechFair(Chris) ∨ . . .

T ypi ally: ∧ is the main
  • nne tiv
e with ∃ Common mistak e: using ⇒ as the main
  • nne tiv
e with ∃

∃ x Student(x) ⇒ TalksAtTechFair(x)

is true if there is an y
  • ne
who is not Studen t B.Y. Choueiry 18 Instru tor's notes #13 April 8, 2016
slide-19
SLIDE 19

✬ ✫ ✩ ✪

Prop erties
  • f
quan tiers (I)

∀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 p erson who lo v es ev ery
  • ne
in the w
  • rld

∀y ∃xLoves(x, y)

Ev ery
  • ne
in the w
  • rld
is lo v ed b y at least
  • ne
p erson Quan tier dualit y: ea h an b e expressed using the
  • ther

∀x Likes(x, IceCream) ¬ ∃x ¬Likes(x, IceCream) ∃x Likes(x, Broccoli) ¬ ∀x ¬Likes(x, Broccoli)

P arsimon y prin ipal: ∀ , ¬ , and ⇒ are su ien t B.Y. Choueiry 19 Instru tor's notes #13 April 8, 2016
slide-20
SLIDE 20

✬ ✫ ✩ ✪

Prop erties
  • f
quan tiers (I I) Nested quan tier:

∀ x(∃ y(P(x, y)):

ev ery
  • b
je t in the w
  • rld
has a parti ular prop ert y , whi h is the prop ert y to b e related to some
  • b
je t b y the relation P

∃ x (∀ y(P(x, y)):

there is some
  • b
je t in the w
  • rld
that has a parti ular prop ert y , whi h is the prop ert y to b e related to ev ery
  • b
je t b y the relation P Lexi al s oping: ∀ x[Cat(x) ∨ ∃ xBrother(Richard, x)] W ell-formed form ulas (WFF): (kind
  • f
  • rre t
sp elling) ev ery v ariable m ust b e in tro du ed b y a quan tier

∀ xP(y)

is not a WFF B.Y. Choueiry 20 Instru tor's notes #13 April 8, 2016
slide-21
SLIDE 21

✬ ✫ ✩ ✪

Examples Brothers are siblings . Sibling is symmetri . One's mother is
  • ne's
female paren t . A rst
  • usin
is a hild
  • f
a paren t's sibling B.Y. Choueiry 21 Instru tor's notes #13 April 8, 2016
slide-22
SLIDE 22

✬ ✫ ✩ ✪

Examples .

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

.

∀x, y Sibling(x, y) ⇒ Sibling(y, x)

.

∀x, y Mother(x, y) ⇒ (Female(x) ∧ Parent(x, y))

.

∀x, y FirstCousin(x, y) ⇔ ∃a, b Parent(a, x) ∧ Sibling(a, b) ∧ Parent(b, y)

B.Y. Choueiry 22 Instru tor's notes #13 April 8, 2016
slide-23
SLIDE 23

✬ ✫ ✩ ✪

T ri ky example Someone is lo v ed b y ev ery
  • ne

∃ x ∀ y Loves(y, x)

Someone with red-hair is lo v ed b y ev ery
  • ne

∃ x ∀ y Redhair(x) ∧ Loves(y, x)

Alternativ ely:

∃ x Person(x) ∧ Redhair(x) ∧ (∀ y Person(y) ⇒ Loves(y, x))

B.Y. Choueiry 23 Instru tor's notes #13 April 8, 2016
slide-24
SLIDE 24

✬ ✫ ✩ ✪

Equalit y

term1 = term2

is true under a giv en in terpretation if and
  • nly
if term1 and term2 refer to the same
  • b
je t Examples
  • F
ather(John)=Henry
  • 1 = 2
is satisable
  • 2 = 2
is v alid
  • Useful
to distinguish t w
  • b
je ts:
  • Denition
  • f
(full) Sibling in terms
  • f Parent :

∀x, y Sibling(x, y) ⇔ [¬(x = y) ∧ ∃m, f¬(m = f) ∧ Parent(m, x) ∧ Parent(f, x) ∧ Parent(m, y) ∧ Parent(f, y)]

  • Sp
  • t
has at least t w
  • sisters:
... AIMA, Exer ise 8.4. W rite: All Germans sp eak the same languages, where Speaks(x, l) means that p erson x sp eaks language l . B.Y. Choueiry 24 Instru tor's notes #13 April 8, 2016
slide-25
SLIDE 25

✬ ✫ ✩ ✪

Kno wledge represen tation (KR) Domain: a se tion
  • f
the w
  • rld
ab
  • ut
whi h w e wish to express some kno wledge Example: F amily relations (kinship):
  • Ob
je ts: p eople
  • Prop
erties: gender, married, div
  • r ed,
single, wido w ed
  • Relations:
paren tho
  • d,
brotherho
  • d,
marriage.. Unary predi ates: Male, F emale Binary relations: P aren t, Sibling, Brother, Child, et . F un tions: Mother, F ather

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

B.Y. Choueiry 25 Instru tor's notes #13 April 8, 2016
slide-26
SLIDE 26

✬ ✫ ✩ ✪

In Logi (informally)
  • Basi
fa ts: axioms (denitions)
  • Deriv
ed fa ts: theorems Indep enden t axiom an axiom that annot b e deriv ed from the rest

− →

Goal
  • f
mathemati ians: nd the minimal set
  • f
indep enden t axioms In AI
  • Assertions:
sen ten es added to a KB using TELL
  • Queries
  • r
goals: sen ten es ask ed to KB using ASK B.Y. Choueiry 26 Instru tor's notes #13 April 8, 2016
slide-27
SLIDE 27

✬ ✫ ✩ ✪

In tera ting with F OL KBs Supp
  • se
a wumpus-w
  • rld
agen t is using an F OL KB and p er eiv es a smell and a breeze (but no glitter) at t = 5 :

Tell(KB, Percept([Smell, Breeze, None], 5)) Ask(KB, ∃aAction(a, 5))

I.e., do es the KB en tail an y parti ular a tions at t = 5 ? Answ er: Y es, {a/Shoot}

substitution (binding list) Giv en a sen ten e S and a substitution σ ,

denotes the result
  • f
plugging σ in to S ; e.g.,

S = Smarter(x, y) σ = {x/Hillary, y/Bill} Sσ = Smarter(Hillary, Bill) Ask(KB, S)

returns some/all σ su h that KB |

= Sσ

B.Y. Choueiry 27 Instru tor's notes #13 April 8, 2016
slide-28
SLIDE 28

✬ ✫ ✩ ✪

Prepare for next le ture: AIMA, Exer ise 8.24, page 319 T ak es(x, c, s): studen t x tak es
  • urse c
in semester s P asses(x, c, s): studen t x passes
  • urse c
in semester s S ore(x, c, s): the s ore
  • btained
b y studen t x in
  • urse c
in semester s

x > y

: x is greater that y

F

and G : sp e i F ren h and Greek
  • urses
Buys(x, y, z ): x buys y from z Sells(x, y, z ): x sells y from z Sha v es(x, y ): p erson x sha v es p erson y Born(x, c): p erson x is b
  • rn
in
  • un
try c P aren t(x, y ): p erson x is paren t
  • f
p erson y Citizen(x, c, r ): p erson x is itizen
  • f
  • un
try c for reason r Residen t(x, c): p erson x is residen t
  • f
  • un
try c
  • f
p erson y F
  • ls(x, y, t ):
p erson x fo
  • ls
p erson y at time t Studen t (x ), P erson(x ), Man(x ), Barb er(x ), Exp ensiv e(x ), Agen t(x ), Insured(x ), Smart(x ), P
  • liti ian(x
), B.Y. Choueiry 28 Instru tor's notes #13 April 8, 2016
slide-29
SLIDE 29

✬ ✫ ✩ ✪

AI Limeri k If y
  • ur
thesis is utterly v a uous Use rst-order predi ate al ulus With su ien t formalit y The sheerest banalit y Will b e hailed b y the riti s: "Mira ulous!" Henry Kautz In Canadian A rti ial Intel ligen e, Septemb er 1986 he ad
  • f
AI at A T&T L abs-R ese ar h Pr
  • gr
am
  • - hair
  • f
AAAI-2000 Pr
  • fessor
at University
  • f
W ashington, Se attle F
  • unding
Dir e tor
  • f
Institute for Data S ien e and Pr
  • fessor
at University
  • f
R
  • hester
B.Y. Choueiry 29 Instru tor's notes #13 April 8, 2016