Disproving False Conjectures

Serge Autexier

FR 6.2 Informatik, Saarland University & German Research Center for Artificial Intelligence (DFKI)

Saarbrücken, Germany, autexier@dfki.de

Carsten Schürmann Yale University, New Haven, USA

carsten@cs.yale.edu

SEKI Report SR–2003–06

SEKI-REPORT ISSN 1437-4447  UNIVERSITÄT DES SAARLANDES FACHBEREICH INFORMATIK D–66123 SAARBRÜCKEN GERMANY WWW: http://www.ags.uni-sb.de/

The following publication is a short version of this SEKI Report: Serge Autexier, Carsten Schürmann. Disproving False Conjectures. Proceedings of the 10th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning; Almaty, Kazakhstan.

The above short version of this SEKI Report successfully passed the following external anonymous referee process: LPAR 2003, 10th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning; full paper, 15 pp.

Editor of SEKI series: Claus-Peter Wirth FR Informatik, Universität des Saarlandes, D–66123 Saarbrücken, Germany

E-mail: cp@ags.uni-sb.de
WWW: http://www.ags.uni-sb.de/~cp/welcome.html

Disproving False Conjectures

Serge Autexier FR 6.2 Informatik, Saarland University & German Research Center for Artificial Intelligence (DFKI) Saarbrücken, Germany, autexier@dfki.de

Carsten Schürmann Yale University, New Haven, USA

                      carsten@cs.yale.edu

July 22, 2003

Abstract

For automatic theorem provers it is as important to disprove false conjectures as it is to prove true ones, especially if it is not known ahead of time if a formula is derivable inside a particular inference system. Situations of this kind occur frequently in inductive theorem proving systems where failure is a common mode of operation. This paper describes an abstraction mechanism for first-order logic over an arbitrary but fixed term algebra to second-order monadic logic with 0 successor functions. The decidability of second-order monadic logic together with our notion of abstraction yields an elegant criterion that characterizes a subclass of unprovable conjectures.

The research on automated theorem proving is inspired by Leibniz’ dream to develop a “lingua characteristica” together with a “calculus ratiocinator” in order to mechanize logical reasoning. He advocated using the purely rational and incorruptible mechanized reasoners in order to decide whether a given logical consequence holds or not. While this vision has spurred a lot of research devoted to proving true conjectures, disproving false conjectures that occur frequently in proof assistants, inductive theorem provers, and logical programming systems has attracted far less interest.

In fact, in most theorem proving systems, the default mode of operation is failure: conjectures are often entered in the hope that they are correct, the proof by cases is typically triggered by failure to prove a given subgoal, and even in logic programming, backtracking is always preceded by failure to construct a proof of a subgoal be it in Horn logic or hereditary Harrop logic [8].

In practice, the development of conjectures is an evolutionary process and typically a true conjecture is the result of a sequence of false conjectures and their disproofs. Thus, research on automatic disproving of false conjectures is equally important as automatic proving of true conjectures. Automatic disproving is of increasing relevance in the context of formal software development [2, 3], where early detection of flaws in programs reduces the overall development cost.

The key idea underlying our technique presented in this paper consists of the definition of a representational abstraction function of first-order logic formulas into a decidable fragment of second-order logic, namely second-order monadic logic without successor functions, S0S [9]. The abstraction function is effectively polynomial-time computable, preserves the structural form of the original formula, and most importantly preserves non-provability. Second-order monadic logic is decidable, and therefore disproving a conjecture in S0S implies contrapositively that the original conjecture could not have been provable either. The decision procedure of S0S is PSPACE-complete [13], but will always report true or false. Only if no proof in S0S exists, we can be sure that the conjecture is indeed false. If a proof exists, in terms of provability, nothing can be learned from it. However, the proof may contain vital information that can assist the theorem prover to try to prove the conjecture, a question which we will consider in future work.

In preliminary studies [10], we have developed a similar criterion for the first-order meta-logic M_{ω}^{+} for the logical framework LF [5], although without negation, disjunction, or implication. Besides truth and falsehood we did not consider any other logical constants or predicates. The abstraction mechanism presented in this paper, on the other hand, scales to first-order logic with equational theories (e.g. Peano Arithmetic) and is based on Leibniz equality which is prevalent in many higher-order theorem proving systems [1, 12].

The paper is organized as follows: In Sec. 1 we define syntax and sequent calculi of first-order and second-order monadic logics. The abstraction of first-order logic formulas to second-order logic formulas and the relevant meta theory is presented in Sec. 2. In Sec. 3 we extend our techniques to first-order logic with equality and show in Sec. 4 that the class of disprovable formulas includes formulas with infinite counter-models. In Sec. 5 we present details about the implementation of the technique before concluding and assessing results in Sec. 6.

1 First-Order Logic and Second-Order Monadic Logic

We recapitulate the definitions of first-order and second-order monadic logic with 0 successors (S0S) as well as the decidability result of second-order modal logic [9] that is relevant for the technique presented in this paper.

1.1 First-Order Logic

Definition 1.1 (First-Order Logic Formulas) Let T (C, V) be a term algebra freely generated from a set of constant symbols C and a list of pairwise different variable symbols V. Let P be a set of predicates. Then first-order logic formulas are defined by

First-order Logic Formulas: F ::= P (t_{1} … t_{n}) | ⊤ | ⊥ | F_{1} ⊃ F_{2} | F_{1} ∧ F_{2} | ¬F
| ∀x. F | ∃x. F

Terms:  VC (x) := [x] VC (c) = [c] VC (f(t_{1}, …, t_{n})) := ⨁_{i=1}^{n} VC (t_{i})
Formulas: VC (P (t_{1}, …, t_{n})) := ⨁_{i=1}^{n} VC (t_{i}) VC (⊤) = VC (⊥) := []
VC (F_{1} ⊃ F_{2}) = VC (F_{1} ∧ F_{2}) := VC (F_{1}) ⊕ VC (F_{2})
VC (¬F) := VC (F) VC (∀x. F) = VC (∃x. F) := VC (F) \ {x}

Figure 1: List of constants and free variables in formulas and terms, where [x] denotes the singleton list with the variable x, [c] the singleton list with the constant c, ⊕ denotes the concatenation of lists, and L \ {x} denotes the list obtained from L by removing any occurrence of the variable x.

where t_{1}, …, t_{n} ∈ T (C, V) and P ∈ P. In first-order logic, we write x, y, z for variables. For formulas F and terms t we write VC (F) and VC (t) to refer to the list^{1} of free variables and constants in F and t (cf. Fig. 1).

Substitutions are capture avoiding and play an important role in this paper, especially in the proof of the soundness Theorem 2.7. We do not distinguish between substitutions for first-order or second-order monadic logic.

Definition 1.2 (Substitutions) A substitution σ is a syntactically defined object σ ::= · | σ, t/x. As usual, we write σ(x) to apply σ to the variable x and the domain of a substitution is the set of variables for which σ(x) is defined. The domain of a substitution is always finite.

Definition 1.3 (First-Order Substitution Application) We denote by [σ]t and [σ]F the standard application of σ to first-order terms and formulas.

A sequent calculus for classical first-order logic is given in Fig. 2. All rules are standard. The subscript _{1} in the rule names identifies the quantifier rules as first-order. The superscript ^{a} indicates that a is fresh in Γ ⟹ ∀x. F for ∀_{1}I^{a} and in Γ ⟹ H for ∃_{1}E^{a}. First-order logic provides a foundation of several theorem proving systems, Spass, INKA, and others, and we illustrate its use with our running example about binary trees.

Example 1.4 (Binary trees) In first-order logic, properties of trees and paths can be expressed as formulas ranging over terms generated by a term algebra that consists of two constant symbols here (for the empty path) and leaf (for leaves in a tree), two unary function symbols left and right (for paths denoting respectively left and right subtrees), and one binary function symbol node (for non-leaf nodes of trees). We use the validtree and validpath as unary predicates that describe the well-formedness of trees and paths, respectively, mirror and reflect as binary predicates, where mirror(t, t′) stands for t′ is a tree that is derived from t by subtreewise exchanging left and right subtrees, and reflect(p, p′) for p′ is a path that is derived from p by exchanging constant left by right and vice versa. A set of axioms that relate terms is given in Fig. 3.

1We define VC (t) as a list of variables and constants as the order of the symbols simplifies the proofs.

However, the reader may think of VC (t) as a set.

Γ, F ⟹ Δ, F ax Γ ⟹ Δ, ⊤ ⊤R Γ, ⊥ ⟹ Δ ⊥L
{Γ ⟹ Δ \atop Γ, F ⟹ Δ} weak L {Γ ⟹ Δ \atop Γ ⟹ F, Δ} weak R
\begin{matrix}Γ ⟹ Δ, F & Γ ⟹ Δ, G \\ Γ ⟹ Δ, F ∧ G \end{matrix} ∧R {Γ, F, G, ⟹ Δ \atop Γ, F ∧ G ⟹ Δ} ∧L
{Γ ⟹ Δ, F, G \atop Γ ⟹ Δ, F ∨ G} ∨R \begin{matrix}Γ, F ⟹ Δ & Γ, G ⟹ Δ \\ Γ, F ∨ G ⟹ Δ \end{matrix} ∨L
{Γ, F ⟹ Δ, G \atop Γ ⟹ Δ, F ⊃ G} ⊃ R \begin{matrix}Γ, ⟹ Δ, F & Γ, G ⟹ Δ \\ Γ, F ⊃ G ⟹ Δ \end{matrix} ⊃ L
{Γ, F ⟹ Δ \atop Γ ⟹ Δ, ¬F} ¬R {Γ ⟹ Δ, F \atop Γ, ¬F ⟹ Δ} ¬L
{Γ ⟹ Δ, [a/x]F \atop Γ ⟹ Δ, ∀x. F} ∀_{1}R^{a} {Γ, ∀x. F, [t/x]F ⟹ Δ \atop Γ, ∀x. F ⟹ Δ} ∀_{1}L
{Γ ⟹ Δ, ∃x. F, [t/x]F \atop Γ ⟹ Δ, ∃x. F} ∃_{1}R {Γ, [a/x]F ⟹ Δ \atop Γ, ∃x. F ⟹ Δ} ∃_{1}L^{a}
\begin{matrix}Γ, F ⟹ Δ & Γ ⟹ F, Δ \\ Γ ⟹ Δ \end{matrix} Cut(F)

Figure 2: Sequent Calculus for Classical First-Order Logic

A property about binary trees that one may be interested in is to show that mirrored subtrees are preserved under reflecting paths which can be formally expressed as

∀t. ∀s. ∀p. (validtree(t) ∧ validtree(s) ∧ validpath(p) ∧ subtree(t, p, s))
⊃ ∃t′. ∃s′. ∃p′. (validtree(t′) ∧ validtree(s′) ∧ validpath(p′) ∧ subtree(t′, p′, s′)
∧ mirror(t, t′) ∧ reflect(p, p′) ∧ mirror(s, s′)

Without induction principles, this theorem is not provable in first-order logic. □

1.2 Second-Order Monadic Logic without Successor Functions

Second-order monadic logic without successor functions (S0S) restricts atomic formulas to the form P (x) or X(x) where x ∈ V ∪ C is either a variable or a constant, P is a unary predicate, and X is a unary variable that ranges over unary predicates.

Definition 1.5 (Second-Order Logic Formulas S0S) Let T (C, V) be a term algebra with constants and variables only, and P be defined as above in Definition 1.1 and W a list of pairwise distinct second-order variable names. Second-order monadic logic formulas are defined by

S0S formulas: G ::= P (x) | P (c) | X(x) | X(c) | ⊤ | ⊥ | G_{1} ⊃ G_{2} | G_{1} ∧ G_{2}
| ¬G | ∀x. G | ∃x. G | ∀X. G | ∃X. G

validtree(leaf) ∀t_{1}. ∀t_{2}. validtree(t_{1}) ∧ validtree(t_{2}) ⊃ validtree(node(t_{1}, t_{2})) validpath(here) ∀p. validpath(p) ⊃ validpath(left(p)) ∀p. validpath(p) ⊃ validpath(right(p)) mirror(leaf, leaf) ∀t_{1}. ∀t′_{1}. ∀t_{2}. ∀t′_{2}. mirror(t_{1}, t′_{1}) ∧ mirror(t_{2}, t′_{2}) ⊃ mirror(node(t_{1}, t_{2}), node(t′_{2}, t′_{1})) reflect(here, here) ∀p. ∀p′. reflect(p, p′) ⊃ reflect(left(p), right(p′)) ∀p. ∀p′. reflect(p, p′) ⊃ reflect(right(p), left(p′)) ∀t. subtree(t, here, t) ∀t_{1}. ∀t_{2}. ∀p. ∀t′. subtree(t_{1}, p, t′) ⊃ subtree(node(t_{1}, t_{2}), left(p), t′) ∀t_{1}. ∀t_{2}. ∀p. ∀t′. subtree(t_{2}, p, t′) ⊃ subtree(node(t_{1}, t_{2}), right(p), t′)

Figure 3: Sample set of axioms defining properties of trees

{Γ ⟹ [p/X]A, Δ \atop Γ ⟹ ∀X. A, Δ} ∀R^{p} {Γ, ∀X. A, [P/X]A ⟹ Δ \atop Γ, ∀X. A ⟹ Δ} ∀L
{Γ ⟹ [P/X]A, ∃X. A, Δ \atop Γ ⟹ ∃X. A, Δ} ∃R {Γ, [p/x]A ⟹ Δ \atop Γ, ∃x. A ⟹ Δ} ∃L^{p}

Figure 4: Additional Rules for second-order logic

where x ∈ V, c ∈ C, X ∈ W and P ∈ P. In second-order monadic logic, we write x, y, z for variables, and X, Y, Z for variables that range over predicates.

The sequent calculus for classical S0S is obtained by adding four left and right rules for the second-order quantifiers to the respective first-order natural deduction calculi as depicted in Fig. 4 where P is any predicate from P and p is new with respect to the sequent. Since we consider second-order monadic logic without successors, t ∈ V ∪ C in rules ∃_{1}I and ∀_{1}E, respectively. For the purpose of our paper the main result about second-order monadic logic is that it is decidable, which has been proved by Rabin [9].

Theorem 1.6 (Rabin, 1969) Second-order monadic logic with k successor functions is decidable. ⊓ ⊔

2 Abstraction

It is well-known that brute force search for proofs of conjectures may easily exhaust system resources regarding space and time. If a conjecture is true, the traversal of the search space in one way or another is necessary to find the derivation that is known to exist. Often, however, interim conjectures are not necessarily known to be derivable. These situations arise frequently in systems where induction principles are not axiomatized but encoded via special elimination rules. In many inductive theorem provers, therefore, failure to find a derivation in the non-inductive fragment indicates that subsequent case analyses are necessary and failure is therefore the predominant way of operation.

Of course, before a theorem prover can meaningfully fail, it must have visited every node in the search space that is potentially infinite. Alternatively, following the algorithm outlined in this paper, it is often possible to disprove formally a conjecture. Our proposed technique relies on an abstraction into second-order monadic logic without successor functions that is known to be decidable. If the abstracted formula is false, by the soundness of abstraction (Theorem 2.7), the original formula is false as well. Therefore, following the proposed classifications of abstractions by Giunchiglia and Walsh [4]^{2}, our notion of abstraction satisfies the properties of a TI abstraction with a consistent abstract space. For the domain of first-order logic, first-order monadic logic would suffice as abstract space, but equality (see Sec. 3) requires the use of second-order monadic logic.

The abstraction can be intuitively explained as follows. A derivation · ⟹ P (t_{1}, …, t_{n}) must contain information about the individual t_{i}’s in one form or another. Without axiomatizing this relation, we instead propose to approximate it, and we rewrite P (t_{1}, …, t_{n}) to a conjunction of unary atomic formulas P (x) and P (c) for any variable x and any constant c that occurs in the terms. The abstraction preserves the structure of a formula, and is defined as follows.

Definition 2.1 (Abstraction)

\begin{aligned}α(⊤) & := & ⊤ & (1) \\ α(⊥) & := & ⊥ & (2) \\ α(F_{1} ∨ F_{2}) & := & α(F_{1}) ∨ α(F_{2}) & (3) \\ α(F_{1} ∧ F_{2}) & := & α(F_{1}) ∧ α(F_{2}) & (4) \end{aligned}  \begin{aligned}α(F_{1} ⊃ F_{2}) & := & α(F_{1}) ⊃ α(F_{2}) & (5) \\ α(¬F) & := & ¬(α(F)) & (6) \\ α(∀x. F) & := & ∀x. α(F) & (7) \\ α(∃x. F) & := & ∃x. α(F) & (8) \end{aligned}

α(P (t_{1}, …, t_{n})) := ⋀_{x∈VC (P (t_{1},...,t_{n}))} P (x)  (9)

The cases (1)–(8) are straightforward, which leaves (9) to be explained. In case (9) the expresion ⋀_{x∈VC (P (t_{1},...,t_{n}))} P (x) is the conjunction of formulas defined by

⋀_{x∈[]} P (x) := ⊤, ⋀_{x∈[x′]} P (x) := P (x′), and ⋀_{x∈[x′]⊕L} P (x) := P (x′) ∧ (⋀_{x∈L} P (x))

Example 2.2 We illustrate the technique by abstracting the axioms depicted in Fig. 3. The result is shown in Fig. 5.

The following lemma ensures that the abstraction of any first-order logic formula is always a second-order monadic formula with respect to S0S. validtree(leaf) ∀t_{1}. ∀t_{2}. validtree(t_{1}) ∧ validtree(t_{2}) ⊃ validtree(t_{1}) ∧ validtree(t_{2}) validpath(here) ∀p. validpath(p) ⊃ validpath(p) ∀p. validpath(p) ⊃ validpath(p) mirror(leaf) ∧ mirror(leaf) ∀t_{1}. ∀t′_{1}. ∀t_{2}. ∀t′_{2}. mirror(t_{1}) ∧ mirror(t′_{1}) ∧ mirror(t_{2}) ∧ mirror(t′_{2})

2This paper also provides an overview of different abstraction mechanisms.

⊃ mirror(t_{1}) ∧ mirror(t_{2}) ∧ mirror(t′_{2}) ∧ mirror(t′_{1}) reflect(here) ∧ reflect(here) ∀p. ∀p′. reflect(p) ∧ reflect(p′) ⊃ reflect(p) ∧ reflect(p′) ∀p. ∀p′. reflect(p) ∧ reflect(p′) ⊃ reflect(p) ∧ reflect(p′) ∀t. subtree(t) ∧ subtree(here) ∧ subtree(t) ∀t_{1}. ∀t_{2}. ∀p. ∀t′. subtree(t_{1}) ∧ subtree(p) ∧ subtree(t′) ⊃

subtree(t_{1}) ∧ subtree(t_{2}) ∧ subtree(p) ∧ subtree(t′) ∀t_{1}. ∀t_{2}. ∀p. ∀t′. subtree(t_{2}) ∧ subtree(p) ∧ subtree(t′) ⊃

subtree(t_{1}) ∧ subtree(t_{2}) ∧ subtree(p) ∧ subtree(t′)

Figure 5: Abstractions of the sample set of axioms

Lemma 2.3 For any first-order logic formula F, α(F) is a second-order monadic formula without successor functions, and it holds VC (F) = VC (α(F)).

Proof. The proof is by induction over the structure of the formula F:

Base Case: If F is an atomic formula, then F is either ⊤, or ⊥, or of the form P (t_{1}, …, t_{n}). If F ∈ {⊤, ⊥}, then α(F) = F and thus α(F) is a second-order monadic logic formula and it holds VC (F) = VC (α(F)). Otherwise, if F := P (t_{1}, …, t_{n}), then α(P (t_{1}, …, t_{n})) is

⋀_{x∈VC (P (t_{1},...,t_{n}))} P (x).

By simple induction over the length of VC (P (t_{1}, …, t_{n})) it follows that this formula is indeed a second-order monadic logic formula without successor functions. Furthermore VC (P (t_{1}, …, t_{n})) = VC (⋀_{x∈⨁_{i=1}^{n} VC (t_{i})} P (x)) follows directly from the definition.

Induction Step: Assume that the abstractions of F_{1}, F_{2} are second-order monadic logic formulas and it holds VC (F_{i}) = VC (α(F_{i})), i = 1, 2. Then for all ∘ ∈ {∧, ∨, ⊃} obviously α(F_{1} ∘ F_{2}) := α(F_{1}) ∘ α(F_{2}) is a second-order monadic logic formula. The analogous argument applies to ¬F_{1}, ∀x. F_{1}, and ∃x. F_{1}. For the second part of the lemma it holds for F_{1} ∘ F_{2}:

VC (F_{1} ∘ F_{2}) = VC (F_{1}) ⊕ VC (F_{2}) =^{I.H.} α(VC (F_{1})) ⊕ α(VC (F_{2}))
= α(VC (F_{1})) ∘ α(VC (F_{2}))

and analogously for ¬F_{1}. For Q ∈ {∀, ∃} it holds

VC (Qx. F_{1}) = VC (F_{1}) \ {x} =^{I.H.} VC (α(F_{1})) \ {x} = VC (Qx. α(F_{1}))
⊓ ⊔

We now address the question of how substitutions and abstraction interact. Following Definition 1.2 the standard definition of substitutions may contain non-monadic terms, which complicates the interaction with abstraction. Consider the following example. Let P (f(x, y)) be a predicate and σ = g(u, v)/x a substitution. Applying σ naively to the result of abstraction P (x) ∧ P (y) would yield P (g(u, v)) ∧ P (y), which is not an S0S formula and differs from

α([σ](P (f(x, y)))) = α(P (f(g(u, v), y))) = P (u) ∧ P (v) ∧ P (y).

Thus, substitution application of σ to t differs from the standard form of application, since it is required to flatten the structure of atomic formulas, as well. It is defined over the structure of t and σ, simultaneously.

Definition 2.4 (Flattening substitution application) We denote by [[σ]](t) and [[σ]](F) the application of the homomorphic extension of σ to second-order terms and formulas defined by:

[[σ]](P (x)) := ⋀_{y∈VC (σ(x))} P (y)  (10)
[[σ]](¬F) := ¬([[σ]](F))  (11)
for ∘ ∈ {∧, ∨, ⊃} [[σ]](F_{1} ∘ F_{2}) := [[σ]](F_{1}) ∘ [[σ]](F_{2})  (12)
for Q ∈ {∀, ∃} [[σ]](Qx. F) := Qx. [[σ, x/x]](F)  (13)

where (σ, x/x) denotes the substitution that maps x to x and otherwise is identical to σ.

Substitutivity in first-order logic and S0S commute with abstraction, which is the crucial property used at several occasions in the proof of the soundness Theorem 2.7.

Lemma 2.5 Let F be a first-order logic formula and σ a first-order substitution. Then it holds:

α([σ]F) = [[σ]](α(F))

Proof. by induction on the structure of F. We only show two representative cases.

Case: If F is an atomic formula of the form P (t_{1}, …, t_{n}) then

α([σ]P (t_{1}, …, t_{n})) = α(P ([σ]t_{1}, …, [σ]t_{n}))
= ⋀ ; x∈⨁_{i=1}^{n} VC ([σ]t_{i}) P (x)

= ⋀ ; y∈⨁_{i=1}^{n} VC (t_{i}) ( ⋀_{x∈VC (σ(y))} P (x))
= ⋀ ; y∈⨁_{i=1}^{n} VC (t_{i})[[σ]]P (y)

= [[σ]] ( ⋀ ; y∈⨁_{i=1}^{n} VC (t_{i}) P (y))
= [[σ]](α(P (t_{1}, …, t_{n})))

Case: F = Qx .F′

α([σ](Qx .F′)) = α(Qx .[σ, x/x](F′))
= Qx .α([σ, x/x](F′))
= Qx .[[σ, x/x]](α(F′))
= [[σ]](Qx .(α(F′)))
= [[σ]](α(Qx .F′))
⊓ ⊔

Unfortunately, the proof theory of second-order monadic logic is not defined in terms of flattening substitution application, but rather in terms of the standard form of application, as used in the quantifier rules in Fig. 2. However, there is a direct relationship between flattening substitution application and renaming substitutions ρ

ρ ::= · | ρ, y/x | ρ, c/x.

A renaming ρ can only substitute variables or constants for variables because no successor functions are available.

This relationship is captured by extending the notion of abstraction α that currently maps only atomic formulas into conjunctions of monadic S0S predicates, to map substitutions σ into renaming substitutions ρ. Intuitively, α(σ) computes the witness substitution for the S0S quantifier rules.

α(·)  = ·
α(σ, t/x) = α(σ), y/x for some y ∈ VC (σ(x))

If σ maps x to t, the corresponding ρ maps x to some variable or constant that occurs in t. Substitution abstraction is hence a necessary step to embed substitutions that arise in firstorder logic derivations in S0S, but is it the right choice? Does it preserve the derivability of abstracted sequents?

The answer to this question is contingent on a suitable choice of abstraction to firstorder logic derivations that we describe inductively. Abstracting a derivation tree proceeds by replacing each formula in the tree by its abstraction. Axioms Γ, P (t_{1}, …, t_{n}) ⊢ P (t_{1}, …, t_{n}), Δ, for example, are mapped into α(Γ), α(P (t_{1}, …, t_{n})) ⊢ α(P (t_{1}, …, t_{n})), α(Δ). It remains to show that the abstracted derivation is really an S0S derivation which we do in two steps.

First, we show that the choice of renaming substitution is well chosen and compatible with the previous notion of flattening substitution application (see Definition 2.4). In the interest of brevity, we write [[Γ]] for a context that consists of [[σ_{1}]]F_{1} … [[σ_{n}]]F_{n}, and [Γ] for a context of the form [α(σ_{1})]F_{1} … [α(σ_{n})]F_{n}. Second, we prove soundness of our abstraction.

Lemma 2.6 (Compatibility) If [[Γ]] ⟹ [[Δ]] is the result of abstracting a derivation then [Γ] ⟹ [Δ].

Proof. By induction on the derivation of Γ ⟹ Δ. The proof is quite straightforward. We only show three representative cases.

Case: [[Γ]], [[σ]]P ⟹ [[σ]]P, [[Δ]] ax

Similarly, we obtain [Γ], [σ]P ⟹ [σ]P, [Δ] by the ax rule.

Case: {[[Γ]], ∀x. [[σ, x/x]]F, [t/x][[σ, x/x]]F ⟹ [[Δ]] \atop [[Γ]], ∀x. [[σ, x/x]]F ⟹ [[Δ]]} ∀L.

Since we are considering substitutions in S0S, the term t must always be a variable or a constant. By renaming we obtain that [t/x][[σ, x/x]]F = [[σ, t/x]]F, on which we can apply the induction hypothesis.

[Γ], ∀x. [σ, x/x]F, [σ, t/x]F ⟹ [Δ]

We can always rewrite the formula [σ, t/x]F as [t/x][σ, x/x]F by factoring out the renaming substitution and a renewed application of ∀L yields the desired

[Γ], ∀x. [σ, x/x]F ⟹ [Δ]

Case: {[[Γ]] ⟹ [a/x][[σ, x/x]]F [[Δ]] \atop [[Γ]] ⟹, ∀x. [[σ, x/x]]F [[Δ]]} ∀R^{a}.

As above, by renaming we obtain that [a/x][[σ, x/x]]F = [[σ, a/x]]F, on which we can apply the induction hypothesis.

[Γ] ⟹ [σ, a/x]F, [Δ]

We can always rewrite the term [σ, a/x]F as [a/x][σ, x/x]F by factoring out the renaming substitution. After discharging the parameter a, a renewed application of ∀L^{a} yields the desired

[Γ] ⟹ ∀x. [σ, x/x]F, [Δ] ⊓ ⊔

The translation into monadic second-order logic reduces an intrinsically undecidable problem to a decidable one and allows us to conclude from the disproof of an abstracted conjecture that the original conjecture could not have been true. The following theorem establishes that relationship with the benefit that it defines implicitly a procedure to disprove false conjectures: Using the abstraction, convert a conjecture from first-order logic into second-order monadic logic, and then run an implementation of a decision procedure for S0S. This insight can be seen as the central contribution of this work.

Theorem 2.7 (Soundness) The abstraction α of derivations in first-order logic into derivations of first-order monadic logic without successor functions preserves the non-provability of formulas: If Γ ⟹ Δ then α(Γ) ⟹ α(Δ).

Proof. By induction on the derivation of Γ ⟹ Δ. We only show the two challenging cases for the universal quantifier. All others are analogous.

Case: {Γ ⟹ Δ, ∀x. F, [a/x]F \atop Γ ⟹ Δ, ∀x. F} ∀I^{a}:

α(Γ) ⟹ α(Δ, ∀x. F, [a/x]F)  by induction hypothesis
α(Γ) ⟹ α(Δ, ∀x. F), [[a/x]]α(F)  by Lemma 2.5
α(Γ) ⟹ α(Δ, ∀x. F), [a/x]α(F)  by Lemma 2.6
α(Γ) ⟹ α(Δ, ∀x. F)  by ∀R

Case: {Γ, ∀x. F, [t/x]F ⟹ Δ \atop Γ, ∀x. F ⟹ Δ} ∀E:

α(Γ, ∀x. F, [t/x]F) ⟹ α(Δ)  by induction hypothesis
α(Γ, ∀x. F), [[t/x]]α(F) ⟹ α(Δ)  by Lemma 2.5
α(Γ, ∀x. F), [α(t/x)]α(F) ⟹ α(Δ)  by Lemma 2.6
α(Γ, ∀x. F) ⟹ α(Δ)  by ∀L
⊓ ⊔

Example 2.8 (Mirrored subtrees) Let F_{0} be the conjunction of all axioms from Fig. 3 and α(F_{0}) the conjunction of all axioms from Fig. 5. Recall the problem from Example 1.4 of proving that a reflected path p in a mirrored tree t′ leads to the same subtree as mirroring the subtree s that is found at p in the original tree t.

F_{0} ⊃ ∀t. ∀s. ∀p. (validtree(t) ∧ validtree(s) ∧ validpath(p) ∧ subtree(t, p, s))
⊃ ∃t′. ∃s′. ∃p′. (validtree(t′) ∧ validtree(s′) ∧ validpath(p′) ∧ subtree(t′, p′, s′)
∧ mirror(t, t′) ∧ reflect(p, p′) ∧ mirror(s, s′))

In second-order monadic logic without successors the abstracted version of this formula is not provable either.

F_{0} ⊃ ∀t. ∀s. ∀p. (validtree(t) ∧ validtree(s) ∧ validpath(p)

∧ subtree(t) ∧ subtree(p) ∧ subtree(s)) ⊃ ∃t′. ∃s′. ∃p′. (validtree(t′) ∧ validtree(s′) ∧ validpath(p′) ∧ subtree(t′) ∧ subtree(p′) ∧ subtree(s′) ∧ mirror(t) ∧ mirror(t′) ∧ reflect(p) ∧ reflect(p′) ∧ mirror(s) ∧ mirror(s′))

Consequently, there is no need to invoke a first-order theorem prover, because by Theorem 2.7 it is determined to fail. On the other hand with induction, analyzing cases over p yields three conjectures whose abstractions are all provable in S0S assuming a few necessary but simple lemmas about binary trees and their abstractions, which we omit from this presentation. □

The abstraction has many applications. For example, by trial and error it can be helpful to determine which axioms are indispensable for proof search. We also suspect that the proof derivations of the abstracted formula contains much information that is useful to guide a theorem prover during the proof search process.

3 Treating Primitive Equality

The decision procedure defined in the previous sections is restricted to first-order logic without primitive equality. Thus, equality is treated like any other binary predicate and an equation s = t is abstracted to the monadic formula (⋀_{x∈VC (s=t)} = (x)).

In order to support primitive equality in an adequate way we extend the abstraction function to primitive equality and abstract equations to

α(s = t) := ∀X. (⋀_{x∈VC (s)} X(x)) ⊃ (⋀_{x∈VC (t)} X(x)) ∧∀X. (⋀_{x∈VC (t)} X(x)) ⊃ (⋀_{x∈VC (s)} X(x))

Differently to the first-order case without equality, second-order quantifiers are necessary to range over predicates, such as subtree, mirror, or reflect.

Remark 3.1 This mapping is inspired by the Leibniz’ definition of equality in higherorder logic, which is s =_{Leibniz} t := ∀P. P (s) ⊃ P (t) with the only difference that besides the covariant it also involves the contravariant direction of implication. Without ∀X. (⋀_{x∈VC (t)} X(x)) ⊃ (⋀_{x∈VC (s)} X(x)), for example, primitive equality would not be adequately captured in S0S. In higher-order logic P may be instantiated with any predicate p_{ι→o} as well as with λx. ¬p(x), while in S0S the latter is not possible. However, the latter is necessary in order to obtain for each p not only p(s) ⊃ p(t), but also the converse p(t) ⊃ p(s), as used in the base case of Lemma 3.2.

It can be easily seen that the abstraction of a first-order equation is a second-order monadic formula due to the quantifier over X.

In the presence of primitive equality, we add the following rules to complete the sequent calculus for first-order logic with primitive equality. For those rules we denote by C_{|u←v} the replacement of exactly one occurrence of u with v in C.

Γ ⟹ t = t, Δ refl {Γ, s = t ⟹ F_{|t←s}, Δ \atop Γ, s = t ⟹ F, Δ} ^{Sub{r \atop l}} {Γ, s = t ⟹ F_{|s←t}, Δ \atop Γ, s = t ⟹ F, Δ} ^{Sub{r \atop r}}

{Γ, F_{|t←s}, s = t ⟹ Δ \atop Γ, F, s = t ⟹ Δ} ^{Sub{l \atop l}} {Γ, F_{|s←t}, s = t ⟹ Δ \atop Γ, F, s = t ⟹ Δ} ^{Sub{l \atop r}}

where for Sub-rules none of the variables in s and t are bound in F.

Lemma 3.2 Any S0S sequent of the form Γ, α(s = t), α(F_{|s←t}) ⟹ α(F), Δ or Γ, α(s = t), α(F) ⟹ α(F_{|s←t}), Δ is provable.

Proof. The proof is by induction over the structure of F.

Base Case: F = P (t_{1}, …, t_{n}): In that case it holds

α(F_{|s←t}) = α(P (t_{1}, …, t_{n})_{|s←t}) = ⋀_{x∈VC (P (t_{1},...,t_{n})_{|s←t})} P (x)

and α(F) = α(P (t_{1}, …, t_{n})) = ⋀_{x∈VC (P (t_{1},...,t_{n}))} P (x). Note that by definition of VC there exist lists L, L′ such that VC (P (t_{1}, …, t_{n})_{|s←t}) = L ⊕ VC (t) ⊕ L′ and VC (P (t_{1}, …, t_{n})) = L ⊕ VC (s) ⊕ L′. Furthermore,

α(s = t) = ∀X. (⋀_{x∈VC (t)} X(x)) ⊃ (⋀_{x∈VC (s)} X(x)) ∧∀X. (⋀_{x∈VC (s)} X(x)) ⊃ (⋀_{x∈VC (t)} X(x))

By instantiating the first X with P and the observation that VC (s) is a sublist of VC (P (t_{1}, …, t_{n})) and VC (t) is a sublist of VC (P (t_{1}, …, t_{n})_{|s←t}), it is trivial to see that there is a proof for

Γ, ∀X. (⋀_{x∈VC (t)} X(x)) ⊃ (⋀_{x∈VC (s)} X(x))
∧∀X. (⋀_{x∈VC (s)} X(x)) ⊃ (⋀_{x∈VC (t)} X(x)) , ⋀_{x∈VC (P (t_{1},...,t_{n})_{|s←t})} P (x)
⟹ ⋀_{x∈VC (P (t_{1},...,t_{n}))} P (x), Δ

The case for Γ, α(s = t), α(F) ⟹ α(F_{|s←t}), Δ is analogous, except that we must instantiate the second X. This is were the adequacy of the abstraction of an equation to both ∀X. (⋀_{x∈VC (s)} X(x)) ⊃ (⋀_{x∈VC (t)} X(x)) and ∀X. (⋀_{x∈VC (t)} X(x)) ⊃

(⋀_{x∈VC (s)} X(x)) is formally visible.

Induction Step: We proceed by case analysis over the structure of F:

1. F = ¬F′: It is obvious to see that α(¬(F′)_{|s←t}) = ¬(α(F′_{|s←t})). Then

\begin{matrix}Γ′, α(s = t), α(F′) ⟹ α(F′_{|s←t}), Δ & I.H. \\ Γ′, ¬(α(F′_{|s←t})), α(s = t), α(F′) ⟹ Δ \end{matrix} ; ¬L

Γ′, ¬(α(F′_{|s←t})), α(s = t) ⟹ ¬α(F′), Δ ¬R

2. F = F_{1} ∧ F_{2}: Without loss of generality we assume that s occurs in F_{1}. Again, it is obvious to see that α((F_{1} ∧ F_{2})_{|s←t}) = α(F_{1|s←t}) ∧ α(F_{2}). Then we have to prove Γ′, α(F_{1|s←t}) ∧ α(F_{2}), α(s = t) ⟹ α(F_{1}) ∧ α(F_{2}), Δ.

\begin{aligned}& Γ′, α(F_{1|s←t}), α(s = t) \\ ⟹ & α(F_{1}), Δ \end{aligned} I. H. \begin{aligned}& Γ′, α(F_{1|s←t}), α(F_{2}), α(s = t) \\ ⟹ & α(F_{1}), Δ \end{aligned}

weak L

\begin{aligned}& Γ′, α(F_{1|s←t}) ∧ α(F_{2}), α(s = t) \\ ⟹ & α(F_{1}), Δ \end{aligned} ∧L \begin{aligned}& Γ′, α(F_{1|s←t}), α(F_{2}), α(s = t) \\ ⟹ & α(F_{2}), Δ \end{aligned} ax

Γ′, α(F_{1|s←t}) ∧ α(F_{2}), α(s = t) ⟹ α(F_{1}) ∧ α(F_{2}), Δ ∧R

3. F = ∀x. F′: Again, it trivially holds that α((∀x. F′)_{|s←t}) = ∀x. α(F′_{|s←t}). Note that x does neither occur in s nor in t. Then we have to prove Γ′, ∀x. α(F′_{|s←t}), α(s = t) ⟹ ∀x. α(F′), Δ:

Γ′, α([a/x]F′_{|s←t}), α(s = t) ⟹ α([a/x]F′), Δ I.H. Γ′, [[a/x]]α(F′_{|s←t}), α(s = t) ⟹ [[a/x]]α(F′), Δ Lemma 2.5× 2

Γ′, [α(a)/x]α(F′_{|s←t}), α(s = t) ⟹ [α(a)/x]α(F′), Δ Lemma 2.6× 2

Γ′, ∀x. α(F′_{|s←t}), [α(a)/x]α(F′_{|s←t})α(s = t) ⟹ [α(a)/x]α(F′), Δ weak L

Γ′, ∀x. α(F′_{|s←t}), α(s = t) ⟹ [α(a)/x]α(F′), Δ ∀L

Γ′, ∀x. α(F′_{|s←t}), α(s = t) ⟹ ∀x. α(F′), Δ ∀R

4. The remaining cases are analogous. ⊓ ⊔

The soundness theorem with respect to first-order logic with primitive equality is then

Theorem 3.3 The abstraction α of first-order logic formulas with primitive equality to second-order monadic logic formulas preserves the non-provability.

Proof. Again we have to prove that whenever there is a proof for the original formula in first-order logic with primitive equality, then so there is for the abstracted formula. The proof is essentially the same as before, except that there are 5 additional cases to consider, one as an additional base case and four additional cases in the induction step:

Base Case: Assume there is a derivation Γ ⊢ t = t, Δ, then we have to prove that there is a derivation for α(Γ) ⊢ α(t = t), α(Δ). Let φ(X) := ⋀_{x∈VC (t)} X(x), then α(t = t) := (∀X. φ(X) ⊃ φ(X)) ∧ ∀X. φ(X) ⊃ φ(X), and we must find a derivation in secondorder monadic logic for α(Γ) ⟹ (∀X. φ(X) ⊃ φ(X)) ∧ (∀X. φ(X) ⊃ φ(X)), α(Δ).

\begin{matrix}α(Γ), φ(p) ⊢ φ(p), α(Δ) & ax \\ α(Γ) ⟹ φ(p) ⊃ φ(p), α(Δ) \end{matrix}⊃ R

α(Γ) ⟹ ∀X. φ(X) ⊃ φ(X), α(Δ) ∀R^{p}

\begin{matrix}α(Γ), φ(p) ⟹ φ(p), α(Δ) & ax \\ α(Γ) ⟹ φ(p) ⊃ φ(p), α(Δ) \end{matrix} ; ⊃ R

α(Γ) ⟹ ∀X. φ(X) ⊃ φ(X), α(Δ) ∀R^{p}

α(Γ) ⟹ (∀X. φ(X) ⊃ φ(X)) ∧ (∀X. φ(X) ⊃ φ(X)), α(Δ) ∧R

Induction Step:

1. Assume there is a derivation for Γ, s = t ⟹ F_{|s←t}, Δ and by induction hypothesis we can assume that there is an S0S derivation D for α(Γ), α(s = t) ⟹ α(F_{|s←t}), α(Δ). Then we have to prove that there is a second-order monadic logic derivation for α(Γ), α(s = t) ⟹ α(F), α(Δ).

\begin{matrix}α(Γ), α(s = t), α(F_{|s←t}) \\ ⟹ α(F), α(Δ) \end{matrix} Lemma 3.2 \begin{matrix}α(Γ), α(s = t) \\ ⟹ α(F_{|s←t}), α(Δ) \end{matrix} I.H. \begin{matrix}α(Γ), α(s = t) \\ ⟹ α(F_{|s←t}), α(F), α(Δ) \end{matrix}

α(Γ), α(s = t) ⟹ α(F), α(Δ) Cut(α(F^{|s←t}))

2. The proofs for the other cases are analogous. ⊓ ⊔ Example 3.4 Let F_{0}, and α(F_{0}) as in Example 2.8. A formula in first-order logic that concludes that any subtree in a tree t at path p is unique is

weak R

F_{0} ⊃ ∀p. ∀p′. ∀t. ∀s. ∀s′. subtree(t, p, s) ∧ subtree(t, p′, s′) ⊃ s = s′.

Its abstraction expands the equality predicate as described above.

F_{0} ⊃ ∀p. ∀p′. ∀t. ∀s. ∀s′. subtree(t) ∧ subtree(p) ∧ subtree(s) ∧ subtree(t) ∧ subtree(p′) ∧ subtree(s′) ⊃ (∀X. X(s) ⊃ X(s′)) ∧ (∀X. X(s′) ⊃ X(s)) .

The resulting formula is not provable in S0S and can therefore not be proved in first-order logic with primitive equality by Theorem 3.3. On the other hand with induction, if one would consider cases over p, abstraction yields three cases, each of which is provable in S0S. □

4 About the Subclass of Unprovable Formulas

The question now arises which class of false conjectures can be tackled by the presented technique. Although we have no formal characterization for that class of formulas, we know that it includes first-order logic formulas that have only infinite counter-models. To see this consider the non-valid first-order logic formula in Fig. 6 and assume I is a counter-model that falsifies that formula. Then I(φ) = ⊥ entails that (1) I validates the left-hand side of the implication and (2) falsifies ∃x. ¬P (x). From (1) it follows that the interpretations of P, >, and = must be infinite. A possible infinite interpretation for P is λx.⊤. The abstraction

FOL formula: φ := (∃x. P (x) ∧ ∀x. ∃y. P (x) ⊃ (y > x ∧ P (y)) ∧
∀x, y, z. (x > y ∧ y > z) ⊃ x > z ∧ ∀x. x ≠ x) ⊃ ∃x. ¬P (x)
S0S formula: α(φ) := (∃x. P (x) ∧ ∀x. ∃y. P (x) ⊃ (> (y)∧ > (x) ∧ P (y)) ∧
∀x, y, z. (> (x)∧ > (y)∧ > (z)) ⊃> (x)∧ > (z) ∧

∀x. ¬(∀X. X(x) ⊃ X(x) ∧ ∀X. X(x) ⊃ X(x))) ⊃ ∃x. ¬P (x)

Figure 6: Disproven first-order logic formula with infinite counter-model. α(φ) is also invalid with respect to S0S, also by interpreting P as λx.⊤. Thus, with our technique we can disprove first-order logic formulas that have no finite counter-models.

5 Implementation

The procedure for disproving false conjectures has been implemented in the MAYA system [3]. MAYA is an in-the-large verification tool for structured specifications. It is based on the notion of development graphs and incorporates an efficient management of change to preserve and adjust proof information when changing the specification. Each node of the development graph corresponds to an axiomatically defined theory and the procedure presented in this paper can be used to disprove false conjectures with respect to some theory. The implementation abstracts the first-order logic subset Φ of the axioms defining a theory to second-order monadic logic. To disprove a false conjecture ψ, the validity of the S0S formula α(Φ ⊃ ψ) is checked.

In order to decide the validity of an S0S formula, rather than implementing our own S0S decision procedure, we have linked MAYA with the MONA system [7]. Although MONA implements only a decision procedure for weak second-order monadic logic, it is still useful since it is conservative over full second-order monadic logic without successor functions. Counter-models found in MONA are also counter-models in the more general setting. To our knowledge there is no available implementation of a full S0S decision procedure.

6 Conclusion

We have outlined a technique to disprove false conjectures in first-order logic with and without equality over a given and fixed term algebra. The central idea is that of abstraction. Formulas are transformed into second-order monadic logic without successor functions, which is known to be decidable. We have shown that the abstraction is sound, which means it preserves provability. Thus the absence of a proof in second-order monadic logic entails that the initial conjecture is unprovable, as well.

As related work we consider the tableau method [11] as well as combinations of model generation with automated theorem provers, such as the Scott system [6]. The tableau method not only detects unsatisfiability of the negated conjecture but also generates models for it. This is similar to the use of model generating systems during refutation proofs, as done in the Scott system. Thus, certain classes of false conjectures can be detected by generating counter-models. However, the relationship between these classes and the class characterized by the procedure presented in this paper is unclear yet and is left for future work.

Further future work is planned in different directions: First, we plan to investigate how to obtain from a counter-example for a non-valid S0S formula a counter-example for the original first-order logic formula, which would be highly beneficial especially in MAYA’s application context which is formal software development. Also we assume it to be helpful to develop a characterization for the subclass of unprovable first-order logic formulas. Secondly, we plan to experiment with abstractions that preserve more of the term structures when mapping first-order logic formulas to second-order monadic logic formulas. Thereby we would leave the S0S fragment and employ larger fragments of second-order monadic logic, e.g. SkS. Preserving the structure should result in an increased efficiency for equational first-order logic theories. A third line of research will consist of using second-order logic proofs as proof plans to guide the actual proof search for the initial first-order logic formulas.

References

[1] P. B. Andrews, M. Bishop, and C. E. Brown. System Description: TPS: A Theorem Proving System for Type Theory. In D. McAllester, editor, Proceedings of CADE-17,

LNCS 1831, pages 164–169. Springer, 2000.

[2] S. Autexier, D. Hutter, B. Langenstein, H. Mantel, G. Rock, A. Schairer, W. Stephan, R. Vogt, and A. Wolpers. Vse: Formal methods meet industrial needs. International Journal on Software Tools for Technology Transfer, Special issue on Mechanized Theorem Proving for Technology, Springer, September 1998.

[3] S. Autexier, D. Hutter, T. Mossakowski, and A. Schairer. The development graph manager MAYA. In H. Kirchner and C. Ringeissen, editors, Proceedings 9th Int. Conference on Algebraic Methodology And Software Technology (AMAST’02), LNCS 2422. Springer, September 2002.

[4] F. Giunchiglia and T. Walsh. A theory of abstraction. Artificial Intelligence, 57(2-3):323–389, 1992.

[5] R. Harper, F. Honsell, and G. Plotkin. A framework for defining logics. Journal of the Association for Computing Machinery, 40(1):143–184, January 1993.

[6] K. Hodgson and J. Slaney. Development of a semantically guided theorem prover. In R. Goré, A. Leitsch, and T. Nipkow, editors, Automated Reasoning, LNAI 2083, pages 443–447. Springer, June 2001.

[7] N. Klarlund. Mona & fido: The logic-automaton connection in practice. In Computer Science Logic, CSL ’97, LNCS 1414, 1998.

[8] G. Nadathur and D. Miller. An overview of λProlog. In K. A. Bowen and R. A. Kowalski, editors, Fifth International Logic Programming Conference, pages 810–827, Seattle, Washington, August 1988. MIT Press.

[9] M. O. Rabin. Decidability of second-order theories and automata on infinite trees. Transactions of the American Mathematical Society, 141:1–35, 1969.

[10] C. Schürmann and S. Autexier. Towards proof planning for M_{ω}^{+}. Electronic Notes in Theoretical Computer Science, 70(2), 2002.

[11] R. Smullyan. First-Order Logic. Springer, 1968.

[12] J. Siekmann et.al. Proof development with Ωmega. In A. Voronkov, editor, Proceedings of CADE-19, LNAI 2392, pages 144–149, Copenhagen, Denmark, 2002. Springer.

[13] M. Y. Vardi. The complexity of relational query languages (extended abstract). In Proceedings of the 14^{th} Annual ACM Symposium on Theory of Computing, pages 137– 146, 1982.