<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Equality Preprocessing in Connection Calculi</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Benjamin E. Oliver</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jens Otten</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Oslo</institution>
          ,
          <addr-line>Oslo</addr-line>
          ,
          <country country="NO">Norway</country>
        </aff>
      </contrib-group>
      <fpage>76</fpage>
      <lpage>92</lpage>
      <abstract>
        <p>Equality is a fundamental concept in first-order reasoning, yet for connection based proof methods a notoriously challenging one to handle eficiently. While paramodulation is a popular technique for dealing with equality in resolution and related calculi, there is no single practical successful solution for connection based approaches. We present an extensible system for equality preprocessing in connection calculi (EPICC) that can be used as a tool in reducing the search space of problems that contain equality. We specify a number of preprocessing rules, describe an implementation of these rules and compare it with existing approaches for dealing with equality in connection calculi.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Automated Reasoning</kwd>
        <kwd>First-order Logic</kwd>
        <kwd>Equality</kwd>
        <kwd>Connection Calculus</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        ( () ∧  = ) ⇒  ()
In order to solve this problem, ATP systems have to incorporate techniques for equality. While
paramodulation [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] is a successful technique for dealing with equality in the popular resolution
method [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], the situation is more complicated for tableau or connection calculi [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. For example,
rigid E-unification [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] is not decidable and its use practically infeasible due to its complexity [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
A more restricted technique called bounded rigid E-unification has been implemented in the
tableau prover ePrincess [
        <xref ref-type="bibr" rid="ref8 ref9">8, 9</xref>
        ], but cannot easily be extended to connection calculi.
      </p>
      <p>
        So far, the most successful technique for dealing with equality in connection calculi, as
also implemented in the leanCoP prover [
        <xref ref-type="bibr" rid="ref10 ref11">10, 11</xref>
        ], adds the equality axioms and then uses
restricted backtracking [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] to limit the amount of redundancy caused by the equality axioms.
But as observed in the yearly system competitions CASC, the relative performance of leanCoP
compared to other provers on problems with equality is significantly lower than its relative
performance on problems without equality [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ].
      </p>
      <p>
        In this paper we present a framework for preprocessing techniques in order to simplify
problems containing equality. Even though the presented approach can be used in combination
with any ATP procedure, we have implemented, tested and evaluated it in combination with
the connection prover leanCoP. It is also tested against an implementation of the modification
method [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ], another well-known preprocessing technique to deal with equality in connection
calculi.
      </p>
      <p>In Section 2, we first present the details of the underlying matrix method. Section 3 introduces
the preprocessing steps and rules. Section 4 gives details on how these preprocessing rules have
been implemented and combined with leanCoP. In Section 5 this implementation is compared
to the equality technique currently used in leanCoP and an implementation of the modification
method. The paper concludes with a summary and brief outlook on further research in Section 6.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>In this section some basic concepts and notations are introduced, such as the matrix
characterization and the standard equality axioms.</p>
      <sec id="sec-2-1">
        <title>2.1. First-Order Logic and Matrix Characterization</title>
        <p>The standard notation for first-order formulae is used. Terms (denoted by , , , ) are built
up from functions (denoted by  ), constants (, , ) and variables (denoted by , , ). An
atomic formula (denoted by ) is comprised of predicate symbols (denoted by  ) and terms. A
(first-order) formula (denoted by  ) is built up from atomic formulae, the connectives ¬, ∧, ∨,
⇒, and the first-order quantifiers ∀ and ∃. A literal  has the form  or ¬. Its complement 
is  if  is of the form ¬; otherwise  is ¬.</p>
        <p>A formula in (disjunctive) clausal form has the form ∃1 . . . ∃ (1 ∨ . . . ∨ ), where each
clause  is a conjunction of literals 1, . . . ,  .1 It is usually represented as a set of clauses
{1, . . . , }, which is called a (clausal) matrix M. Every formula  can be translated into a
validity-preserving formula  ′ in clausal form.</p>
        <p>Definition 2.1 (Matrix). A set of clauses is represented as a matrix. A matrix M of a formula
consists of its clauses {1, . . . , }, in which each clause  is a set of its literals {1, . . . , }.
In the graphical representation of a matrix, its clauses are arranged horizontally, while the literals
of each clause are arranged vertically (see Figure 1).</p>
        <p>A connection { (...), ¬ (...)} is a set of two literals with the same predicate symbol, of which
(exactly) one is negated. A first-order or term substitution  is a mapping from the set of term
variables to the set of terms. In  () and  () all term variables  in  and  are substituted
1Even though the use of a conjunctive clausal form (cnf) is common, a disjunctive clausal form (dnf) is used for
historical and practical reasons; the diference between both forms is marginal (a formula  in dnf is valid if ¬
in cnf is unsatisfiable ).</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Equality</title>
        <p>
          clause  ∈ M, i.e. a set ⋃︀
method [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]; see also [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ].
by their image  (). A connection {1, 2} with  (1) =  (2) is called  -complementary. A
path through a matrix M = {1, . . ., } is a set of literals that contains one literal from each
=1{′} with ′ ∈ . The following matrix characterization [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ]
provides a simple criterion for the validity of a formula and is the basis of the connection
Theorem 2.1 (Matrix Characterization). A formula  and its matrix M are valid if there
exists (1) a multiplicity  : M
        </p>
        <p>→ IN (specifying the number of clause copies), (2) a term
substitution  and (3) a set of connections , such that every path through the matrix M of  contains
a  -complementary connection {1, 2} ∈ . In M , clause copies have been added according
In order to extend the language to first-order logic
with equality, the (predefined) equality
predicate ≈ is added. Instead of ≈</p>
        <p>(, ) we use the common infix notation  ≈ . We also use
 ̸≈  as an abbreviation for ¬( ≈ ). One way to specify the interpretation (or meaning) of
equality is by adding equality axioms. Once these axioms have been added the equality symbols
≈ and ̸≈ can be treated as uninterpreted predicates.</p>
        <p>Definition 2.2 (Equality Axioms).</p>
        <p>The notation  (M) denotes the set of axiom clauses that
must be generated for the matrix M of a formula and M ∪  (M) indicates the resulting matrix
formed by combining the original matrix and the axioms. If M does not contain equality then
 (M) is an empty set, however if M contains equality, then  (M) is the least set such that:
⎡
⎣︀[  ̸≈ 
︀]
︂[  ≈</p>
        <p>︂]
 ̸≈</p>
        <p≯≈ 
⎡ ≈ ⎤⎤
⎣ ≈ ⎦⎦ ⊆  (M)
⎡
⎢
⎢
⎢
⎣
 (1 · · · ) ̸≈  (1 · · · )
1 ≈ 1
.
.</p>
        <p>.
 ≈ 
⎡
⎢
⎢
⎢
⎢
1 ≈ 1
.
.</p>
        <p>.</p>
        <p>≈ 
⎢⎣  (1 · · · ) ⎥⎦
¬ (1 · · · )
⎤
⎥
⎦
⎤
⎥
⎥
⎥⎥ ∈  (M)
⎥⎥ ∈  (M)
(for every function  of arity  in M)
(for every predicate  of arity  in M)</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Equality Preprocessing</title>
      <p>Unlike the modification method and its derivatives, the following approach is not designed to
eliminate equality entirely. Instead, it is best viewed as a set of rules that aim to balance three
properties - ease of implementation, good algorithmic complexity and, finally, improvement of
the performance of the proof procedure. A combination that is dificult to achieve at the same</p>
      <sec id="sec-3-1">
        <title>3.1. Basic Notation</title>
        <sec id="sec-3-1-1">
          <title>3.1.1. Matrix Notation</title>
          <p>As both matrices and clauses are really nothing but sets, we will employ a special notation that
allows us to focus on certain properties. The notation M = [C ] is a visual representation of
M = {C} ∪ , in which C is a clause and  is a set of clauses. Note that it is perfectly fine for 
to be empty. In the same way we can visualize C = { ≈ } ∪  by using vector column notation.
By combining these we can pattern match against certain literals and sub-clauses/matrices that
are of interest. For example</p>
          <p>M =
set  and the remaining (possibly empty) set of clauses .
lets us match a clause (C) consisting of the literal  ≈ , the remaining (possibly empty) literal</p>
        </sec>
        <sec id="sec-3-1-2">
          <title>3.1.2. Most General Unifiers</title>
          <p>Given a set of equations  = {1 ≈ 1, . . . ,  ≈ }, a unifier of E is a (variable) substitution 
such that  (1) =  (1), . . . ,  () =  (). Given the set of unifiers  () of , a substitution
 is a most general unifier (mgu) of  if for all  ′ ∈  (),  ′ is an instance of  .
3.1.3. Rules
of M1, ⊨</p>
          <p>M means that M is valid.</p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Valid Clauses</title>
        <p>The following preprocessing rules should be read top down. If the conditions presented above the
bar hold then one can infer the result below. M1 ⊨
M2 means that M2 is a logical consequence
Any matrix that contains a clause C consisting only of positive equalities is valid if there exists
a most general unifier (mgu) for</p>
        <p>C. Note that by this rule, an empty clause is valid.
︀[ C
]︀
∃
 :  = (C)</p>
        <p>∀ ∈ C :  = ( ≈ )
⊨ [C] ∪  ([C])
As all variables local to C are existentially quantified an mgu for such a clause represents an
assignment for every variable in C such that every equality literal is true. If the mgu is empty
then every element of C must have been of the form 1 ≈ 1, . . . ,  ≈ . One can construct
a new matrix M′ consisting of the clause C extended with the axioms of equality such that the
resulting matrix is valid. As M′ is a subset of M then M ∪  (M) is valid. This rule not only
provides a termination case for the reduction algorithm, but allows certain (artificial) theorems
to be proven in a very eficient manner.</p>
        <p>In order to ensure that the reader is under no illusion, we will take some time to clarify this
ifrst rule. There are three conditions that must be met, read from left to right they are: The
presence of a clause C. The existence of a substitution  such that  is the mgu for clause C
(this does not preclude the empty substitution  = ∅). Finally, if the clause C is not empty, then
it must only contain positive equality literals. If these conditions are met, then we can construct
a new matrix consisting of the single clause C. If we union this matrix with the set of all axioms
that C generates then the result can be shown to be valid using first-order logic alone.</p>
        <p>As an example, consider the following: {{ ≈ ,  () ≈  ()}, . . . }. While there may be
multiple ways to prove the validity of such a formula - we can see that all we need to show is
that there exists a value  that is equal to . Due to the reflexivity of equality such a search
is rather straightforward. Even though the occurrence of such a formula may be uncommon,
detecting such a clause can be crucial for a successful proof search. The exclusion of this rule
can lead to a proof procedure timing out before reaching the clause in question.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Contradictions</title>
        <p>When considering a formula that is equality free then any clause C that contains  () and
¬ () is contradictory and can be removed. This idea can be extended to clauses containing
 () and ¬ () if the remaining clause  implies that  and  are equal. If we can derive  ≈ 
in  then both ( () ∧ ¬ () ∧ ) and ( ̸≈  ∧ ) must result in contradictory clauses.
⎡⎡  (1, . . . ) ⎤
⎣⎣¬ (1, . . . )⎦</p>
        <p>⎤
⎦  ⊨ 1 ≈ 1 ∧ · · · ∧</p>
        <p>≈ 
⊨  ∪  () if
it can not be the case that both  ≈  and  ̸≈  can be true simultaneously.</p>
        <p>In the same way as for predicates, if we derive that  ≈  in the remainder of the clause, then</p>
      </sec>
      <sec id="sec-3-4">
        <title>3.4. Redundancy</title>
        <p>from  () ≈  (). The same principle can be used to find redundant predicates.
Consider a clause that contains two equalities  ≈  and  () ≈
 (). If  ≈  is true then
 () ≈  () follows, meaning that  () ≈</p>
        <p>() is redundant. However,  ≈  does not follow
︂[  ̸≈</p>
        <p>︂]

⊨ [︀  ]︀ ∪  ([︀  ]︀ ) if
The rule of redundancy is an interesting one. While it may seen advantageous to minimise the
number of literals in a clause, we must remember that our aim is to reduce the search space of
the problem. It may well be the case that an equation or predicate that is redundant in terms of
derivability, is key to the proof of a formula. If this is the case then the responsibility is on the
theorem prover to - in some sense - re-find this literal.</p>
      </sec>
      <sec id="sec-3-5">
        <title>3.5. Pure Clauses</title>
        <p>the matrix. This general rule is also applicable to formulae that contain equality.
Assume that  () ∈ C . If there does not exist a  such that ¬ () ∈ C then C is isolated;
the same holds for ¬ () ∈ C if there is no  (). An isolated clause may be removed from</p>
      </sec>
      <sec id="sec-3-6">
        <title>3.6. Unsatisfiable Clauses</title>
        <p>If a matrix without equality axioms does not contain negated equality then the only instance
(of negated equality) can come from the addition of the equality axioms. A negated equality has
to be part of the connection to make an appropriate path complementary. As every equality
axiom apart from reflexivity contains at least one positive equality again, the only possible
connection to make this path complementary has to be to the literal in the reflexivity axiom.
This is equivalent to finding the mgu for the positive equation. If no mgu exists then the clause
is contradictory and can be removed.
⊨ [︀  () ]︀ ∪  ([︀  () ]︀ ) if
̸ ∃ :  = ( ≈ )</p>
        <p>∀(, ) : ( ̸≈  ̸∈ M)
Thus, if there exists a matrix M that contains positive equality but does not contain negated
equality, then it can be reduced to a matrix M′ that is equality free such that the transformation
is sound and complete, i.e. validity preserving.</p>
      </sec>
      <sec id="sec-3-7">
        <title>3.7. Unit Clause</title>
        <p>The final rule that we will consider concerns negated unit clauses. Consider a formula of the
form where  and  are variable-free:
When converted to disjunctive normal form this will result in a matrix that contains a negated
unit clause:
If the negated equality clause is used in a proof then every path must pass through it.</p>
        <p>( ≈ ) ⇒  () ∨ ¬ ()
︀[ [︀  ̸≈ ︀] [︀  ()]︀ [︀</p>
        <p>¬ ()]︀ ]︀
case the matrix becomes  . If this is not the case then the following holds</p>
        <p>If  ̸≈  is contradictory then the original formula was of the form ( ≈ ) ⇒  , in which
⊨ M ∪  (M) if ⊨ { ↦→ } ∪  ({ ↦→ })</p>
        <p>) is the set of all variables in  ̸≈  and { ↦→ } is the set (of remaining
clauses)  in which all terms  have been replaced by the term . This rule is sound as every
path through M contains the negated equation  ̸≈ , and applications of the equality axioms
can be used to replace any occurrence of  by  or vice versa. While soundness is preserved,
completeness of the calculus is lost. While this may sound problematic, we will see that in “real
world" situations such a limitation has little to no negative impact.</p>
        <p>One special case is that when  ̸≈  we know that ⊨  ∪  (M) if ⊨  ∪  () by the rule
of contradictions 3.3. Out of all of the rules discussed, this one is the most powerful. As we will
see in the evaluation section, the ability to make good choices in terms of choosing a direction
(or not applying the rule) is an important factor.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Implementation</title>
      <p>The preprocessing rules of the previous section have been implemented in the EPICC (Equality
Preprocessing in Connection Calculi) system.2 3 The aim of this work is to improve the
performance of equality handling for connection calculi – with a particular focus on the leanCoP
theorem prover. As the rules discussed in Section 3 will be run on large matrices they needed
to be performant. Such an approach has certainly influenced both the design of the
EPICC
run-time system, and the considerations made when searching for rules to implement. The
rules that we have seen in Section 3 were influenced not only by the nature of the connection
calculus, but also the internal representation of the matrix and the fact that we plan on using it
as a preprocessing step.</p>
      <p>The current version of EPICC is written in the functional Lisp-like language Clojure that
runs on the JVM (Java Virtual Machine). The data driven approach of the language makes it
ideal for prototyping and exploration. The current rule based approach has been developed
with portability in mind (an implementation in Haskell is being actively developed).</p>
      <p>The current approach taken by the leanCoP theorem prover is as follows: If a matrix M
contains an equality symbol then the matrix is extended with the axioms of equality before the
actual proof search starts, proving the matrix M ∪  (M). EPICC replaces this procedure by
ifrst applying the rules discussed in Section 3, before generating the set of axioms  (M). For
the current implementation, formulae in a disjunctive normal form matrix format are accepted.
2Available for download under the GPL license at http://leancop.de/epicc/.</p>
      <p>3The Clojure implementation of the preprocessing steps that does not include the leanCoP core prover can be
obtained at https://github.com/beoliver/clj-epicc.
(defrecord Valid_Clause []</p>
      <p>LocalRule
(candidate-clauses [rule m]</p>
      <p>(filter #(only-pos-eq? (lookup m %)) (pos-eq-clauses m)))
(apply-local-rule [rule m c]
(cond (apply mgu? (formulae c)) (valid "...")
(empty? (neg-eq-clauses m)) (redundant "...")
:else no-op)))</p>
      <p>Reductions are expressed in terms of rules. The concepts of programming against interfaces
and using well-defined return values are common features of many popular languages (both
functional and imperative). A local rule is something that implements two functions.
(defprotocol LocalRule
(candidate-clauses [rule matrix])
(apply-local [rule matrix clause]))
The same idea can be expressed in Haskell using data types.
data Rule = Rule { candidate_clauses :: Matrix -&gt; [Int]</p>
      <p>, apply_local :: Matrix -&gt; Clause -&gt; Result }
The function candidate-clauses is responsible for returning a sequence of all of the indexes
that the rule may be applicable to. It is assumed that the search for candidates is cheap. By
separating a rule in this way we gain the ability to arbitrarily terminate the reduction process
(either due to time constraints or having found a solution) while retaining the most current
version of the matrix. Moreover, rules can be added, deleted, and re-ordered in a straightforward
manner aiding the development of new approaches.</p>
      <p>As a concrete example, let us consider the rule for valid clauses and how it could be
implemented in the Clojure language as shown in Figure 2.</p>
      <p>The local rules are most commonly responsible for deciding if a given clause is valid, redundant,
or contradictory. Deletion and termination is handled by the reduction function. Variants exist
that allow a rule to return a new clause, for example removing some  ≈ . In this case the
reduction function will update the matrix to reflect the changes.</p>
      <sec id="sec-4-1">
        <title>4.1. The Supervisor Process</title>
        <p>A supervisor is used that manages both state changes and termination conditions in order to
run the rules. This supervisor is implemented using a function that continually loops (Clojure’s
“loop" keyword can be thought of as a recursive while loop that allows arguments to be passed)
waiting for a termination condition. This means that a local rule is responsible for deciding if a
given clause is valid, redundant or contradictory. Any deletion, termination or global re-writing
is handled by the supervisor not the rule.</p>
        <p>The supervisor tracks the state of the matrix as well as keeping a history of all rules that were
applicable (i.e. they did not return NoOp). One result of this is that if a certain application of
rules yields a valid result, then the system can extract the submatrix from the original input, add
the axioms of equality and pass it on to a theorem prover. The rules are run until a terminating
condition is met. Such a condition may either be a timeout, reaching a certain number of
iterations, finding a solution or the previous iteration producing no change. The axioms of
equality are added to the resulting matrix when no more reductions can be performed. It is
possible to disable the equality axiom generation if desired.</p>
        <p>Because it is possible for a rule to return “valid" or “invalid", the supervisor can be seen as
a partial proof procedure. While this functionality is currently not used explicitly by EPICC
it was noted that during testing, the procedure was able to prove the validity of a handful of
problems from the TPTP library directly. In terms of current implementation, the resulting
matrix is always passed to the leanCoP theorem prover. In the case of the rules alone deriving
“valid", the resulting matrix can be proven by leanCoP .</p>
        <p>While this does not afect the correctness of the testing results, it does mean that the EPICC
framework requires users to know about which rules they are planning on using. One would
imagine that in a future version of EPICC this information would be handled by the supervisor.
Not only would this allow for a minor optimization in not having to invoke a theorem prover in
all cases, but it would make the system more user friendly.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Internal Representations and Data Structures</title>
        <p>Internally, clauses are indexed sets of literals. A matrix is represented as a mapping from clause
indexes to the clauses as well as additional information such as the indexes of clauses that
contain positive/negated equality and a mapping from terms to the clauses that they occur in
(an important factor when it comes to performance). These tables are updated every time a
clause is added/removed from the matrix, meaning that when implementing a rule that, e.g.,
only considers clauses containing positive equality, one does not need to test every clause. The
same principle is true when performing global rewriting – one only needs to update the clauses
that a term occurs in.</p>
        <p>When the matrix is imported, addition information is gathered, such as indexes of clauses that
contain positive/negated equality. An internal table is also built up mapping terms to the clauses
that they occur in. The reason for this table is to improve performance when performing term
substitutions – by knowing which clauses contain a term , the cost of applying the substitution
{ → } is reduced to the number of clauses that currently contain the term  (as opposed
to naïvely applying the substitution to every clause). These tables are updated every time a
clause is added/removed from the matrix, meaning that when implementing a rule that, say,
only considers clauses containing positive equality, one does not need to repeatedly check every
clause in the input matrix.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Evaluation</title>
      <p>The equality preprocessing techniques described in Section 3 and implemented in Section 4
were evaluated on all relevant 8044 first-order (so-called FOF) formulae or problems contained
in the TPTP library v6.4.0.</p>
      <p>If a problem did not contain equality, or it caused a parser error then it was ignored. This
resulted in a set of 4672 problems that would be used for testing. For every problem we have
verified that the results, i.e. theorem or non-theorem, are consistent with the TPTP status of the
problem. Of the 4672 problems that the tests were run on, we are particularly interested in the
4189 that have the TPTP status of Theorem.</p>
      <sec id="sec-5-1">
        <title>5.1. Method</title>
        <p>Six transformation strategies were compared against each other. The Clojure implementation of
the EPICC system was used to perform all strategies. The first of these strategies simply adds
the axioms of equality. This is the current approach taken by leanCoP and as such the results
would provide a baseline for the remaining five approaches. The second approach performed the
modification method (STE). As this is a well known approach for handling equality that can be
performed during preprocessing it is interesting to see how it compares to the EPICC techniques
described in this paper. The third approach would not perform any translation, nor would it
add the axioms of equality. The remaining three configurations were variations of the EPICC
techniques. Such a selection provides us with the ability to both compare the transformations
discussed with the current leanCoP technique and to compare the transformations with two
more approaches.</p>
        <p>
          Each of the six methods were evaluated on all relevant problems contained in the TPTP
library v6.4.0 [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. TPTP is a library of test problems which supports the testing and evaluation
of ATP systems. The library is divided into problem “domains". Some examples of the domains
are software verification (SWV and SWW), where it is formally established that a computer
program does the task it is designed for, software creation (SWC), which is used to form a
computer program that meets given specifications, general algebra (ALG), category theory
(CAT), geometry (GEO), graph theory (GRA), knowledge representation (KRS), management
(MGT), number theory (NUM), puzzles (PUZ), ring theory (RNG), set theory (SET and SEU),
and syntactic (SYN).
        </p>
        <p>As opposed to reading problems directly from the TPTP library, leanCoP was used to first
convert each of the problems into disjunctive normal form. If a formula did not contain equality
then it would not be used in the benchmarking tests. The resulting matrices were saved to disk
and individually read by EPICC.</p>
        <p>
          Every problem in the TPTP library has a status. We will concern ourselves with “Theorem"
and “Non-Theorem". For every problem it was recorded whether the result produced by a
method is coherent with the TPTP status of the problem. This allows us to see which methods
result in errors due to the method not preserving the completeness of the input formula. Such
an approach also allows us to verify that no method implementation results in an unsound
theorem prover.
The six approaches to be used were:
• Axioms AX. These results are used to provide a set of baseline results that other methods
can be compared against. The input file is to be read by EPICC and the axioms of equality
added before passing the resulting matrix to leanCoP. This corresponds to the technique
the full leanCoP prover uses.
• Modification method MM. The input is read and Brand’s modification method performed
on the matrix before passing it to leanCoP. As we have seen, the modification method is
an existing preprocessing technique that can be used to eliminate equality. An
implementation was written that would accept matrices in disjunctive normal form. It should be
noted that this implementation is naïve in the sense that no attempt was made to optimize
it. The algorithm is based on the one outlined in Brand’s paper [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ].
• No axioms NO-AX. The file is read by EPICC and the matrix passed to leanCoP without
adding any axioms of equality. The reason for including this approach is to provide an
insight into the practical need for explicit equality handling. If a formula can be shown
to be a theorem without adding the axioms of equality (i.e. without interpretation of
equality) then the clauses containing equality were redundant. This approach cannot
guarantee to preserve the completeness for formulae containing equality.
• EPICC-1. A configuration of EPICC that preserves the completeness for formulae
containing equality. This is achieved by not applying the Unit Clause rule. The following
(complete) rules are used: Valid Clauses, Contradictions, Pure Clauses, and Unsatisfiable
Clauses. The axioms of equality are added after no more transformations can be applied.
• EPICC-2. A configuration of EPICC that uses a left-to-right rewrite rule for Unit Clause.
        </p>
        <p>The following rules were used: Valid Clauses, Contradictions, Pure Clauses, Unsatisfiable
Clauses, and the Unit Clause rule, which performs rewriting in a left-to-right manner
meaning that ( ̸≈ ) would result in a global substitution  = { ↦→ }. The axioms of
equality are added after no more transformations can be applied.
• EPICC-3. A configuration of EPICC that uses a custom rewrite rule for Unit Clause. The
axioms of equality are added after no more transformations can be applied. The diference
between this approach and that of EPICC-2 is how the Unit Clause rule decides if a clause
would result in the substitution  = { ↦→ }, the substitution  = { ↦→ }, or if the
unit clause should be left alone. For example, one of the conditions is that a substitution
 = { ↦→ } is only allowed if  does not occur in .</p>
        <p>
          For every input problem, six diferent outputs were produced – each corresponding to one
of the strategies listed above. The core (Prolog) prover of leanCoP 2.1 using its complete core
strategy (i.e. "[cut,comp(7)]", see [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]) was then to be invoked for each output and allowed
to run for at most ten seconds before being cancelled. The used core strategy uses restricted
backtracking [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ], which is switched of when a proof search depth of seven is reached. If a
timeout occurs, then “timeout" was recorded. The core prover does not add any axioms of
equality. SWI-Prolog version 8.0.2 was used for running leanCoP.
        </p>
        <p>The choice to avoid using the strategy scheduling features of leanCoP was made for two
reasons. As the strategy [cut,comp(7)] is complete we know that if running leanCoP on the
output of one of the six configurations being tested results in “Non-Theorem" and the TPTP
library has it marked with the status “Theorem", then that configuration did not preserve the
completeness of the input formula. If we were to use strategy scheduling then leanCoP would
ignore the result “Non-Theorem" if the internal strategy that proved the result was not complete.
While we would eventually achieve the same result due to the last strategy that leanCoP employs
(i.e. "[def]") being complete, we might run out of time before this occurred. Secondly, we
are interested in the efect that the transformations themselves have on the performance. It
is assumed that if a particular leanCoP strategy is efective then that improvement would be
seen across all transformations. Such a decision is certainly open to debate. It may well be the
case that a particular strategy of leanCoP amplifies the efect of a particular transformation.
However, as we wish to generalise the implementation of the theorem prover, such an event is
beyond the scope of this work.</p>
        <p>All evaluations were conducted on a six-core 2.2 GHz Intel Core i7 Macbook Pro with 16 GB
of RAM running MacOS 10.14.4. Each input file was parsed by the Clojure implementation of
the EPICC system and any transformations performed before invoking leanCoP on the output.
EPICC was run using Clojure 1.10.0 and Java 1.8.0_181. The CPU time limit for each proof
attempt by the leanCoP (core) prover was set to 10 seconds. When calculating the amount of
time that a proof attempt takes, the results do not take into account the amount of time that
was spent performing the preprocessing by EPICC.</p>
      </sec>
      <sec id="sec-5-2">
        <title>5.2. Experimental Results</title>
        <p>Of the 8044 FOF problems contained in the TPTP library 4672 problems contain equality. Of the
4672 problems containing equality that the tests were run on, we are particularly interested in
the 4189 problems that have the TPTP status of “Theorem". We will consider all results with
respect to these 4189 problems. The reason for only considering the results of formulae that
have the TPTP status of “Theorem" is because three of the methods tested (NO-AX, EPICC-2
and EPICC-3) are known to not preserve the completeness of the input formula in the general
case. In the case of the transformation NO-AX it is simply because it does not include the
axioms of equality. For the other two it is due to their use of the Unit Clause rule. Thus, if we
get the result “Non-Theorem" when using these methods, we do not know if it was derived
because the original formula in the TPTP library is a non-theorem, or if it was due to the not
completeness preserving transformation method.</p>
        <p>Table 1 provides an overview of the results. Table 2 presents the results aggregated by problem
rating, while Table 3 presents the results broken down by domain. The rating of a problem
describes how dificult it is to solve it. E.g., a rating of 0.0 means that the problem is solved by
all state-of-the-art provers, a rating of 0.7 means that it is solved by 30% of them.</p>
        <p>The three methods that use techniques described in this paper (EPICC-1, EPICC-2 and
EPICC-3) outperform all other methods including the standard leanCoP approach (AX) in the
number of theorems proven under ten seconds. Of all the methods tested, the modification
method (MM) has the worst performance. While no optimizations were made to this method,
the fact that the standard approach of AX (that also includes no optimization) resulted in 795
more proofs certainly suggests leanCoP handles the increase of search space introduced by the
axioms of AX better than the increase of search space due to the large number of new clauses
introduced by MM.</p>
        <p>Of the three EPICC approaches, the performance of the complete method EPICC-1 is only
marginally better than AX. This suggests that (for the problems considered) the re-writing rule
Unit Clause has a major impact. It would seem that either the (complete) methods described in
Section 3 do little to reduce search space, or that the conditions required for their application are
unfortunately not met frequently. EPICC-2 performs better than EPICC-1. EPICC-2 uses a
left-to-right rewrite strategy for the Unit Clause rule. The method that leads to the most proofs
being found is EPICC-3. EPICC-3 uses a slightly less aggressive rewrite strategy for the Unit
Clause compared to EPICC-2.</p>
        <p>Figure 3 presents a visualization of the 200 proofs found that could not be found using the
standard AX approach. This graphic can be thought of as an alternative to a Venn diagram.
Multiple dots underneath a bar indicate that those solutions were found by multiple methods.
The intersection row shows the cardinality of the intersections. The solutions column indicates
the number of proofs that a particular method found that the standard AX approach could not.
For example - of the 166 solutions that EPICC-3 found, 97 were found by exactly one other
method, namely EPICC-2.</p>
        <p>We can see that not only does EPICC-3 find the most solutions, but that many of the
alternative methods appear to be subsumed by it. Indeed EPICC-3 found 54 solutions that no
other method could. EPICC-2 only managed to find a single (unique) solution that EPICC-3
(or any other method) could not. EPICC-1 found no unique solutions.</p>
        <p>The modification method MM returned 6 unique solutions which is quite interesting
considering that it only found 11 solutions in total that the axiomatic approach could not. Indeed
its general performance was poor, managing to find only 174 proofs (roughly 16% of the total
achieved by EPICC-3) and never managing to find a solution for a problem with a rating higher
than 0.29. However, it found new proofs that no other method could produce.
EPICC-3
EPICC-2</p>
        <p>NO-AX</p>
        <p>MM</p>
        <p>EPICC-1
intersection</p>
        <p>The results of the NO-AX approach are worthy of note. This method managed to prove a
total of 31 theorems that the standard approach could not, with 26 of those being unique to this
method alone. Such a high percentage (84%) of unique solutions is not that surprising if we
consider the fact that by not adding axioms the search space is drastically reduced. The fact that
NO-AX returned 508 false negatives (Table 4) supports this assumption. Indeed it is worthy of
note that the NO-AX approach proved two more theorems within the 0.7 rating range than
any other method, namely problems SEU205+1 (rating 0.77) and SEU241+2 (rating 0.73).</p>
        <p>We see that for the most part the proofs of EPICC-3 are a superset of the proofs of EPICC-2
and EPICC-1. Thus a combination of EPICC-3, NO-AX and MM would find 199 of the 200
solutions. While the EPICC-3 approach either performed equally as well as or (at least slightly)
outperformed the other methods across all domains (Table 3), it was in the domain of Software
Creation (SWC) that its performance was notably strong. This is shown in Figure 4, which
shows the percentage of theorems proven with respect to the problem rating over all domains
(left graph) and over the SWC domain only (right graph).</p>
        <p>All domains
SWC domain</p>
        <p>AX
EPICC-3</p>
        <p>MM</p>
        <p>AX
EPICC-3</p>
        <p>MM</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusion</title>
      <p>The present paper introduces EPICC, a preprocessing technique for dealing with equality when
proving formulae in (classical) first-order logic. Even though this technique can be used with
any proof search calculus, it is in particular useful for tableau or connection calculi as the
integration of techniques for equality into these calculi is not straightforward.</p>
      <p>The preprocessing technique has been specified using a set of rules for simplifying or
modifying a matrix representing the original formula in clausal form. The rules have been implemented,
tested with the connection prover leanCoP and compared to the modification method and the
standard approach of adding the equality axioms to the original matrix.</p>
      <p>Using the EPICC approach, leanCoP was able to prove significantly more problems of the
TPTP library than using its standard technique of just adding the equality axioms, in
particular in the “Software Creation" (SWC) domain. An interesting, yet to our knowledge so far
undocumented, fact is that many of the problems in the TPTP library containing equality can
be proved without any equality handling, i.e. treating the equality symbol as uninterpreted
predicate symbol. The modification method proves significantly less problems than all other
approaches. While the performance of the modification method may look undesirable, there
were a handful of instances when it was the only approach that yielded a solution.</p>
      <p>
        Future research work includes extending and optimizing the existent preprocessing rules.
Furthermore, the adaptation and integration of similar preprocessing techniques into the
nonclausal connection prover nanoCoP [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] or the non-classical provers ileanCoP and MleanCoP
for first-order intuitionistic and modal logic [
        <xref ref-type="bibr" rid="ref18 ref19">18, 19</xref>
        ] is currently investigated.
      </p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgments</title>
      <p>We would like to thank the reviewers of a previous version of this paper for their comments.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>G.</given-names>
            <surname>Sutclife</surname>
          </string-name>
          ,
          <article-title>The TPTP Problem Library and Associated Infrastructure. From CNF to TH0</article-title>
          ,
          <source>TPTP v6.4.0, Journal of Automated Reasoning</source>
          <volume>59</volume>
          (
          <year>2017</year>
          )
          <fpage>483</fpage>
          -
          <lpage>502</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>G.</given-names>
            <surname>Robinson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Wos</surname>
          </string-name>
          ,
          <article-title>Paramodulation and theorem-proving in first-order theories with equality</article-title>
          , in: J. H.
          <string-name>
            <surname>Siekmann</surname>
          </string-name>
          , G. Wrightson (Eds.),
          <source>Automation of Reasoning: 2: Classical Papers on Computational Logic</source>
          <year>1967</year>
          -1970, Springer, Heidelberg,
          <year>1983</year>
          , pp.
          <fpage>298</fpage>
          -
          <lpage>313</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>J. A. Robinson,</surname>
          </string-name>
          <article-title>A machine-oriented logic based on the resolution principle</article-title>
          ,
          <source>Journal of ACM</source>
          <volume>12</volume>
          (
          <year>1965</year>
          )
          <fpage>23</fpage>
          -
          <lpage>41</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Hähnle</surname>
          </string-name>
          ,
          <article-title>Tableaux and related methods</article-title>
          , in: A.
          <string-name>
            <surname>Robinson</surname>
            ,
            <given-names>A</given-names>
          </string-name>
          . Voronkov (Eds.),
          <source>Handbook of Automated Reasoning</source>
          , volume I,
          <string-name>
            <surname>Elsevier</surname>
            <given-names>Science</given-names>
          </string-name>
          , Amsterdam,
          <year>2001</year>
          , pp.
          <fpage>101</fpage>
          -
          <lpage>178</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>W.</given-names>
            <surname>Bibel</surname>
          </string-name>
          , Matings in matrices,
          <source>Commun. ACM</source>
          <volume>26</volume>
          (
          <year>1983</year>
          )
          <fpage>844</fpage>
          -
          <lpage>852</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>J.</given-names>
            <surname>Gallier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Narendran</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Raatz</surname>
          </string-name>
          , W. Snyder,
          <article-title>Theorem proving using equational matings and rigid E-unification</article-title>
          ,
          <source>J. ACM</source>
          <volume>39</volume>
          (
          <year>1992</year>
          )
          <fpage>377</fpage>
          -
          <lpage>430</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Degtyarev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Voronkov</surname>
          </string-name>
          ,
          <article-title>Simultaneous rigid E-unification is undecidable</article-title>
          , in: H. Kleine Büning (Ed.), Computer Science Logic, Springer, Heidelberg,
          <year>1996</year>
          , pp.
          <fpage>178</fpage>
          -
          <lpage>190</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>P.</given-names>
            <surname>Backeman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Rümmer</surname>
          </string-name>
          ,
          <article-title>Eficient algorithms for bounded rigid E-unification</article-title>
          , in: H. De Nivelle (Ed.),
          <source>Automated Reasoning with Analytic Tableaux and Related Methods</source>
          , Springer, Heidelberg,
          <year>2015</year>
          , pp.
          <fpage>70</fpage>
          -
          <lpage>85</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>P.</given-names>
            <surname>Backeman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Rümmer</surname>
          </string-name>
          ,
          <article-title>Theorem proving with bounded rigid E-unification, in:</article-title>
          <string-name>
            <given-names>A. P.</given-names>
            <surname>Felty</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . Middeldorp (Eds.),
          <source>CADE-25</source>
          , Springer, Heidelberg,
          <year>2015</year>
          , pp.
          <fpage>572</fpage>
          -
          <lpage>587</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <source>[10] J. Otten, leanCoP 2.0 and ileanCoP 1</source>
          .
          <article-title>2: High performance lean theorem proving in classical and intuitionistic logic</article-title>
          , in: A.
          <string-name>
            <surname>Armando</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Baumgartner</surname>
          </string-name>
          , G. Dowek (Eds.),
          <source>IJCAR</source>
          <year>2008</year>
          , volume
          <volume>5195</volume>
          <source>of LNAI</source>
          , Springer, Heidelberg,
          <year>2008</year>
          , pp.
          <fpage>283</fpage>
          -
          <lpage>291</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>J.</given-names>
            <surname>Otten</surname>
          </string-name>
          , W. Bibel,
          <article-title>leanCoP: lean connection-based theorem proving</article-title>
          ,
          <source>Journal of Symbolic Computation</source>
          <volume>36</volume>
          (
          <year>2003</year>
          )
          <fpage>139</fpage>
          -
          <lpage>161</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>J.</given-names>
            <surname>Otten</surname>
          </string-name>
          ,
          <article-title>Restricting backtracking in connection calculi</article-title>
          ,
          <source>AI Commun</source>
          .
          <volume>23</volume>
          (
          <year>2010</year>
          )
          <fpage>159</fpage>
          -
          <lpage>182</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>G.</given-names>
            <surname>Sutclife</surname>
          </string-name>
          ,
          <source>The 9th IJCAR Automated Theorem Proving System Competition - CASC-29, AI</source>
          Communications
          <volume>31</volume>
          (
          <year>2018</year>
          )
          <fpage>495</fpage>
          -
          <lpage>507</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>D.</given-names>
            <surname>Brand</surname>
          </string-name>
          ,
          <article-title>Proving theorems with the modification method</article-title>
          ,
          <source>SIAM Journal on Computing</source>
          <volume>4</volume>
          (
          <year>1975</year>
          )
          <fpage>412</fpage>
          -
          <lpage>430</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>W.</given-names>
            <surname>Bibel</surname>
          </string-name>
          ,
          <source>Automated theorem proving, Artificial intelligence</source>
          , 2nd ed.,
          <source>F. Vieweg und Sohn</source>
          , Wiesbaden,
          <year>1987</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>P. B. Andrews</surname>
          </string-name>
          ,
          <article-title>Refutations by matings</article-title>
          , IEEE Transactions on Computers C-
          <volume>25</volume>
          (
          <year>1976</year>
          )
          <fpage>801</fpage>
          -
          <lpage>807</lpage>
          . doi:
          <volume>10</volume>
          .1109/TC.
          <year>1976</year>
          .
          <volume>1674698</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>J.</given-names>
            <surname>Otten</surname>
          </string-name>
          ,
          <article-title>nanoCoP: A non-clausal connection prover</article-title>
          , in: N.
          <string-name>
            <surname>Olivetti</surname>
            ,
            <given-names>A</given-names>
          </string-name>
          . Tiwari (Eds.),
          <source>IJCAR</source>
          <year>2016</year>
          , volume
          <volume>9706</volume>
          <source>of LNAI</source>
          , Springer, Heidelberg,
          <year>2016</year>
          , pp.
          <fpage>302</fpage>
          -
          <lpage>312</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>J.</given-names>
            <surname>Otten</surname>
          </string-name>
          , W. Bibel,
          <article-title>Advances in connection-based automated theorem proving</article-title>
          , in: J.
          <string-name>
            <surname>Bowen</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Hinchey</surname>
          </string-name>
          , E.-R. Olderog (Eds.),
          <source>Provably Correct Systems, NASA Monographs in Systems and Software Engineering</source>
          , Springer, Heidelberg,
          <year>2017</year>
          , pp.
          <fpage>211</fpage>
          -
          <lpage>241</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>W.</given-names>
            <surname>Bibel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Otten</surname>
          </string-name>
          ,
          <article-title>From Schütte's formal systems to modern automated deduction</article-title>
          , in: R. Kahle, M. Rathjen (Eds.),
          <source>The Legacy of Kurt Schütte</source>
          , Springer, Heidelberg,
          <year>2020</year>
          , pp.
          <fpage>217</fpage>
          -
          <lpage>251</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>