Sunteți pe pagina 1din 21

The First-Order Language L

c G. Lakemeyer

Gerhard Lakemeyer

Summer Term 2014

Why rst-order logic?

Examples: In(blockA,box) In(blockB, box) In(blockC,box)


c G. Lakemeyer

xIn(x,box) xIn(x,box) Light(x) heaviest-block = blockA heaviest-block = favourite(john) Express knowledge that is incomplete Expressive power = what can be left unsaid

LKB/SS-2014

2 / 18

Knowing Who
Consider Teaches(ai-course,father(bill)) Would like to know Who is the father of Bill?
c G. Lakemeyer

Might have father(bill) = best-friend(george) But then Who is the best friend of George? Might have father(bill) = mister-smith But Who is Mister Smith?

LKB/SS-2014

3 / 18

Standard Names
Two options:
1

say you never really know who teachers are. Just a collection of Teaches(ai-course,t),

c G. Lakemeyer

ti = tj ,
2

tj = tk

partition domain into equivalence classes named #1,#2,#3, . . . know who = know which equivalence class father(bill) = #27

We will follow Option 2.


#

1,#2,#3, . . . are called standard names.


4 / 18

LKB/SS-2014

The Logic L

L is is a rst-order logic with function and predicate symbols of any arity equality
c G. Lakemeyer

standard names as the domain of discourse Note: What makes L special is that that the domain of discourse is xed and also part of the language. Caveat: Basic knowledge of classical rst-order logic is assumed. We will go over the denitions rather quickly and focus on using logic for KR.

LKB/SS-2014

5 / 18

Terms in L

Variables: x1 , x2 , . . . y, z, . . . Function symbols applied to terms f (t1 , t2 , ..., tk )


c G. Lakemeyer

write: f( ) as f
#

(also called constants)

Standard names: 1,#2, . . . (Standard names are syntactically like constants. We often call standard names simply names.) Ground terms: no variables Primitive terms: f (n1 , ...., nk ) with ni standard names

LKB/SS-2014

6 / 18

Well-Formed Formulas in L
Atoms: P(t1 , ..., tk ) ti terms, P predicate symbol ground atom: no variables primitive atom: P(n1 , ...nk )
c G. Lakemeyer

with ni standard names.

Wffs: well-formed formulas of L


1

Atoms t1 = t2 If , are wffs then , ( ), x are wffs

Abbreviations: ( ), ( ), ( ), x Substitutions: tx Sentences: no free variables

LKB/SS-2014

7 / 18

Domain of quantication
Assumption: domain isomorphic to the set of names names refer uniquely names cover domain
c G. Lakemeyer

Not true for constants So can assume a single countably innite domain Two consequences:
1

in order to determine the denotation of a term it sufces to nd its co-referring standard name. can understand quantication substitutionally (e.g. to satisfy xP(x) it sufces to nd a name n such that P(n) is satised.)

LKB/SS-2014

8 / 18

Interpretations: World States

Will determine co-referring name for every ground term truth value for every sentence
c G. Lakemeyer

Need only assign to primitives w[f (n1 , ...nk )] Names w[P(n1 , ...nk )] {1,0} Example: to determine f (g(n), m) for standard names n and m get w[g(n)] = n (the co-referring name n of g(n)) then w[f (n , m)].

LKB/SS-2014

9 / 18

Ground Term Evaluation:

|t|w

c G. Lakemeyer

|n|w = n |f (t1 , ...tk )|w = w[f (n1 , ...nk )], where ni = |ti |w

LKB/SS-2014

10 / 18

Sentence Satisfaction:

w |=

w |= P(t1 ...tk ) iff w[P(n1 ...nk )] = 1 w |= (t1 = t2 ) iff |t1 |w = |t2 |w w |= iff w |= w |= ( ) iff w |= and w |=
x w |= x iff w |= n for every name n.

where ni = |ti |w

c G. Lakemeyer

LKB/SS-2014

11 / 18

Satisability & Validity

A set of sentences is satisable iff there is a w such that w |= , for every


c G. Lakemeyer

A sentence is valid (write |= ) iff w |= , for every w (iff {} is not satisable) implies (write |= ) iff {} is unsatisable These determine the logic L. The main focus is on valid sentences and nite .

LKB/SS-2014

12 / 18

Properties of Logic L

Except for =, names: |= iff is a theorem of ordinary rst-order logic Names: |= #1 = #3 Equality |= x1 y(y = x1 ) |= x1 x2 y(y = x1 ) (y = x2 ) |= x1 x2 x3 y(y = x1 ) (y = x2 ) (y = x3 ) etc.

c G. Lakemeyer

LKB/SS-2014

13 / 18

More Properties of logic L

Therefore: innite domain. Use typed quantication for (nite) subsets of the domain. instead of
c G. Lakemeyer

use: and, say,

x(P(x) ) Non-compactness

xP(x) (x = #1 x = #2 . . . x = #27)
4

There is a unsat such that every nite subset is sat: = {xP(x), P(#1), P(#2), P(#3), . . .} Because can name every domain element.

LKB/SS-2014

14 / 18

An Axiom System

Why do we care? another view of valid sentences What is not a reason (for us) to look at axioms?
c G. Lakemeyer

procedural interpretation (proof theory for generating the valid sentences) Analogy: care about language use grammar as another description separate from building recognizers

LKB/SS-2014

15 / 18

Universal generalization

Innite version:
x x From # 1 , #2 , . . . infer x x But: if I can prove n and there is nothing special about n,

then conclude x
c G. Lakemeyer

Not quite right: #1 = #2 is valid, but dont want x(x = #2) as theorem

LKB/SS-2014

16 / 18

Universal generalization

Innite version:
x x From # 1 , #2 , . . . infer x x But: if I can prove n and there is nothing special about n,

then conclude x
c G. Lakemeyer

Not quite right: #1 = #2 is valid, but dont want x(x = #2) as theorem Correct version:
x x From n , . . . , n , infer x 1 k

provided ni contain all names in and one not in .

LKB/SS-2014

16 / 18

Proof Theory
Axioms A1. ( ) A2. ( ( )) (( ) ( ))
c G. Lakemeyer

A3. ( ) (( ) ) A4. x( ) (x x ) A5. x tx A6. (n = n) (n = m), for distinct n and m

LKB/SS-2014

17 / 18

Proof Theory
Axioms A1. ( ) A2. ( ( )) (( ) ( ))
c G. Lakemeyer

A3. ( ) (( ) ) A4. x( ) (x x ) A5. x tx A6. (n = n) (n = m), for distinct n and m Rules of Inference MP. From , ( ), infer .
x x UG. From n , . . . , n , infer x if ni range over names in and one not in . 1 k

LKB/SS-2014

17 / 18

Proof Theory
Axioms A1. ( ) A2. ( ( )) (( ) ( ))
c G. Lakemeyer

A3. ( ) (( ) ) A4. x( ) (x x ) A5. x tx A6. (n = n) (n = m), for distinct n and m Rules of Inference MP. From , ( ), infer .
x x UG. From n , . . . , n , infer x if ni range over names in and one not in . 1 k

Theorem: |= iff
LKB/SS-2014

17 / 18

Example Proof

yx(x = y f (x) = f (y)) (easy to verify semantically)


1. #1 = #1
c G. Lakemeyer

A6 1,UG 2,A5 3 A6 5 4,6,UG

2. x(x = x) 3. f (#1) = f (#1) 4. (#1 = #1 f (#1) = f (#1)) 5. 2 = 1


# #

6. (#2 = #1 f (#2) = f (#1)) 7. x(x = #1 f (x) = f (#1))

8. yx(x = y f (x) = f (y)) 7,UG (Applications of Axioms A1A3 and Rule MP are not shown for simpicity.)

LKB/SS-2014

18 / 18

S-ar putea să vă placă și