/
Advanced Topics in FOL Advanced Topics in FOL

Advanced Topics in FOL - PowerPoint Presentation

trish-goza
trish-goza . @trish-goza
Follow
443 views
Uploaded On 2016-08-04

Advanced Topics in FOL - PPT Presentation

Chapter 18 Language Proof and Logic Firstorder structures 181 A firstorder structure sometimes called a model or interpretation is a function M defined on the predicate and function symbols of the language the names constants ID: 432406

iff satisfies sentence step satisfies iff step sentence terms true function sentences variable set unifiable form structure unification skolem

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Advanced Topics in FOL" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Advanced Topics in FOL

Chapter 18

Language, Proof and

LogicSlide2

First-order structures

18.1

A first-order structure

(sometimes called a

model

, or

interpretation) is a function M defined on the predicate and function symbols of the language, the names (constants), and the quantifier symbol , such that the following conditions are satisfied:

1. M() is a nonempty set D, called the domain of discourse of M.

If P is an n-ary predicate symbol of the language, then M(P) is an n-ary relation on D (i.e., a set of n-tuples <x1,...,xn> of elements of D). This relation is called the extension of P in M. It is required that the extension of the identity symbol is {<x,x> | xD}.

We usually write PM instead of M(P), fM instead of M(f), and DM or just (when the structure is fixed in the context) D instead of M().

3. If

f

is an

n

-

ary

function symbol of the language, then

M

(

f)

is an

n

-

ary

total function

on

D

, i.e., an always-defined function of type

D

n

D

. This function is called the

extension

of

f

in

M

.

This includes names (constants), which are nothing but 0-ary function symbols. Slide3

Truth and satisfaction, revisited

18.2.a

Let

M

be a first-order structure with domain

D. A variable assignment in M is, by definition, some (possibly partial) function g defined on a set of variables and taking

values in D. Given a wff P, we say that the variable assignment g is appropriate for P if all the free variables of P are in the domain of g, that is, if

g assigns objects to each free variable of P. Where g is a variable assignment, g[v/] is the assignment whose domain is that of g plus the variable v, and which assigns the same values as g, except that the new assignment assigns  to the variable v. Where g is a variable assignment appropriate for P and t is a term of P, the (M,g)-denotation of t in is defined inductively as follows:

If t is a variable, then the (M,g)-denotation of t is g(t); If t is f(t1,…,tn), where f is an n-ary (n

0

) function symbol and

t

1

,…,

t

n

are

terms, then the

(

M

,g

)-denotation of

t

is

f

M

(

1

,…,

n

)

, where

1

,…,

n

are the

the

(

M

,g

)-denotations of

t

1

,…,

t

n

, respectively.Slide4

Truth and satisfaction, revisited

18.2.b

Let

g

be

a variable assignment in M appropriate for a given formula. Then satisfaction by g in M is defined by:

g satisfies an n-ary atom R(t1,...,tn) iff <1

,...,n>RM, where each i is the (M,g)-denotation of ti. g satisfies Q iff g does not satisfy Q. g satisfies QR iff g satisfies both Q and R

. g satisfies QR iff g satisfies Q or R or both. g satisfies QR iff

g

does not satisfy

Q

or satisfies

R

or both.

g

satisfies

QR

iff

g

satisfies both

Q

and

R or neither.

g satisfies vQ iff for every DM, g[v/] satisfies Q.

g satisfies vQ iff for some DM, g[v/] satisfies Q.

We write

M

|= P[g]

to indicate that

g

satisfies the wff

P

in

M

.Slide5

Truth and satisfaction, revisited

18.2.c

Let L

be some FO language and let

M

be a structure for it. We say that

a sentence S of L is true in M iff the empty(-domain) variable assignmentg

 satisfies S in M. Otherwise S is false in M.

We say that a sentence S is a first-order consequence of a set  of sentences iff every structure that makes all sentences in  true also makesS true. We say that a sentence S is a first-order validity iff every structure makes S true. We say that a sentence S is first-order satisfiable iff there is a structure that makes S true. We say that a set  of sentences is first-order satisfiable iff there is a

structure that makes every sentence of  true. Slide6

Truth and satisfaction, revisited

18.2.d

Proposition 1. Let

M

1

and M2 be structures which have the same domain and assign the same interpretations to predicates and constant symbols in a wff P. Let g

1 and g2 be variable assignments that assign the same objects to the free variables in P. Then M1|= P[g1] iff M

2|= P[g2]. Proof: Straightforward induction. Slide7

Soundness for FOL

18.3.a

 |- S

means that

S

is provable in

F from premises that all come from .Theorem (Soundness of F)

If |-S, then S is a FO consequence of .Proof. By induction, we can show that any sentence that occurs at any step in a proof is a FO consequence of the assumptions in force at thatstep (even if the sentence appears in a deeply nested subproof). Sincethe goal sentence S appears at the main level where all assumptions

are only from , we can then conclude that S is a FO consequence of .The basis of induction is straightforward, as all premises are from  andhence FO consequences of .The inductive step requires going through all rules. Here we only consider two rules:  Elim and  Elim, leaving the other cases as exercises. Slide8

Soundness for FOL

18.3.b

Elim

:

Suppose the given step derives

R by this rule from QR and Q.

Let A1,...,Ak be the assumptions in force at this step. Note that then the assumptions in force at steps QR and Q

are also among A1,...,Ak. By the induction hypothesis, both QR and Q are FO consequences of A1,...,Ak. Hence, any model M that makes these k sentences true, alsomakes both QR and Q true. But then, by the definition of truth for , M also makes R true.

Elim: Suppose the given, nth, step derives R by this rule from xP(x) (jth step) and a subproof containing, at the m

th

step,

R

at its main level.

Let

P(c)

be the assumption of that

subproof

.

And let

A

1,...,Ak be the assumptions in force at step n. Note that the assumptions at step j are among A

1,...,Ak, and the assumptions at step m are among A1,...,Ak,P

(c)

. Slide9

Soundness for FOL

18.3.c

Consider any model

M

which makes

A

1,...,Ak

true. By the induction hypothesis, M|=xP(x). So, there is an object 

in the domain of M that satisfies P(x). Let M’ be exactly like M, only such that M’ assigns  to constant c. Since c is not contained in

A1,...,Ak and R, by Proposition 1, M’ agrees with M

(in making

true or false) on these sentences.

So,

M

makes

A

1

,...,

A

k

true. Plus, obviously we

also have

M’|=P(c). As (again by the induction hypothesis) R is a FO consequence of

A1,...,Ak and P(c), we then have M

’|=R

.

Hence

M

|=R

,

as desired.

...

j.

xP(x)

...

c

P(c)

...

m.

R

......n. R Slide10

Skolemization

18.5.a

Consider a sentence

S

in

prenex

normal form (all quantifiers precede the quantifier-free part of S). To Skolemize S

, replace in it each existentiallyquantified variable y by f(x1,…,xn), where x1,…,x

n are the variables that are universally quantified and whose quantifiers precede that of y, and f is a fresh (not occurring elsewhere) n-ary function symbol. Original sentence SkolemizationxyQ(x,y)xyzQ(x,y,z)xyztQ(x,y,z,t)

xQ(x)xyQ(x,y)Slide11

Skolem functions

18.5.b

While a sentence

S

generally is not logically equivalent to its

Skolemization

S’, the two are always equisatisfiable, that is, S is FO-

satisfiable (true in some model) iff so is S’. Indeed, every model that satisfies S’ obviously automatically also satisfies S. And every model that satisfies S can be can be turned into one satisfying S’ by interpreting the new (Skolem) function symbols of S’ as corresponding choice functions. For instance, if

xyNeighbor(x,y) is true in a given world (model), then the Skolemization xNeighbor(x,f(x)) can also be made true by interpreting f as a function that chooses, for every x, a neighbor f(x) of x. Such a function is said to be a Skolem function for y in xyNeighbor(x,y). Could the following functions on f(z) = z2 natural numbers be used as

Skolem f(z) = z2 + 1functions for y in the sentence f(z) = z2 + 2zy [(1 + (z x

z)) < y]

?

f(z) = z

3

Slide12

Skolem normal form

18.5.c

A sentence is said to be in

Skolem

normal form

iff it is a CNF prefixed with only universal quantifiers.

Claim: Every FO sentence can be efficiently (in polynomial time) brought to an equisatisfiable Skolem normal form. This plays a crucial role in automated theorem proving, through allowing us to generalize the resolution method from propositional logic to FO logic.Slide13

Unification – preliminary insights

18.6.a

Unification

is

of special importance for

Section

18.7, where the resolution method is extended to the full first-order language. For preliminary insights, compare the following pairs of sentences:

First pair: P(f(a))) xP

(f(g(x))) Second pair: P(f(g(a))) xP(f(x))The first pair is a logical possibility. It is consistent to suppose that the object f(a) has property P, but that no object of the form f(g(b)) has property P. This can only happen, though, if a is not of the form g(b).By contrast, the second pair is not a logical possibility. Because if x

P(f(x)) holds, so does the instance where we substitute g(a) for x: P(f(g(a))). But this contradicts P(f(g(a))).Slide14

Unifiability

18.6.b

Unification

gives a useful test to see if sets of claims like the above are contradictory or not. You look at the terms involved, and see if they’re “

unifiable

.”

The terms f(a) and f(g(x)) in the first pair of sentence are not

unifiable, whereas the terms in the second pair, f(g(a)) and f(x), are unifiable.Definition: Terms t1 and t2 are unifiable

iff there is a substitution of terms for some or all of the variables in t1 and t2 such that the terms that result from the substitution are syntactically identical. Similarly, a set {t1,…,tn} of erms is said to be unifiable iff there is a single substitution of terms for some or all of the variables that occur in any of t1,…,tn such that all of the resulting terms are identical.Note that whether terms are unifiable is a purely syntactic notion. It has to do with terms, not what they denote.Slide15

Unifiability: examples

18.6.c

The

following three terms are

unifiable

.

f(g(z),x), f(y,x), f(

y,h(a))The term h(a) can be substituted for x, and g(z) for y. All three terms are thus transformed into the term f(g(z),h(a

)) (note that this isn’t the only substitution that will work!)Are the following pairs of terms unifiable? g(x) h(x) h(f(x,x)) h(y) f(x,y) f(y,x) g(g(x)) g(h(y)) g(x) g(h(z)) g(x) g(h(x))Slide16

Unification Algorithm

18.6.d

There is a general

efficient (polynomial-time) procedure

for checking whether terms are

unifiable

. It is known as the unification algorithm.

Whenever the unification algorithm finds that given terms are unifiable, it also generates a particular substitution that yields a unification. Although the algorithm in full generality is not described here, doing the exercises in Section 18.6 will provide a basic idea of how it works.Slide17

Resolution method for FOL

18.7.a

Suppose we have sentences S

1

,

S

2, S3, … and want to show that they are not simultane-ously

satisfiable. To do this using resolution, carry out the following steps: 1. Put each sentence Si into prenex form. 2. Skolemize each of the resulting sentences, using different Skolem function symbols for different sentences. 3. Convert the quantifier-free part each of the resulting sentences into CNF.

4. Distribute the universal quantifiers in each resulting sentence across the conjunctions and drop the conjunction signs, ending with a set of sentences of the form x1x2…P, where P is a disjunction of literals. 5. Change the bound variables in each of the resulting sentences so that no variable appears in two of them. 6. Turn each of the resulting sentences into a set of literals by dropping the universal quantifiers and disjunction signs. In this way we end up with a set of resolution clauses. 7. Use resolution combined with unification to resolve this set of clauses. Rather than explain this (especially step 7) in great detail, let us look at an example. Slide18

Example

18.7.b

Assume the sentences we deal with consists of:

(

S

1

) x[A(x,q)y(A(x,y)A(

y,x))](S2) xy[A(x,q)A(x,y)A(

y,x)]Step 1: Bringing to prenex form Step 2: SkolemizingStep 3: CNF-izingxy [A(x,q)A(x,y)A(y,x)]xy [A(x,q)A(x,y)A(y,x)]

x[A(x,q)A(x,f(x))A(f(x),x)]xy [A(x,q)A(x,y)A(y,x)]

x[(A(

x,q

)A(

x,f

(x))(A(

x,q

)A(f(x),x))]

xy

[A(

x,q

)A(

x,y

)A(

y,x

)]Slide19

Example

18.7.c

x[(A(

x,q

)A(

x,f

(x))(A(x,q)A(f(x),x))]

xy [A(x,q)A(x,y)A(y,x)]

Step 4: Distributing s and dropping s Step 5: Renaming variablesStep 6: Dropping s and s x[A(x,q)A(x,f(x)] x[A(x,q)A(f(x),x)]xy [A(x,q)A(x,y)A(y,x)]

x[A(x,q)A(x,f(x)] y[A(y,q)A(f(y),y)]zw [A(z,q

)A(

z,w

)A(

w

,z

)]

{

A(

x,q

), A(

x,f

(x)} {A(

y,q

), A(f(y),

y

)}

{

A(z,q), A(z,w), A(w,z

)}Slide20

Example

18.7.d

Step 7: Resolving

1.

{A(

x,q

), A(x,f(x)}

2. {A(y,q), A(f(y),y)}3. {A(z,q), A(z,w), A(

w,z)} Base set of clauses Resolvent Resolved clauses Substitution4. {A(q,f(q))} 1,3 q for w,x,z 5. {A(f(q),q)} 2,3 q for

w,y,z 6. {A(q,f(q))} 3,5 f(q) for z, and q for w7. 

4,6

none needed