advanced topics in fol chapter 18 language, proof and logic
TRANSCRIPT
Advanced Topics in FOL
Chapter 18
Language, Proof and
Logic
First-order structures18.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 <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> | xD}.
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 DnD. This function is called the extension of f in M. This includes names (constants), which are nothing but 0-ary function symbols.
Truth and satisfaction, revisited18.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(t1,…,tn), where f is an n-ary (n0) function symbol and t1,…,tn are terms, then the (M,g)-denotation of t is fM(1,…,n), where 1,…,n are the the (M,g)-denotations of t1,…,tn, respectively.
Truth and satisfaction, revisited18.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 QR iff g satisfies both Q and R. • g satisfies QR iff g satisfies Q or R or both. • g satisfies QR iff g does not satisfy Q or satisfies R or both. • g satisfies QR 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.
Truth and satisfaction, revisited18.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.
Truth and satisfaction, revisited18.2.d
Proposition 1. Let M1 and M2 be structures which have the same domain and assign the same interpretations to predicates and constant symbols in a wff P. Let g1 and g2 be variable assignments that assign the same objects to the free variables in P. Then
M1|= P[g1] iff M2|= P[g2].
Proof: Straightforward induction.
Soundness for FOL18.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.
Soundness for FOL18.3.b
® Elim: Suppose the given step derives R by this rule from QR and Q. Let A1,...,Ak be the assumptions in force at this step. Note that then the assumptions in force at steps QR and Q are also among A1,...,Ak. By the induction hypothesis, both QR and Q are FO consequences of A1,...,Ak. Hence, any model M that makes these k sentences true, alsomakes both QR 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 A1,...,Ak be the assumptions in force at step n. Note that the assumptions at step j are among A1,...,Ak, and the assumptions at step m are among A1,...,Ak,P(c).
Soundness for FOL18.3.c
Consider any model M which makes A1,...,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 A1,...,Ak 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
Skolemization18.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,…,xn 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
xyQ(x,y)
xyzQ(x,y,z)
xyztQ(x,y,z,t)
xQ(x)
xyQ(x,y)
Skolem functions18.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 xyNeighbor(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 xyNeighbor(x,y).
Could the following functions on f(z) = z2
natural numbers be used as Skolem f(z) = z2 + 1
functions for y in the sentence f(z) = z2 + 2
zy [(1 + (z x z)) < y] ? f(z) = z3
Skolem normal form18.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.
Unification – preliminary insights18.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))) xP(f(g(x)))
Second pair: P(f(g(a))) xP(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 xP(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))).
Unifiability18.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.
Unifiability: examples18.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))
Unification Algorithm18.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.
Resolution method for FOL18.7.a
Suppose we have sentences S1, S2, 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 x1x2…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.
Example18.7.b
Assume the sentences we deal with consists of: (S1) x[A(x,q)y(A(x,y)A(y,x))](S2) xy[A(x,q)A(x,y)A(y,x)]
Step 1: Bringing to prenex form
Step 2: Skolemizing
Step 3: CNF-izing
xy [A(x,q)A(x,y)A(y,x)]
xy [A(x,q)A(x,y)A(y,x)]
x[A(x,q)A(x,f(x))A(f(x),x)]
xy [A(x,q)A(x,y)A(y,x)]
x[(A(x,q)A(x,f(x))(A(x,q)A(f(x),x))]
xy [A(x,q)A(x,y)A(y,x)]
Example18.7.c
x[(A(x,q)A(x,f(x))(A(x,q)A(f(x),x))]
xy [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)]
xy [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)]
zw [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)}
Example18.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 w7. 4,6 none needed