1 / 82

Logic seminar 4

Logic seminar 4. Herbrand’s theorem 07.11.2005. Slobodan Petrović. Herbrand’s theorem. A general decision procedure to verify the validity (inconsistency) of a formula: Tried by Leibnitz, Peano, Hilbert, … Proved inexistent by Church and Turing (1936)

Download Presentation

Logic seminar 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Logic seminar 4 Herbrand’s theorem 07.11.2005. Slobodan Petrović

  2. Herbrand’s theorem • A general decision procedure to verify the validity (inconsistency) of a formula: • Tried by Leibnitz, Peano, Hilbert, … • Proved inexistent by Church and Turing (1936) • Church and Turing independently showed that there is no general decision procedure to check the validity of formulas of the first order logic.

  3. Herbrand’s theorem • There are, however, proof procedures which can verify that a formula is valid if it is valid indeed. • For invalid formulas, these procedures never terminate in general. • This is the best that one can expect from a proof procedure.

  4. Herbrand’s theorem • By definition, a valid formula is a formula that is true under all interpretations. • Herbrand (1930) developed an algorithm to find an interpretation (if it exists) that can falsify a given formula. • If the given formula is indeed valid, no such interpretation can exist and Herbrand’s algorithm halts after a finite number of trials.

  5. Herbrand’s theorem • Herbrand’s procedure is a refutation procedure. • Instead of proving a formula valid, it proves that the negation of the formula is inconsistent. • There is no loss of generality in using refutation procedures. • The refutation procedures are applied to a “standard” form of a formula.

  6. Herbrand’s theorem • The standard form: • A formula of the first order logic is transformed into prenex normal form: • The matrix contains no quantifiers • The prefix is a sequence of quantifiers. • The matrix is transformed into a conjunctive normal form. • The existential quantifiers in the prefix are eliminated by using Skolem functions.

  7. Herbrand’s theorem • Skolem standard form (standard form) • Let a formula F be already in a prenex normal form (Q1x1)…(Qnxn)M, where M is in a conjunctive normal form. • Let Qr be an existential quantifier in the prefix (Q1x1)…(Qnxn), 1≤r≤n.

  8. Herbrand’s theorem • Skolem standard form (cont.) • If no universal quantifier appears before Qr, we do the following: • choose a new constant c different from other constants occurring in M; • replace all xr appearing in M by c; • delete (Qrxr) from the prefix.

  9. Herbrand’s theorem • Skolem standard form (cont.) • If Qs1,…,Qsm are all the universal quantifiers appearing before Qr, 1≤s1≤s2≤…≤sm≤r, we do the following: • choose a new m-place function symbol f different from other function symbols occurring in M; • replace all xr appearing in M by f(xs1,xs2,…,xsm); • delete (Qrxr) from the prefix.

  10. Herbrand’s theorem • Skolem standard form (cont.) • After this process is applied to all the existential quantifiers in the prefix, a Skolem standard form of the formula F is obtained. • The constants and functions used to replace the existential variables are called Skolem functions. • This process is called Skolemization.

  11. Herbrand’s theorem • Example • Obtain a standard form of the formula • (x)(y)(z)(u)(v)(w)P(x,y,z,u,v,w) • (x) is preceded by no universal quantifiers, (u) is preceded by (y) and (z), and (w) by (y), (z) and (v). • Therefore, we replace the existential variable x by a constant a, u by a two-place function f(y,z), and w by a three-place function g(y,z,v). • The standard form of the formula is • (y)(z)(v)P(a,y,z,f(y,z),v,g(y,z,v)).

  12. Herbrand’s theorem • Example • Obtain a standard form of the formula • (x)(y)(z)((~P(x,y)Q(x,z))R(x,y,z)). • First, the matrix is transformed into a conjunctive normal form: • (x)(y)(z)((~P(x,y)R(x,y,z))(Q(x,z)R(x,y,z))). • Then, since (y) and (z) are both preceded by (x), the existential variables y and z are replaced, respectively by one-place functions f(x) and g(x). • The standard form of the formula is • (x)((~P(x,f(x))R(x,f(x),g(x)))(Q(x,g(x))R(x,f(x),g(x)))).

  13. Herbrand’s theorem • Definition • A clause is a disjunction of literals. • When it is convenient, it is possible to regard a set of literals as synonymous with a clause. • Example • PQ~R={P,Q,~R} • A clause consisting of r literals is called an r-literal clause. • A one-literal clause is called a unit clause.

  14. Herbrand’s theorem • When a clause contains no literal, it is called the empty clause. • Since the empty clause has no literal that can be satisfied by an interpretation, the empty clause is always false. • The empty clause is denoted by □. • Example – the clauses are • ~P(x,f(x))R(x,f(x),g(x)) • Q(x,g(x))R(x,f(x),g(x)).

  15. Herbrand’s theorem • A set S of clauses is regarded as a conjunction of all clauses in S. • Every variable in S is considered governed by a universal quantifier. • Thus, a standard form can be represented by a set of clauses.

  16. Herbrand’s theorem • Example • The standard form of the formula • (x)((~P(x,f(x))R(x,f(x),g(x)))(Q(x,g(x))R(x,f(x),g(x)))) • can be represented by a set of clauses • {~P(x,f(x))R(x,f(x),g(x)), Q(x,g(x))R(x,f(x),g(x))}. • Theorem • Let S be a set of clauses that represents a standard form of a formula F. • Then F is inconsistent if and only if S is inconsistent.

  17. Herbrand’s theorem • Let S be a standard form of a formula F. • If F is inconsistent, then F=S. • If F is not inconsistent, F is not equivalent to S in general. • Example • F=(x)P(x), • S=P(a). • S is a standard form of F.

  18. Herbrand’s theorem • Example (cont.) • The interpretation I: • Domain: D={1,2} • Assignment for P: P(1)=F, P(2)=T. • F is true in I, but S is false in I. That is, FS. • A formula may have more than one standard form. • When a formula F is transformed into a standard formula S, existential quantifiers should be replaced by the simplest possible Skolem functions – with the least number of arguments.

  19. Herbrand’s theorem • Existential quantifiers should be moved to the left as far as possible. • If F=F1…Fn, it is possible to separately obtain a set Si of clauses, where Si represents a standard form of Fi, i=1,…,n. • Let S=S1…Sn. • Then F is inconsistent if and only if S is inconsistent.

  20. Herbrand’s theorem • Example • The theorem: If xx=e for all x in group G, where  is a binary operator and e is the identity in G, then G is commutative. • We first symbolize the theorem and some other axioms of group theory. • Then we represent the negation of the theorem as a set of clauses.

  21. Herbrand’s theorem • Example (cont.) • The axioms of the group: • A1: x,yG implies that xyG (closure property) • A2: x,y,zG implies that x(yz)=(xy)z (associativity property) • A3: xe=ex=x for all xG (identity property) • A4: For every xG there exists an element x-1G such that xx-1=x-1x=e (inverse property).

  22. Herbrand’s theorem • Example (cont.) • Let P(x,y,z) stand for xy=z and i(x) for x-1. • Then, the axioms of the group can be represented by: • A1’: (x)(y)(z)P(x,y,z) • A2’: (x)(y)(z)(u)(v)(w)(P(x,y,u)P(y,z,v)P(u,z,w)P(x,v,w)) (x)(y)(z)(u)(v)(w)(P(x,y,u)P(y,z,v)P(x,v,w)P(y,z,w)) • A3’: (x)P(x,e,x)(x)P(e,x,x) • A4’: (x)P(x,i(x),e)(x)P(i(x),x,e).

  23. Herbrand’s theorem • Example (cont.) • The conclusion of the theorem: • B: If xx=e for all xG, then G is commutative, i.e., uv=vu for all u,vG. • B formalized: • B’: (x)P(x,x,e)((u)(v)(w)(P(u,v,w)P(v,u,w))). • The entire theorem is represented by the formula: • F=A1’…A4’B’. • Thus, ~F=A1’A2’A3’A4’~B’.

  24. Herbrand’s theorem • Example (cont.) • To obtain a set S of clauses for ~F, we first obtain a set Si of clauses for each axiom Ai’, i=1, 2, 3, 4: • S1: {P(x,y,f(x,y))} • S2: {~P(x,y,u)~P(y,z,v)~P(u,z,w)P(x,v,w), ~P(x,y,u)~P(y,z,v)~P(x,v,w)P(u,z,w)} • S3: {P(x,e,x),P(e,x,x)} • S4: {P(x,i(x),e),P(i(x),x,e)}.

  25. Herbrand’s theorem • Example (cont.) • ~B’=~((x)P(x,x,e)((u)(v)(w)(P(u,v,w)P(v,u,w)))) =~(~(x)P(x,x,e)((u)(v)(w)(~P(u,v,w)P(v,u,w)))) =(x)P(x,x,e)~((u)(v)(w)(~P(u,v,w)P(v,u,w))) =(x)P(x,x,e)(u)(v)(w)(P(u,v,w)~P(v,u,w)). • A set of clauses for ~B’: • T: {P(x,x,e),P(a,b,c),~P(b,a,c)}.

  26. Herbrand’s theorem • Example (cont.) • The set S=S1S2S3S4T: • (1) P(x,y,f(x,y)) • (2) ~P(x,y,u)~P(y,z,v)~P(u,z,w)P(x,v,w) • (3) ~P(x,y,u)~P(y,z,v)~P(x,v,w)P(u,z,w) • (4) P(x,e,x) • (5) P(e,x,x) • (6) P(x,i(x),e) • (7) P(i(x),x,e) • (8) P(x,x,e) • (9) P(a,b,c) • (10) ~P(b,a,c).

  27. Herbrand’s theorem • F is valid if and only if S is inconsistent. • Refutation procedures are used to prove theorems. • The input to a refutation procedure is always a set of clauses. • Instead of “inconsistent” (“consistent”) “unsatisfiable” (“satisfiable”) is used, respectively for sets of clauses.

  28. Herbrand’s theorem • The Herbrand universe of a set of clauses • A set of clauses S is unsatisfiable if and only if it is false under all interpretation over all domains. • It is impossible to consider all interpretations over all domains. • It would be desirable to have one special domain H such that S is unsatisfiable if and only if S is false under all the interpretations over this domain. • There exists such a domain – Herbrand universe of S.

  29. Herbrand’s theorem • The Herbrand universe of a set of clauses • Let H0 be the set of constants appearing in S. • If no constant appears in S, then H0 is to consist of a single constant, H0={a}. • For i=0,1,2,… let Hi+1 be the union of Hi and the set of all terms of the form fn(t1,…,tn) for all n-place functions fn occurring in S, where tj, j=1,…,n, are members of the set Hi. • Hi is called the i-level constant set of S.

  30. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example 1: S={P(a),P(x)P(f(x))} • H0={a} • H1={a,f(a)} • H2={a,f(a),f(f(a))} • . • . • H={a,f(a),f(f(a)),f(f(f(a))),…}

  31. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example 2: S={P(x)Q(x),R(z),T(y)W(y)} • There is no constant in S, so we let H0={a} • There is no function symbol in S, hence H=H0=H1=…={a} • Example 3: S={P(f(x),a,g(y),b)} • H0={a,b} • H1={a,b,f(a),f(b),g(a),g(b)} • H2={a,b,f(a),f(b),g(a),g(b),f(f(a)),f(f(b)),f(g(a)),f(g(b)),g(f(a)),g(f(b)),g(g(a)),g(g(b))} • …

  32. Herbrand’s theorem • The Herbrand universe of a set of clauses • Expression – a term, a set of terms, an atom, a set of atoms, a literal, a clause, or a set of clauses. • When no variable appears in an expression, it is called a ground expression. • It is possible to use a ground term, a ground atom, a ground literal, and a ground clause – this means that no variable occurs in respective expressions. • A subexpression of an expression E is an expression that occurs in E.

  33. Herbrand’s theorem • The Herbrand universe of a set of clauses • Let S be a set of clauses. The set of ground atoms of the form Pn(t1,…,tn) for all n-place predicates Pn occurring in S, where t1,…,tn are elements of the Herbrand universe of S, is called the atom set, or the Herbrand base of S. • A ground instance of a clause C of the set S of clauses is a clause obtained by replacing variables in C by members of the Herbrand universe of S.

  34. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example • S={P(x),Q(f(y))R(y)} • C=P(x) is a clause in S • H={a,f(a),f(f(a)),…} is the Herbrand universe of S. • P(a) and P(f(f(a))) are ground instances of C.

  35. Herbrand’s theorem • The Herbrand universe of a set of clauses • Let S be a set of clauses. • An interpretation over the Herbrand universe of S is an assignment of constants, function symbols and predicate symbols occurring in S.

  36. Herbrand’s theorem • The Herbrand universe of a set of clauses • Let S be a set of clauses, H the Herbrand universe of S and I an interpretation of S over H. I is an H-interpretation of S if: • I maps all constants in S to themselves. • Let f be an n-place function symbol and h1,…,hn be elements of H. In I, f is assigned a function that maps (h1,…,hn) (an element in Hn) to f(h1,…,hn) (an element in H).

  37. Herbrand’s theorem • The Herbrand universe of a set of clauses • There is no restriction on the assignment to each n-place predicate symbol in S. • Let A={A1,A2,…,An,…}be the atom set of S. • An H-interpretation I can be conveniently represented by a set I={m1,m2,…,mn,…} in which mj is either Aj or ~Aj for j=1,2,… • If mj is Aj then Aj is assigned “true”, otherwise Aj is assigned “false”.

  38. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example: S={P(x)Q(x),R(f(y))} • The Herbrand universe of S is H={a,f(a),f(f(a)),…}. • Predicate symbols: P, Q, R. • The atom set of S: • A={P(a),Q(a),R(a),P(f(a)),Q(f(a)),R(f(a)),…}. • Some H-interpretations for S: • I1={P(a),Q(a),R(a),P(f(a)),Q(f(a)),R(f(a)),…} • I2={~P(a),~Q(a),~R(a),~P(f(a)),~Q(f(a)),~R(f(a)),…} • I3={P(a),Q(a),~R(a),P(f(a)),Q(f(a)),~R(f(a)),…}

  39. Herbrand’s theorem • The Herbrand universe of a set of clauses • An interpretation of a set S of clauses does not necessarily have to be defined over the Herbrand universe of S. • Thus an interpretation may not be an H-interpretation. • Example: • S={P(x),Q(y,f(y,a))} • D={1,2}

  40. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example (cont.) – an interpretation of S:

  41. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example (cont.) – we can define an H-interpretation I* corresponding to I. • First we find the atom set of S • A={P(a),Q(a,a),P(f(a,a)),Q(a,f(a,a)),Q(f(a,a),a),Q(f(a,a),f(a,a)),…} • Next we evaluate each member of A by using the given table • P(a)=P(2)=F • Q(a,a)=Q(2,2)=T • P(f(a,a))=P(f(2,2))=P(1)=T • Q(a,f(a,a))=Q(2,f(2,2))=Q(2,1)=F

  42. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example (cont.) • Q(f(a,a),a)=Q(f(2,2),2)=Q(1,2)=T • Q(f(a,a),f(a,a))=Q(f(2,2),f(2,2))=Q(1,1)=T • H-interpretation I* corresponding to I • I*={~P(a),Q(a,a),P(f(a,a)),~Q(a,f(a,a)),Q(f(a,a),a), ~Q(f(a,a),f(a,a)),…}.

  43. Herbrand’s theorem • The Herbrand universe of a set of clauses • If there is no constant in S, the element a used to initiate the Herbrand universe of S can be mapped into any element of the domain D. • If there is more than one element in D, then there is more than one H-interpretation corresponding to I. • Example: S={P(x),Q(y,f(y,z))}, D={1,2}

  44. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example (cont.):

  45. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example (cont.): • Then the two H-interpretations corresponding to I are: • I*={~P(a),Q(a,a),P(f(a,a)),~Q(a,f(a,a)),Q(f(a,a),a), ~Q(f(a,a),f(a,a)),…} if a=2, • I*={P(a),~Q(a,a),P(f(a,a)),~Q(a,f(a,a)),~Q(f(a,a),a), ~Q(f(a,a),f(a,a)),…} if a=1.

  46. Herbrand’s theorem • The Herbrand universe of a set of clauses • Definition • Given an interpretation I over a domain D, an H-interpretation I* corresponding to I is an H-interpretation that satisfies the condition: • Let h1,…,hn be elements of H (the Herbrand universe of S). Let every hi be mapped to some di in D. If P(d1,…,dn) is assigned T (F) by I, then P(h1,…,hn) is also assigned T(F) in I*. • Lemma: • If an interpretation I over some domain D satisfies a set S of clauses, then any H-interpretation I* corresponding to I also satisfies S.

  47. Herbrand’s theorem • The Herbrand universe of a set of clauses • Theorem • A set S of clauses is unsatisfiable if and only if S is false under all the H-interpretations of S. • We need consider only H-interpretations for checking whether or not a set of clauses is unsatisfiable. • Thus, whenever the term “interpretation” is used, a H-interpretation is meant.

  48. Herbrand’s theorem • The Herbrand universe of a set of clauses • Let  denote an empty set. Then: • A ground instance C’ of a clause C is satisfied by an interpretation I if and only if there is a ground literal L’ in C’ such that L’ is also in I, i.e. C’I. • A clause C is satisfied by an interpretation I if and only if every ground instance of C is satisfied by I. • A clause C is falsified by an interpretation I if and only if there is at least one ground instance C’ of C such that C’ is not satisfied by I. • A set S of clauses is unsatisfiable if and only if for every interpretation I there is at least one ground instance C’ of some clause C in S such that C’ is not satisfied by I.

  49. Herbrand’s theorem • The Herbrand universe of a set of clauses • Example: Consider the clause C=P(x)Q(f(x)). Let I1, I2, and I3 be defined as follows: • I1={P(a),Q(a),P(f(a)),Q(f(a)),P(f(f(a))),Q(f(f(a))),…} • I2={P(a),Q(a),P(f(a)),Q(f(a)),P(f(f(a))),Q(f(f(a))),…} • I3={P(a),Q(a),P(f(a)),Q(f(a)),P(f(f(a))),Q(f(f(a))),…} • C is satisfied by I1 and I2, but falsified by I3. • Example: S={P(x),P(a)}. The only two H-interpretations are: I1={P(a)}, I2={P(a)}. • S is falsified by both H-interpretations and therefore is unsatisfiable.

  50. Herbrand’s theorem • Semantic trees • Introduced by Robinson, 1968. • It can be shown that finding a proof for a set of clauses is equivalent to generating a semantic tree. • Definition • If A is an atom, then the two literals A and A are said to be each other’s complement. • The set {A,A} is called a complementary pair. • A clause is a tautology if it contains a complementary pair.

More Related