22
First Order Logic [1] Artificial Intelligence 2019-2020 Artificial Intelligence

Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [1]Artificial Intelligence 2019-2020

Artificial Intelligence

Page 2: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [2]Artificial Intelligence 2019-2020

Propositional possible worlds

<{0,1}, P, v>

{0,1}

P

v P {0,1} P

P

A B C D

P

<{0,1}, P, v><{0,1}, P, v><{0,1}, P, v>...

P {0,1}

v

P 2|P|

Page 3: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [3]Artificial Intelligence 2019-2020

An aside: tuples, relations and functions

arity is always an integer

Page 4: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [4]Artificial Intelligence 2019-2020

First-order possible worlds

<U, , v>

U

v U

a b c d

f /n g /p h /q

P /k Q /l R /m

Arity is an integer

that describes the expected number

of arguments

Page 5: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [5]Artificial Intelligence 2019-2020

First-order possible worlds

<U, , v>

U

v U

f n n t1 tn

f(t1, ... , tn)

P n n t1 tn

P(t1, ... , tn) wff

Page 6: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [6]Artificial Intelligence 2019-2020

First-order possible worlds

<U, , v>

U

v U

v

v U

v( a ) U a

v U

v( f /n ) : Un U f /n

v U

v( P /m ) Um P /m

Page 7: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [7]Artificial Intelligence 2019-2020

First-order possible worlds

<U, , v>

U

v U

f/n n t1 tn

f(t1, ... , tn)

f(t1, ... , tn)

v( f/n ) (<v(t1), ... , v(tn)>) U

v f/n

U t1, ... , tn

U

Page 8: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [8]Artificial Intelligence 2019-2020

First-order language (without variables) wff

, , ,

(, )

LFO wff(LFO)

wff(LFO)

wff(LFO) () wff(LFO)

, wff(LFO) ( ) wff(LFO)

, wff(LFO) ( ) wff(LFO), ( ) (() )

, wff(LFO) ( ) wff(LFO), ( ) (( ()))

, wff(LFO) ( ) wff(LFO), ( ) (( ) ( ))

Note that rules are identical to the propositional ones!

Page 9: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [9]Artificial Intelligence 2019-2020

Satisfaction (without variables) <U, , v>

P(t1, ... , tn))

<U, , v> <v(t1), ..., v(tn) > v(P/n)

wff

<U, , v> <U, , v> <U, , v> <U, , v> <U, , v> <U, , v> <U, , v> <U, , v> [s] <U, , v> <U, , v> <U, , v> [s]

Page 10: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [10]Artificial Intelligence 2019-2020

<U, , v>

U := {tom, spot, kitty, felix}

:= {tom, spot, kitty, felix, Likes/2}

v(tom) = tom, v(spot) = spot, v(kitty) = kitty, v(felix) = felix,

v(Likes/2) = U U

{<tom, tom>, <spot, tom>, <spot, kitty>, <kitty, spot>, <kitty, kitty>, <felix, kitty>}

What is true?

U

Page 11: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [11]Artificial Intelligence 2019-2020

<U, , v>

<U, , v> Likes(spot, kitty) <v(spot), v(kitty)> v(Likes/2)

<U, , v> Likes(tom, tom) <v(tom), v(tom)> v(Likes/2)

<U, , v> Likes(kitty, felix) <v(kitty), v(felix)> v(Likes/2)

<U, , v> Likes(tom, kitty) <v(tom), v(kitty)> v(Likes/2)

<U, , v> Likes(felix, kitty) <v(felix), v(kitty)> v(Likes/2)

What is true?

Page 12: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [12]Artificial Intelligence 2019-2020

<U, , v>

<U, , v> (Likes(spot, kitty) Likes(felix, kitty))

<U, , v> (Likes(tom, kitty) Likes(tom, tom))

<U, , v> (Likes(spot, tom) Likes(spot, tom))

What is true?

Page 13: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [13]Artificial Intelligence 2019-2020

First-order language wff

x, y, z

, , ,

, (, )

f n n t1 tn

f(t1, ... , tn)

P n n t1 tn

P(t1, ... , tn) wff

Page 14: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [14]Artificial Intelligence 2019-2020

First-order language wff

x, y, z

, , ,

, (, )

wff(LFO)

wff(LFO) () wff(LFO)

, wff(LFO) ( ) wff(LFO)

, wff(LFO) ( ) wff(LFO), ( ) (() )

, wff(LFO) ( ) wff(LFO), ( ) (( ()))

, wff(LFO) ( ) wff(LFO), ( ) (( ) ( ))

wff(LFO) (x ) wff(LFO)

wff(LFO) (x ) wff(LFO)

x

Page 15: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [15]Artificial Intelligence 2019-2020

Satisfaction <U, , v> s

s : U

P(t1, ... , tn))

<U, , v> [s] <v(t1) [s], ..., v(tn) [s]> v(P) [s]

wff

<U, , v> [s] <U, , v> [s]<U, , v> [s] <U, , v> [s] <U, , v> [s] <U, , v> [s] <U, , v> [s] <U, , v> [s]<U, , v> [s] <U, , v> [s] <U, , v> [s]

<U, , v> [s]x dU <U, , v> [s](x:d) <U, , v> [s] x dU <U, , v> [s](x:d)

[s](x:d) s d x

s

Page 16: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [16]Artificial Intelligence 2019-2020

<U, , v>

<U, , v> [s] (x (y Likes(x, y)))

cat1 U <U, , v> [s](x:cat1) (y Likes(x, y))

cat2 U <U, , v> ([s](x:cat1))(y:cat2) Likes(x, y)

What is true?

Page 17: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [17]Artificial Intelligence 2019-2020

<U, , v>

<U, , v> [s] (x (y Likes(x, y)))

cat1 U <U, , v> [s](x:cat1) (y Likes(x, y))

cat2 U <U, , v> ([s](x:cat1))(y:cat2) Likes(x, y)

What is true?

Page 18: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [18]Artificial Intelligence 2019-2020

Variables and quantifiers: further examples

xy (Brother(x, y) Relative(x, y))

xy (Relative(x ,y) Relative(y, x))

x (Mother(x) (y Parent(x, y) Female(x)))

xy (Cousin(x,y)

zw (Parent(z, x) Parent(w, y) (Brother(z, w) Sister(z, w))))

xy Mother(y, x)

yx Mother(y, x)

Page 19: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [19]Artificial Intelligence 2019-2020

Open formulae, sentences

wff

wff

x P(x)

x (P(x) (A(x) B(x))

P(x)y (P(y) (A(x,y) B(y)))

wff

wff

wff

Page 20: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [20]Artificial Intelligence 2019-2020

Models

wff <U, , v> [s] s

<U, , v>

<U, , v> <U, , v> s

<U, , v> wff wff

<U, , v>

<U, , v> [s] s <U, , v>

s

<U, , v> <U, , v>

Page 21: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [21]Artificial Intelligence 2019-2020

Validity in general

wff<U, , v>

(P(x) P(x))

<U, , v>

<U, , v>

x (P(x) P(x))

xy (G(x,y) (H(x,y) G(x,y)))

wff

x (P(x) P(x))

Page 22: Artificial Intelligence - PaviaArtificial Intelligence 2019-2020 First Order Logic [4] First-order possible worlds  U v U a b c d f /n g /p h /q P /k Q /l R /m Arity

First Order Logic [22]Artificial Intelligence 2019-2020

Entailment

wff wff

<U, , v> [s]

<U, , v> [s]