Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Topics in FOL Chapter 18 Language, Proof and Logic.

Similar presentations


Presentation on theme: "Advanced Topics in FOL Chapter 18 Language, Proof and Logic."— Presentation transcript:

1

2 Advanced Topics in FOL Chapter 18 Language, Proof and Logic

3 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. 2.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 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  D}. We usually write P M instead of M (P), f M instead of M (f), and D M 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.

4 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: 1.If t is a variable, then the ( M,g)-denotation of t is g(t); 2.If t is f(t 1,…,t n ), 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.

5 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(t 1,...,t n ) iff  R M, where each  i is the ( M,g)-denotation of t i. 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  D M, g[v/  ] satisfies Q. g satisfies  vQ iff for some  D M, g[v/  ] satisfies Q. We write M |= P[g] to indicate that g satisfies the wff P in M.

6 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 assignment g  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 makes S 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.

7 Truth and satisfaction, revisited 18.2.d Proposition 1. Let M 1 and M 2 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 g 2 be variable assignments that assign the same objects to the free variables in P. Then M 1 |= P[g 1 ] iff M 2 |= P[g 2 ]. Proof: Straightforward induction.

8 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 that step (even if the sentence appears in a deeply nested subproof). Since the 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  and hence 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.

9 Soundness for FOL 18.3.b  Elim: Suppose the given step derives R by this rule from Q  R and Q. Let A 1,...,A k be the assumptions in force at this step. Note that then the assumptions in force at steps Q  R and Q are also among A 1,...,A k. By the induction hypothesis, both Q  R and Q are FO consequences of A 1,...,A k. Hence, any model M that makes these k sentences true, also makes 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 mth step, R at its main level. Let P(c) be the assumption of that subproof. And let A 1,...,A k be the assumptions in force at step n. Note that the assumptions at step j are among A 1,...,A k, and the assumptions at step m are among A 1,...,A k,P(c).

10 Soundness for FOL 18.3.c Consider any model M which makes A 1,...,A k 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 A 1,...,A k 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 A 1,...,A k and P(c), we then have M ’|=R. Hence M |=R, as desired.... j.  xP(x)... c P(c)... m. R... n. R

11 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 existentially quantified variable y by f(x 1,…,x n ), where x 1,…,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)

12 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) = z 2 natural numbers be used as Skolem f(z) = z 2 + 1 functions for y in the sentence f(z) = z 2 + 2  z  y [(1 + (z x z)) < y] ? f(z) = z 3

13 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.

14 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))).

15 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 t 1 and t 2 are unifiable iff there is a substitution of terms for some or all of the variables in t 1 and t 2 such that the terms that result from the substitution are syntactically identical. Similarly, a set {t 1,…,t n } 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 t 1,…,t n 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.

16 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))

17 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.

18 Resolution method for FOL 18.7.a Suppose we have sentences S 1, S 2, S 3, … 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 S i 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  x 1  x 2 …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.

19 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))] (S 2 )  x  y[A(x,q)  A(x,y)  A(y,x)] Step 1: Bringing to prenex form Step 2: Skolemizing Step 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)]

20 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 variables Step 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)}

21 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 Substitution 4. {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 w 7.  4,6 none needed


Download ppt "Advanced Topics in FOL Chapter 18 Language, Proof and Logic."

Similar presentations


Ads by Google