Advanced Topics in FOL - PowerPoint PPT Presentation

About This Presentation
Title:

Advanced Topics in FOL

Description:

g satisfies an n-ary atom R(t1,...,tn) iff b1,...,bn RM, where each bi is ... We say that a sentence S is a first-order validity iff every structure makes. S true. ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 21
Provided by: giorgija
Category:
Tags: fol | advanced | an | atom | makes | topics | up | what

less

Transcript and Presenter's Notes

Title: Advanced Topics in FOL


1
Advanced Topics in FOL
Language, Proof and Logic
Chapter 18
2
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 ltx1,...,xngt 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 ltx,xgt x?D.

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
Dn?D. This function is called the extension of P
in M. This includes names (constants),
which are nothing but 0-ary function symbols.
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
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, gv/? 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 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.

4
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
    lt?1,...,?ngt?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, gv/?
    satisfies Q.
  • g satisfies ?vQ iff for some ??DM, gv/?
    satisfies Q.

We write
M Pg to indicate that g
satisfies the wff P in M.
5
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.
6
Truth and satisfaction, revisited
18.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 Pg1 iff M2 Pg2. Proof
Straightforward induction.
7
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.
8
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, 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 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).

9
Soundness for FOL
18.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
MP(c). As (again by the induction hypothesis)
R is a FO consequence of A1,...,Ak and P(c), we
then have MR. Hence MR, as desired.
... j. ?xP(x) ... c P(c) ...
m. R ... ... n. R
10
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(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
?x?yQ(x,y)
?xQ(x,f(x))
?x?y?zQ(x,y,z)
?x?yQ(x,y,f(x,y))
?x?y?z?tQ(x,y,z,t)
?x?zQ(x,f(x),z,g(x,z))
?xQ(x)
Q(c)
?yQ(c,y)
?x?yQ(x,y)
11
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 1 functions for y in the
sentence f(z) z2
2 ?z?y (1 (z x z)) lt y ?
f(z) z3
No
No
Yes
No
12
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.
13
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))).
14
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
theyre 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.
15
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 isnt 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))
No
Yes
Yes
No
Yes
No
16
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.
17
Resolution method for FOL
18.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 ?x1?x2P, 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.
18
Example
18.7.b
Assume the sentences we deal with consists of
(S1) ?x?A(x,q)??y(A(x,y)?A(y,x)) (S2)
??x?yA(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)
19
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
?xA(x,q)?A(x,f(x)
?xA(x,q)?A(f(x),x)
?x?y ?A(x,q)??A(x,y)??A(y,x)
?xA(x,q)?A(x,f(x)
?yA(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)
20
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
Write a Comment
User Comments (0)
About PowerShow.com