Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
ON RESOLUTION
DECISION PROCEDURES
FOR THE MONADIC FRAGMENT
AND GUARDED NEGATION
FRAGMENT
2015
By
Ann-Christin Knoll
School of Computer Science
Contents
Abstract 6
Declaration 7
Copyright 8
Acknowledgements 10
1 Introduction 11
2 Deciding Fragments of FOL with Resolution 14
2.1 The Decidability Problem . . . . . . . . . . . . . . . . . . . . . . 14
2.2 Decidable Fragments of First-Order Logic . . . . . . . . . . . . . 16
2.3 Normal Form Transformations and Clausal Classes . . . . . . . . 18
2.4 Resolution for First-Order Logic . . . . . . . . . . . . . . . . . . . 22
2.5 Resolution as a Decision Procedure . . . . . . . . . . . . . . . . . 24
3 Developing Decision Procedures and SPASS 26
3.1 SPASS - An Automated Theorem Prover . . . . . . . . . . . . . . 26
3.2 Extending SPASS with Decision Procedures . . . . . . . . . . . . 27
3.3 A Decision Procedure for the Guarded Fragment . . . . . . . . . . 28
4 The Monadic Fragment 34
4.1 Investigation of Clausal Classes . . . . . . . . . . . . . . . . . . . 35
4.2 Class Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.3 Decision Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 47
4.4 Proof of Decision Procedure . . . . . . . . . . . . . . . . . . . . . 50
2
5 The Guarded Negation Fragment 56
5.1 Theoretic Investigation . . . . . . . . . . . . . . . . . . . . . . . . 59
5.2 Negation Normal Form . . . . . . . . . . . . . . . . . . . . . . . . 64
5.3 Structural Transformation . . . . . . . . . . . . . . . . . . . . . . 67
5.4 Guarded Negation Clauses . . . . . . . . . . . . . . . . . . . . . . 76
5.5 Decidability of Multi-Guarded Clauses . . . . . . . . . . . . . . . 77
6 Results and Findings 81
6.1 Testing Environment . . . . . . . . . . . . . . . . . . . . . . . . . 81
6.2 Initial Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
6.3 Monadic Fragment . . . . . . . . . . . . . . . . . . . . . . . . . . 83
6.4 Structural Transformation Strategies . . . . . . . . . . . . . . . . 84
7 Conclusions 90
References 91
A Batch Script and Test Results 95
B Structural Transformation Results 99
Word Count: 18,274
3
List of Tables
2.1 Decidable Fragments of First-Order Logic . . . . . . . . . . . . . 16
3.1 Class Recognition and Decision Procedure for Decidable Fragments
in the Extension of SPASS . . . . . . . . . . . . . . . . . . . . . . 28
6.1 Comparison of the Performance of the Basic Version of SPASS and
its Extension With Decision Procedures . . . . . . . . . . . . . . . 82
6.2 Comparison of Different Implementations for MON . . . . . . . . 84
6.3 Comparison of the Performance With and Without Splitting for
Monadic Problems With the Minimum Runtime of 1 second . . . 84
4
List of Figures
5.1 Structure of an Example GNF formula . . . . . . . . . . . . . . . 57
5.2 Structure of GNF Formulae in Negation Normal Form . . . . . . . 65
5.3 Structure of an Example GNF Formula in Negation Normal Form 67
5.4 Visualization of a Structural Transformation Technique for GNF
Formulae in Negation Normal Form . . . . . . . . . . . . . . . . . 68
5.5 Visualization of a Structural Transformation Technique for GNF
Formulae in Negation Normal Form . . . . . . . . . . . . . . . . . 75
5
Abstract
This thesis is about defining resolution decision procedures for decidable frag-
ments of first-order logic. Its main focus is on the monadic fragment and guarded
negation fragment. The monadic fragment has been shown decidable by Lowen-
heim (1915) exactly 100 years ago. It is well-known and its discussion aims to
convey a basic understanding of decision procedures that use ordered resolution to
decide the clausal class of a simple first-order logic fragment. In addition, efforts
have been made to further simplify its clausal class by transformation into clausal
form via disjunctive normal form which eliminates dependencies. As a result no
function symbols are introduced by Skolemization. This reduces the monadic
fragment to a clausal class with only variables and constants. The guarded nega-
tion fragment has been more recently introduced and proven to be decidable by
Barany et al. (2011). For this more complex fragment no practical decision pro-
cedure is known so far. We looked into developing a its decision procedure based
on techniques and ideas of known resolution decision procedures of the guarded
fragment and our analysis of the monadic fragment in this thesis. We made a
start on developing its clausal class by analysing the resulting clauses from differ-
ent structural transformations for the guarded negation fragment. The question
whether there is a resolution decision procedure for the guarded negation frag-
ment remains still open.
6
Declaration
No portion of the work referred to in this dissertation has
been submitted in support of an application for another
degree or qualification of this or any other university or
other institute of learning.
7
Copyright
i. The author of this thesis (including any appendices and/or schedules to
this thesis) owns certain copyright or related rights in it (the “Copyright”)
and s/he has given The University of Manchester certain rights to use such
Copyright, including for administrative purposes.
ii. Copies of this thesis, either in full or in extracts and whether in hard or
electronic copy, may be made only in accordance with the Copyright, De-
signs and Patents Act 1988 (as amended) and regulations issued under it
or, where appropriate, in accordance with licensing agreements which the
University has from time to time. This page must form part of any such
copies made.
iii. The ownership of certain Copyright, patents, designs, trade marks and other
intellectual property (the “Intellectual Property”) and any reproductions of
copyright works in the thesis, for example graphs and tables (“Reproduc-
tions”), which may be described in this thesis, may not be owned by the
author and may be owned by third parties. Such Intellectual Property and
Reproductions cannot and must not be made available for use without the
prior written permission of the owner(s) of the relevant Intellectual Property
and/or Reproductions.
iv. Further information on the conditions under which disclosure, publication
and commercialisation of this thesis, the Copyright and any Intellectual
Property and/or Reproductions described in it may take place is available
in the University IP Policy (see http://documents.manchester.ac.uk/
DocuInfo.aspx?DocID=487), in any relevant Thesis restriction declarations
deposited in the University Library, The University Library’s regulations
(see http://www.manchester.ac.uk/library/aboutus/regulations) and
in The University’s policy on presentation of Theses
8
I would like to dedicate this work to
Leopold Lowenheim
who found a decision procedure
for the monadic fragment
100 years ago.
9
Acknowledgements
First I would like to thank my supervisor Renate Schmidt for all the time and
meetings we had, for listening to my ideas, encouraging me and for her confidence
in my ability. I am especially grateful for her patience, kindness and scientific
proficiency in this area of subject.
Next I would like to thank my family for all the love, trust and support they
gave me. They gave me strength beyond my own. I would also like to thank my
friends at university who made this work a lot more delightful and helped me at
times to gain additional perspectives.
10
Chapter 1
Introduction
One hundred years ago, Lowenheim (1915) presented a decision procedure for
monadic first-order logic. This was the first decision procedure that had ever
been introduced for a decidable fragment of first-order logic. The undecidability
of first-order logic in general has later on been proved independently by Church
(1936) and Turing (1936/37).
“Despite the unsolvability in its general form, the problem retained its vigor
and importance. With the development of computers and automated theorem
proving in the 1960s the implementation of a small but real calculus ratiocinator
eventually became reality. In particular the invention of the unification principle
and of resolution by J. A. Robinson [Robinson 19656] paved the way for efficient
ATP-programs.” (Fermuller et al., 2001, p. 1793)
The concept of resolution allows automated theorem provers to reason upon
first-order logic. But due to the undecidability of first-order logic termination
cannot be guaranteed. There are however many decidable fragments of first-
order logic. This motivates the development of resolution decision procedures.
Implementing these decision procedures for automated theorem provers can guar-
antee termination for decidable fragments.
SPASS is an automated theorem prover for first-order logic. It uses infer-
ence rules to determine whether a first-order logic formula is a valid theorem.
Harbit (2012) has shown that SPASS can be enhanced by implementing deci-
sion procedure for decidable classes. She implemented several resolution decision
11
12 CHAPTER 1. INTRODUCTION
procedures that had already been known for decidable fragments. As a result,
the answer for some problems out of the TPTP library has been found while the
unextended version of SPASS was not able to terminate successfully within the
given time limit.
Recently another decidable fragment – the guarded negation fragment – has
been introduced. It has been shown to be decidable by Barany et al. (2011)
but no practical decision procedure is for this fragment known so far. It is also
not known yet whether resolution can form a decision procedure for this fragment.
This project aims to make progress in developing a resolution decision pro-
cedure for the guarded negation fragment as well as to finding a simple clausal
class for the monadic fragment and to define and implement a decision procedure
for the monadic fragment in SPASS. If a decision procedure can be found for the
guarded negation fragment, the eventual goal is to implement it in SPASS as well.
The main contributions of this work are the introduction of a simplified clausal
class and or the monadic fragment without the need of any function symbols and
progress in developing a decision procedure for the guarded negation fragment,
especially in analysing its structure and analysing different structural transfor-
mations. The second aim of the implementation of class recognition and decision
procedure for the monadic fragment has also been achieved.
Chapter 2 is a theoretic chapter about decidability and resolution decision
procedures in general. It gives definitions for first-order logic, resolution, struc-
tural transformation and other techniques that has been used later on.
In Chapter 3 a case study of developing a decision procedure for the guarded
fragment has been given along with an introduction of SPASS and decision pro-
cedures in SPASS. The guarded fragment is one of the fragments for which a
decision procedure has been implemented in SPASS.
Chapter 4 is about the monadic fragment. The discussion of this fragment,
its clausal class and decision procedure aims to convey a basic understanding
of resolution decision procedures. The simplified clausal class for the monadic
13
fragment has been introduced in this chapter. The implementation of its class
recognition and decision procedure have been outlined.
Chapter 5 discusses the general structure of formulae in the guarded negation
fragment and describes several structural transformations for this fragment with
the purpose of obtaining nice clauses that lead to a decidable clausal class. The
resulting clauses and their decidability have has discussed.
Appendix B and Chapter 6 contain the results of different structural trans-
formations that have been discussed. Chapter 6 also contains tests that confirm
the findings of (Harbit, 2012) and an evaluation of the decision procedure of the
monadic fragment with and without splitting.
Chapter 2
Deciding Fragments of FOL with
Resolution
2.1 The Decidability Problem
The decidability problem is the old problem of mathematics and philosophy that
is concerned with deciding the truthfulness of sentences. The formulation of the
Entscheidungsproblem – or decidability problem – as the problem to “decide the
validity (respectively satisfiability) of a given logical expression by a finite num-
ber of operations” can be ascribed to Hilbert and Ackermann in 1928. Within
this project we will study the decidability of fragments of first-order logic.
As mentioned in the introduction the decidability of first-order logic in gen-
eral is undecidable. Nevertheless many fragments of first-order logic are decidable.
For those decidable fragments of first-order logic decision procedures can be de-
fined. Those decision procedures are algorithms that determine satisfiability of
first-order logic formulae within finite time.
The monadic fragment is the first decidable fragment for which a decision
procedure has been presented. Since then, decision procedures for many more
decidable fragments have been found, including the guarded fragment (Ganzinger
& Nivelle, 1999) and for Bernays-Schonfinkel class (Piskac et al., 2008).
First-order logic is an extension of propositional logic. As generally known
propositional logic operates upon the set of boolean variables, while first-order
14
2.1. THE DECIDABILITY PROBLEM 15
logic adds another set to the concept. Let this set be called U. Then first-order
logic allows mappings called functions within that set U and mappings called
predicates from the set U to the boolean set additional to the mappings of formal
logic which are within the boolean set.
A first-order logic formula can be visualized as a formula tree with logical op-
erators, function and predicate symbols as nodes and variables and constants as
leafs. Occasionally we will use this method in later on to visualize the structure
of a formula.
A first-order logic formula is satisfiable if there exists at least one valid as-
signment of variables such that the formula is true. Visually spoken this is the
case when the mapping at the root of the formula tree maps unto true. Infer-
ence rules like resolution can be used to reason about the consistency of a formula.
The order to give a formal definition of a first-order logic we need to define
terms, atoms and literals (Fermuller et al., 2001; Harbit, 2012):
Definition 2.1. Term. A term is defined inductively as follows:
• Each variable and each constant is a term.
• If t1, ..., tn are terms and f is an n-place function symbol, then f(t1, ..., tn)
is also a term.
Definition 2.2. Atom. An atom A is a predicate symbol with its arguments. If P
is a n-place predicate symbol and t1, t1, ..., tn are terms, then A = P (t1, t1, ..., tn)
is an atom.
Definition 2.3. Literal. Literals are positive or negated atoms. All atoms are
literals, and for all atoms A their negation ¬A is also a literal.
Now we can define first-order logic formulae according to a definition in (Har-
bit, 2012).
Definition 2.4. First-order logic. Let F,G be first-order logic formulae and let
x be a variable. Then A formula A belongs to the set of first-order logic formulae,
if it fulfils one of the following conditions:
• A is a literal or an atom.
16 CHAPTER 2. DECIDING FRAGMENTS OF FOL WITH RESOLUTION
restriction decidable fragment
unary predicate symbols monadic fragment (MON)maximal 2 variables FO2
ordering on variables fluted logicquantifier prefixes ∃∗∀,∃∗∀∃∗,∀∗∀∀∃∗quantification by relativisation guarded fragment∀ quantification Maslov’s dual classguarded negation UNFO, GNF
Table 2.1: Decidable Fragments of First-Order Logic
• A is a logical constant, namely > or ⊥.
• A = ¬F .
• A = (F ? G), where ? ∈ {∧,∨,→,↔} is a logical operator.
• A = ∀xF or A = ∃xF .
2.2 Decidable Fragments of First-Order Logic
Decidable fragments result from restrictions on formulae of first-order logic. The
decidable fragments known result from restricting for example the arity of pred-
icate symbols, the number of variables, the sequence of quantifiers or - more
recently introduced - the appearance of negation. According to Fermuller et al.
(2001), in general all of these fragments exclude the use of function symbols. The
table below follows an outline by Schmidt (2011).
Most of these decidable fragments have been implemented in the scope of the
work of Harbit (2012).
The decidable fragments with most relevance for this project are the monadic
fragment and the guarded negation fragment. Therefore both of them will be
introduced at this point. A discussion of their decision procedures will be given
later on.
The monadic fragment, short MON, is the subset of first-order logic that re-
stricts the use of predicate symbols to the use of unary predicate symbols. Within
2.2. DECIDABLE FRAGMENTS OF FIRST-ORDER LOGIC 17
this project we will also allow propositional predicate symbols. This means that
every predicate symbol that appears in a monadic formula has at most one ar-
gument. No function symbols other than Skolem functions are allowed. As men-
tioned previously it was one of the first fragments of first-order logic that have
been shown to be decidable and therefore also historically meaningful (Lowen-
heim, 1915).
The guarded negation fragment has been introduced by Barany et al. (2011).
It is a combined decidable fragment consisting of two other decidable fragments,
the guarded fragment and the unary negation fragment, called UNFO. The guarded
negation fragment has originally been called GNFO by ten Cate et al. because
they were distinguishing between the guarded negation fragment of first-order
logic, called GNFO, and of guarded least fixpoint logic, called GNFP. Within this
project we will use the abbreviation GNF since we are only operating on first-
order logic and do not need to distinguish between first-order logic and guarded
least fixpoint logic.
Definition 2.5. Guarded negation fragment. A formula ϕ belongs to the guarded
negation fragment if:
ϕ ::= R(x) | ∃xϕ | ϕ ∨ ϕ | ϕ ∧ ϕ | α(xy) ∧ ¬ϕ(y)
where R(x) and α(xy) are unnegated atoms and α(xy) functions as a guard which
has all freely in ϕ(y) occurring variables as arguments.
As illustrated in the table the guarded fragment restricts quantification and
the unary negation fragment restricts negation in a way that it only allows the
negation of subformulae with at most one free variable. The guarded negation
fragment restricts negation by requiring guards for all freely occurring variables
in negated subformulae.
The guarded fragment also restricts universal quantifiers. Universal quanti-
fiers can only be introduced by a negated existential quantifier. The decidability
of the guarded negation fragment of first-order logic has been shown by Barany
et al. (2011) alongside with its definition.
18 CHAPTER 2. DECIDING FRAGMENTS OF FOL WITH RESOLUTION
For decidable fragments decision procedures exist such that the satisfiability
of formulae belonging to these fragments can be guaranteed to be derived within
finite time.
2.3 Normal Form Transformations and Clausal
Classes
Resolution inference rules usually operate on clauses. Every first-order logic for-
mula can be transformed into a normal form called clausal normal form where
every clause is a disjunction of literals and a formula is a conjunction of clauses.
To transform a formula into clausal normal form, first Skolemization is used
to replace all existential quantifiers with Skolem terms. Then all universal quan-
tifiers can be moved to the beginning of the formula and do not need to be
considered any more because all variables can be considered as universally quan-
tified variables. Afterwards the transformation is similar to the transformation of
formal logic into clausal normal form. The formula is transformed into negation
normal form and then into conjunctive normal form. This results in clauses where
all variables are universally quantified.
Miniscoping and Skolemization
Skolemization is a technique used during the transformation process of first order
logic formulae into clausal normal form. In clausal normal form, no quantifiers
remain and all variables are implicitly universally quantified. To represent exis-
tentially quantified variables, the variable is usually replaced by a fresh function
symbols whose arguments are the dependencies of the variable it stands for.
Two well-known ways of Skolemization are via PNF and via miniscoping.
PNF means prefix normal form and is obtained by moving all quantifiers to the
beginning of the formulae. Then every existentially quantified variable is being
replaced by a new Skolem function which has all preceding universally quantified
variables as arguments.
2.3. NORMAL FORM TRANSFORMATIONS AND CLAUSAL CLASSES 19
This leads to the nice property that after transformation into clausal normal
form all Skolem functions f and g have the same arguments if they have the same
arity. If they do not have the same arity - let us say WLOG the arity of g exceeds
the arity of f - the arguments of g contain all arguments of f. The disadvantage
is that the arity of the introduced Skolem functions is comparatively big.
On the contrary, miniscoping has the advantage of minimizing function arity.
All arguments of a Skolem function represent dependency. Therefore miniscop-
ing reduces dependencies. This is the way SPASS uses to transform formulae
into clausal normal form. Therefore we will concentrate on this Skolemization
approach.
In the beginning miniscoping moves all quantifiers inwards as far as possible
according to the following rules as outlined by Nonnengart & Weidenbachh (2001):
∃x(φ ∧ ψ) ⇒min ∃xφ ∧ ψ if x not ∈ free(ψ)
∃x(φ ∨ ψ) ⇒min ∃xφ ∨ ψ if x not ∈ free(ψ)
∀x(φ ∧ ψ) ⇒min ∀xφ ∧ ψ if x not ∈ free(ψ)
∀x(φ ∨ ψ) ⇒min ∀xφ ∨ ψ if x not ∈ free(ψ)
∀x(φ ∧ ψ) ⇒min ∀xφ ∧ ∀xψ if x ∈ free(φ) and x ∈ free(ψ)
∃x(φ ∨ ψ) ⇒min ∃xφ ∨ ∃xψ if x ∈ free(φ) and x ∈ free(ψ)
Then all quantified variables are being renamed to ensure unique variable
names. And afterwards Skolem functions are introduced for each existentially
quantified variable. The arguments are all freely occurring variables within the
scope of the current existential quantifier. Replacing must be done in an outer-
most way according to Nonnengart & Weidenbachh (2001).
20 CHAPTER 2. DECIDING FRAGMENTS OF FOL WITH RESOLUTION
Negation Normal Form
Transformation into negation normal form has been explained in (Nonnengart
& Weidenbachh, 2001). A formula is in negation normal form if it contains no
implication or equivalence symbols and if every negation occurs directly in front
of an atom.
Every formula without equality can be transformed into negation normal form
by following these rules:
¬(φ ∧ ψ) ⇒NNF ¬xφ ∨ ¬ψ
¬(φ ∨ ψ) ⇒NNF ¬xφ ∧ ¬ψ
¬(∀xφ) ⇒NNF ∃x¬φ
¬(∃xφ) ⇒NNF ∀x¬φ
φ→ ψ ⇒NNF ¬φ ∨ ψ
φ↔ ψ ⇒NNF (φ→ ψ) ∧ (ψ → φ)
¬¬φ ⇒NNF φ
Another way of eliminating equivalences that supports simplification has been
explained in (Nonnengart & Weidenbachh, 2001).
Structural Transformation
“Characteristic of non-structural transformations is the loss of the structural in-
formation of the input formula.[...] On the other hand, the syntactic structure
is preserved by structural transformations which introduce an abbreviation (or a
label) for any subformula occurrence of the input formula.” (M. Baaz & Leitsch,
2001, p. 306)
Structural transformation can be used to preserve and/or modify the structure
of the input formula. This makes structural transformation a useful technique
which not only “produces smaller clause sets compared with other techniques”
according to (Nonnengart & Weidenbachh, 2001, p. 337) but also helps to form a
2.3. NORMAL FORM TRANSFORMATIONS AND CLAUSAL CLASSES 21
decidable clausal class. In some cases it also results in shorter sets of clauses. The
formal definition for structural transformation has been given in (Nonnengart &
Weidenbachh, 2001):
Definition 2.6. Structural Transformation. Let ψ be a formula and let φ = ψ|πbe the subformula of ψ we want to rename. Let x1, ..., xn be free variables in φ
and let R be a predicate symbol with arity n which is new to ψ. Then the formula
ψ[π/R(x1, ..., x9)] ∧ def(π, φ,R)
is a formula renaming or structural transformation of ψ at position π. The
formula def(π, ψ,R) is a polarity dependent definition of the new predicate R:
def(π, ψ,R) =
1.) ∀x1, ..., xn[R(x1, ..., xn)→ φ] if pol(ψ, π) = 1
2.) ∀x1, ..., xn[φ→ R(x1, ..., xn)] if pol(ψ, π) = −1
3.) ∀x1, ..., xn[R(x1, ..., xn)↔ φ] if pol(ψ, π) = 0
An examples for structural transformation for a guarded formula can be found
in Section 3.3 in this thesis.
For some structural transformations it can be useful to first transform the
formula into negation normal form. This results in a more general form because
it is independent of where the negations have been in the beginning. As an exam-
ple, every guarded negation formula restricts negation to come immediately after
a guard. There are however, a lot of equivalent formulae where those negations
have already been resolved. The syntax of the formula is strictly spoken different,
while general structure of the formula stays the same. Therefore transformation
into negation normal form helps to focus on a more uniform representation of the
formula.
22 CHAPTER 2. DECIDING FRAGMENTS OF FOL WITH RESOLUTION
2.4 Resolution for First-Order Logic
Resolution is currently being used by automated theorem proving systems like
SPASS and Vampire, Kovacs & Voronkov (2013), as one of their main interfer-
ence rules. Schmidt & Korovin (2015) state that resolution in combination with
factoring forms the sound and refutationally complete inference system Res for
first-order logic .
Resolution for first-order logic that is applicable for non-ground atoms has
been described by Robinson (1965). He introduced unifiers to match clauses con-
taining literals with common ground instances in such a way that resolution is
applicable. In order to do so the most general unifier is used. The same principles
apply for factoring. Those rules can be described in the following way:
Resolution for First-Order Logic
C ∨ A ¬B ∨D(C ∨D)σ
Positive Factoring for First-Order Logic
C ∨ A ∨B(C ∨ A)σ
with A and B being atoms and σ being the most general unifier of A and B.
Both C and D represent arbitrary disjunctions of literals.
Resolution operates upon two clauses and produces a clause as their infer-
ence which is the empty clause if the two clauses are contradictory. Soundness
describes that the conclusion derived logically follows from the premises. When
it is possible to derive a contradiction from a set of clauses the formula is un-
satisfiable and otherwise it is satisfiable due to the refutational completeness of
Res. Refutational completeness means that when all possible inferences over a
set of clauses S have been performed without deriving the empty clause then S
is satisfiable.
Another inference rule is splitting. It can be used to simplify clauses. It is
defined as follows:
2.4. RESOLUTION FOR FIRST-ORDER LOGIC 23
Definition 2.7. Splitting. Let C and D be variable disjunct clauses. Then a
clause of the form C ∨D can be split into two clauses C and D and the parent
clause is deleted. Now in order to show satisfiability of the set of clauses S that
the clause C ∨D belonged to, satisfiability needs to be shown for S ∧ C and C
or for S ∧D.D ∨DC | D
Ordered Resolution and Selection Functions
This example as mentioned in Schmidt (2011) is a satisfiable set of clauses with
infinitely many conclusions
¬R(a, x) ∨ ¬Q(x) ∨R(x, f(x))
¬R(a, x) ∨ ¬Q(x) ∨Q(f(x))
which can be avoided by ordered resolution as well as by resolution with selection
function. In this case we can use an ordering � such that literals with more
function symbols are greater than literals with less function symbols. This is a
common property of orderings. In the following the maximal literals is underlined:
¬R(a, x) ∨ ¬Q(x) ∨R(x, f(x))
¬R(a, x) ∨ ¬Q(x) ∨Q(f(x))
Resolution Res� is restricted by the ordering in a way that only maximal literals
are available for resolution. In this case no resolution step is possible and the set
is therefore satisfiable due to the soundness and completeness of Res�.
Referring back to the definitions in Section 2.4 the ordering restricts resolution
in a way that A and ¬B have to be maximal literals in the premises. If we addi-
tionally introduce a selection function any number of arbitrary negative literals
can be selected per clause. The selection function has priority over the ordering.
This means that if selected literals exists, only these literals can be resolved upon.
For the example above a selection function that selects the literal ¬R(a, x)
in both clauses can be used to form a resolution decision procedure:
24 CHAPTER 2. DECIDING FRAGMENTS OF FOL WITH RESOLUTION
¬R(a, x) ∨ ¬Q(x) ∨R(x, f(x))
¬R(a, x) ∨ ¬Q(x) ∨Q(f(x))
No resolution is possible because resolution is restricted to selected literals and
can not be applied between two negative literals. Therefore this set is saturated
and found to be satisfiable. Soundness and completeness of ordered resolution
with selection function has been shown by Bachmair & Ganzinger (2001).
Hyperresolution is the name of a resolution inference rule that only produces
clauses in with all literals are positive. This can be imitated by resolution upon
clauses in which all negative literals are selected. When multiple literals of a
clause are selected, in order for resolution to take place, each selected literal
needs to be unified and resolved with a clause within the same resolution step.
These techniques can be used to create decision procedures for most of the
decidable fragments mentioned so far, in particular for the monadic fragment.
2.5 Resolution as a Decision Procedure
Though Res has been shown to be a decision procedure for many decidable frag-
ments it is generally not a decision procedure on its own. Often times it is possible
to derive new conclusions at each resolution step. Usually resolution is being re-
stricted to form a decision procedure because otherwise redundant rotations of
the same proof and loops are possible. Furthermore Schmidt & Korovin (2015)
observed that “[i]n the presence of ordering restrictions (however one chooses �)
no rotations are possible. In other words, orderings identify exactly one repre-
sentative in any class of rotation-equivalent proofs.”
Since resolution operates upon clauses, first we need to define a class of clauses
C that contains the fragment we want to decide. Let R be a set of inference rules.
According to Schmidt (2011) R is a decision procedure for C if it fulfils the
following properties :
1. C is closed under R, i.e. for any R-inference C1...Cn
C, we have C ∈ C
2.5. RESOLUTION AS A DECISION PROCEDURE 25
when each C1, ..., Cn ∈ C. In words, this means that no R-inference within
C leaves the clausal class C.
2. C is finitely bounded, meaning that given a finite number of predicate
and function symbols only finitely many non-variant clauses belong to C.
These instructions tell us how to design a decision procedure and how to prove its
correctness. To show that C is closed under R we need to show for every inference
rule in R that the derived clauses from C remain in C. To show that C is finitely
bounded, we need to argue that only finitely many non-variant clauses belong to
C. We could for example give an upper bound of different clauses possible in Cdepending on the number of predicate symbols and function symbols available.
Then it follows from this definition that R forms a decision procedure for C.
The Role of Subsumption Deletion
Subsumption deletion is the deletion of subsumed clauses. A clauseD is subsumed
by a clause C when for some σ it holds that Cσ ⊂ D. Without subsumption
deletion, infinitely many similar and redundant clauses would be possible, for
example with multiple appearances of the same literal. This would make it im-
possible to show that a set of clauses is finitely bounded, because the same literal
may appear arbitrary many times. While inference rules solemnly add clauses
to a set of clauses, reduction rules like subsumption deletion delete redundant
clauses. As an example factoring in combination with subsumption deletion can
reduce clauses until every literal appears uniquely within its clause.
Chapter 3
Developing Decision Procedures
and SPASS
3.1 SPASS - An Automated Theorem Prover
Automated theorem proving (ATP) systems solve the satisfiability problem to
prove theorems. Sutcliffe (2015) states that ATP systems find application in
many different areas, for example mathematics, software verification and hard-
ware verification and have also successfully been used in the fields of logic and
social science. He mentions Otter, E, SPASS, Vampire and Waldmeister as some
well known and successful systems for first-order logic .
Though much theoretical work has been done to find decision procedures
for decidable fragments this knowledge largely remains unused within the proof
search of most automated theorem provers. One exception is the implementation
of decision procedures in SPASS by Harbit (2012). Her extension will be further
developed within the context of this work. For this reason we will focus on SPASS
as a theorem prover.
SPASS is an automated theorem prover for full first-order logic with equality
which has been developed since 1994 at the Max Planck Institute for Computer
Science, mainly by Christoph Weidenbach. The name SPASS is German and
means fun, but it also stands for “Synergetic Prover Augmenting Superposition
with Sorts”.
26
3.2. EXTENDING SPASS WITH DECISION PROCEDURES 27
SPASS has already implemented the basic functionality needed for decision
procedures. It can specify ordering and selection functions for resolution or use
hyperresolution as inference rule. I also suppose that when running on auto-mode
it has some kind of pattern to automatically choose an approach for a given for-
mula. What Harbit (2012) added in previous work is the recognition of decidable
classes and class-dependent selection of functionality to form decision procedures.
3.2 Extending SPASS with Decision Procedures
The approach of extending SPASS by implementing decision procedures for de-
cidable fragments has already been shown to be successful in the project of Har-
bit (2012). Her project from three years ago extended SPASS with recognition
procedures for eight decidable fragments of first-order logic and with decision
procedures for six of them. This resulted in an extension of SPASS that was able
to terminate successfully in more cases within a given time limit. This project is
a continuation of her efforts.
Her extension covers the recognition of eight decidable clausal classes and
implementation of decision procedures for six of them. All of them are either
decidable by ordered resolution, ordered resolution with selection function or by
hyperresolution. The classes covered with decision procedures are GC, ε1, ε+;
BSH, OCCI and PVD. Additionally the classes S+ and WGC can be recognized.
Their definitions can be found in the master thesis of Harbit (2012).
SPASS uses flags to control what happens. For example, there exists a flag for
hyperresolution. If this flag is set, hyperresolution is used as an inference rule.
This feature has been used well to integrate class recognition and to form decision
procedures.
After analysing the input clauses in the beginning and recognizing that all of
them belong to a class, a flag for this class is set true. For example, if all clauses
belong to OCCI, the flags for the decision procedure of OCCI are set. One of
28 CHAPTER 3. DEVELOPING DECISION PROCEDURES AND SPASS
decision procedure implemented recognized
ordered resolution with selection GC GCε1, ε+ ε1, ε+
S+
ordered resolution WGCBSH BSHOCCI OCCI
hyperresolution PVD PVD
Table 3.1: Class Recognition and Decision Procedure for Decidable Fragments inthe Extension of SPASS
these flags is the SPASS flag for the inference rule of ordered hyperresolution,
flag IOHY. This flag is set to true and thereby activates ordered hyperresolution
as an inference rule. This approach of implementing decision procedures fits well
into the design of SPASS.
3.3 A Decision Procedure for the Guarded Frag-
ment
Since the guarded fragment is closely related to the guarded negation fragment,
the investigation of its decision procedure is relevant for developing a decision
procedure for the guarded negation fragment. The definition of the guarded frag-
ment reads (Ganzinger & Nivelle, 1999):
Definition 3.1. The guarded fragment GF is a subclass of first-order logic with-
out non-constant function symbols which is inductively defined as follows:
• > and ⊥ are in GF ,
• if A is an atom, then A is in GF ,
• GF is closed under boolean combinations,
• if ϕ is in GF , A is an atom, and x is a sequence of variables, such that every
free variable of ϕ is an argument of A, then (∀x)(A→ ϕ) and (∃x)(A ∧ ϕ)
are in GF . The atom A is called a guard.
3.3. A DECISION PROCEDURE FOR THE GUARDED FRAGMENT 29
Example 3.2. An example for a guarded formula is:
∃x(A1(x) ∧ ∀y(A2(x, y)→ ∃z(A3(x, y, z) ∧ ¬(P (x, y) ∨Q(z)))))
We can see that the definition of the guarded fragment has been followed,
because every quantified subformula has its respective guard A1, A2, A3. For in-
stance, we can see that the subformula ¬(P (x, y) ∨ Q(z)) has the free variables
x, y and z. The guard A3(x, y, z) has according to the definition all of them as
arguments and is preceded by an existential quantification over z. Similarly, if we
call this subformula ϕ := ∃z(A3(x, y, z) ∧ ¬(P (x, y) ∨Q(z))), it becomes evident
that the subformula ∀y(A2(x, y) → ϕ(z)) is guarded as well. In this manner we
can see that the whole formula is in GF .
In contrast, formulas like A(x, y) and A(x, y)∨P (x, z) are not in GF because
they are not closed. Other examples given in Ganzinger & Nivelle (1999) are
∀x, yP (x, y) or transitivity statements like ∀x1, x2, x3[P (x1, x2) → P (x2, x3) →P (x1, x3)]. They are not in GF because they do not have proper guards.
Ganzinger & Nivelle (1999) published a special way of structural transforma-
tion that transforms guarded formulae into guarded clauses. The clausal class of
guarded clauses has been summarized by Harbit (2012):
Definition 3.3. A clause C is called guarded and belongs to the clausal class of
the guarded fragment, if :
• C is simple.
• Every functional subterm in C contains all the variables of C.
• If C is non-ground, C has a non-functional negative literal, called a guard,
which contains all the variables of C.
Every guarded formula can be transformed into guarded clauses. In order to
do so, the formula is first transformed into negation normal form (NNF). This
means that negations only occur at the level of literals. All implications have been
removed and replaced by their equivalent formulas using conjunction, disjunction
and negation. In our case negation normal form looks like:
⇒NNF ∃x(A1(x) ∧ ∀y(¬A2(x, y) ∨ ∃z(A3(x, y, z) ∧ (¬P (x, y) ∧ ¬Q(z)))))
30 CHAPTER 3. DEVELOPING DECISION PROCEDURES AND SPASS
The next step is structural transformation. In order to get guarded clauses,
we need to introduce new predicate symbols in a refined way. Ganzinger & Niv-
elle (1999) define how to introduce these symbols:
“Let F = F1, ..., Fn be a set of formulae in negation normal form. The struc-
tural transformation of GF is obtained by iterating the following transformations:
If Fi is a formula in F containing a proper subformula of the form ∀x(¬G ∨H),
with G the guard, then (i) add a definition ∀xy(¬G ∨ ¬α(y) ∨H) to F, and (ii)
replace the indicated sub-formula in F by α(y). Hereby it is assumed that y is the
set of variables that occur in G, but not in x, and that α is a new predicate name
that does not occur in F .”
This means, every subformula of the kind ∀x(¬G∨H) needs to be replaced by a
fresh predicate symbol and defined as ∀xy(¬G∨¬α(y)∨H). We will demonstrate
this with our example. Another good example is given by Ganzinger & Nivelle
(1999).
⇒str. ∃x(A1(x) ∧ α(x))
∀xy(¬A2(x, y) ∨ ¬α(x) ∨ ∃z(A3(x, y, z) ∧ (¬P (x, y) ∧ ¬Q(z)))))
In the end, Skolemization and normal form transformation yield the anticipated
guarded clauses:
⇒SK A1(a) ∧ α(a)
∀xy(¬A2(x, y) ∨ ¬α(x) ∨ (A3(x, y, f(x, y)) ∧ (¬P (x, y) ∧ ¬Q(f(x, y))))))
⇒CNF A1(a)
α(a)
¬A2(x, y) ∨ ¬α(x) ∨ (A3(x, y, f(x, y)))
¬A2(x, y) ∨ ¬α(x) ∨ ¬P (x, y)
¬A2(x, y) ∨ ¬α(x) ∨ ¬Q(f(x, y))
All of these clauses belong to the class of guarded clauses, because all of them are
simple without nested function symbols, all Skolem terms contain all the vari-
ables of their clause and every non-ground clause has a non-functional negative
literal as a guard.
3.3. A DECISION PROCEDURE FOR THE GUARDED FRAGMENT 31
Though Ganzinger & Nivelle (1999) describe specifically that the definition of
the introduced predicate symbols should be a new formula ∀xy(¬G∨¬α(y)∨H) a
formula of the kind ∀yα(y)→ ∀x(¬G∨H) as introduced by structural transforma-
tion in SPASS is equivalent to the formula ∀xy(¬G∨¬α(y)∨H) when transformed
back into negation normal form. Therefore standard structural transformation
of SPASS upon universal quantifiers can be used to transform a guarded formula
into guarded clauses. This has been tested and confirmed in SPASS.
As described and proven in Ganzinger & Nivelle (1999) the decision procedure
for the guarded fragment has been given by a lexicographic path ordering based
on a precedence � and a selection function Σ. � is defined such that functions,
constants and predicates are ordered with f � c � p � tt. The selection function
Σ is described by the following rules:
• If a clause is non-functional and contains a guard then one of its guards is
selected by Σ.
• If a clause contains a functional negative literal, one of these is selected.
• If a clause contains a positive functional literal, but no negative functional
literal, no literal is selected.
The ordering and selection function apply to our example as follows:
1. A1(a)
2. α(a)
3. ¬A2(x, y) ∨ ¬α(x) ∨ (A3(x, y, f(x, y)))
4. ¬A2(x, y) ∨ ¬α(x) ∨ ¬P (x, y)
5. ¬A2(x, y) ∨ ¬α(x) ∨ ¬Q(f(x, y))
Which is already saturated since it is a small example, but usually all inferences
would remain in the finite clausal class of the guarded clauses.
Class recognition for guarded clauses as well as their decision procedure have
been implemented in SPASS by Harbit (2012). The details about this implemen-
tation can be read in her thesis.
32 CHAPTER 3. DEVELOPING DECISION PROCEDURES AND SPASS
The ordering in combination with σ form a decision procedure, because the
guarded class is finite as shown by Ganzinger & Nivelle (1999) and all inferences
remain within the guarded class. All inferences remain within the guarded class,
because they are either made between:
• two ground clauses which results in another ground clause.
• a ground clause and a properly guarded clause. Then resolution applies
on a covering literal of the ground clause. Therefore all variables of the
non-ground clause are unified with constants and the resolvent is ground.
• two properly guarded clauses. Then there are three options:
1. between two clauses with guards that are selected in the same way no
resolution is possible, because then either a negative literal is selected
in each clause or both clauses have maximal positive literals and no
selected literals. In both cases resolution is not possible.
2. between a non-functional clause C with its selected guard G and a
clause D with a positive functional literal L and no negative functional
literals where nothing is selected. Then resolution will apply between
L and the guard. C is non-functional and D is simple, therefore the
most general unifier σ := mgu(G,L) increases only the term depth of
C to a maximal term depth of 1.
3. between a clause C with a functional negative literal N and a clause D
with a positive functional literal L and no negative functional literal.
Then resolution is applied between N and L which are both functional.
Since every function contains all the variables of the clause, the func-
tions need to have the same arity and occur at the same positions
within the arguments of the predicate, such that the most general uni-
fier does σ not increase term depth. Because otherwise, if σ would
increase term depth, since unification is applied simultaneously, the
following would happen:
¬P (f(x, y, z), y, z)
P (x′, y′, f(x′, y′, z′))
3.3. A DECISION PROCEDURE FOR THE GUARDED FRAGMENT 33
To find the most general unifier of both literals we can apply the
unification rules:
⇒U f(x, y, z).= x′, y
.= y′, z
.= f(x′, y′, z′) (Decomposition)
⇒U x′.= f(x, y, z), y
.= y′, z
.= f(x′, y′, z′) (Orientation)
⇒U x′.= f(x, y, z), y
.= y′, z
.= f(f(x, y, z), y′, z′) (Substitution)
⇒U ⊥ (Occur-check)
Since z occurs in f(f(x, y, z), y′, z′) they can never be unified. Some-
thing similar would always happen WLOG, when we try to unify two
literals that contain function symbols at different positions. There-
fore, the function symbols must occur at the same position in both
predicates or one of the literals. This also means that both function
symbols need to have the same arity and that the most general unifier
will not increase term depth every variable will be unified with a cor-
responding variable of the other clause. As a conclusion, no additional
variables are added such that both guards will still be guards over all
variables in the clause.
Chapter 4
The Monadic Fragment
The first part of the project focuses on the monadic fragment of first-order logic
which is generally well known (Behmann, 1922). It is still interesting for us, be-
cause its simplicity makes it useful to gain a basic understanding of resolution
decision procedures. Within the project, the monadic fragment is used as a case
study for recognizing and deciding fragments of first-order logic.
The monadic fragment (MON) is the class of first-order logic formulae in which
all predicate symbols are monadic and no function symbols are allowed. Predi-
cate symbols are monadic when they have arity one and thus take exactly one
argument. Within this project we also include propositional predicate symbols
with arity zero.
Definition 4.1. first-order logic formula F belongs to the monadic fragment
FMON , if the following two conditions are fulfilled:
1. All predicate symbols in F have maximal arity 1.
2. All function symbols in F are constants.
Example 4.2. An example of a monadic formula. It has been inspired by an
example in (Harbit, 2012).
∀x∃y((¬P (x) ∨ P (y)) ∧Q(y) ∧ P (a))
34
4.1. INVESTIGATION OF CLAUSAL CLASSES 35
4.1 Investigation of Clausal Classes
Some theoretic work needs to be done before a decision procedure can be defined
and later on implemented and evaluated. The first step is the definition of a
good clausal class. This is of equal importance as the definition of the decision
procedure itself. Clausal classes with good properties enhance the recognition of
the fragments and set a good foundation for a resolution decision procedure.
Transformation into clausal normal form (CNF) maps a formula onto a set of
clauses. A clausal class C for a fragment F of first-order logic is a subset of all
possible clauses. At a minimum C should contain all clauses that are necessary
to express any formula F ∈ F after its transformation into clausal normal form.
Before transformation to clausal normal form, all arguments are either con-
stants or variables. During Skolemization, Skolem functions are introduced for ex-
istentially quantified variables. These Skolem functions can have arbitrary many
variables as arguments. Their arguments are all universally quantified variables
which the existentially quantified variable is dependent upon. As an example, we
can transform the monadic formula from Example 4.2 into clausal normal form
using miniscoping by introducing the new Skolem function symbol f .
1. ¬P (x) ∨ P (f(x))
2. Q(f(x))
3. P (a)
Every monadic formula can be described in clausal normal form. There are
no further restrictions upon the monadic fragment than those upon predicate and
function symbols, therefore all clauses are possible that have these restrictions.
This means, that all predicate symbols that occur in the clause must have maxi-
mal arity one with either constants, variables or Skolem functions as arguments.
In particular, no nested function symbols occur because of how Skolemization is
defined.
Definition 4.3. Let CMON be a clausal class for the monadic fragment. A clause
C belongs to the clausal class CMON if it fulfils the following conditions:
36 CHAPTER 4. THE MONADIC FRAGMENT
1. C is simple (C has a maximal term depth of 1).
2. All predicate symbols in C have maximal arity 1.
3. All function symbols in C are either constants or Skolem functions.
Since every formula can be represented in clausal normal form and we did not
introduce any additional restrictions than the ones already given, every formula
in the monadic fragment is transformed into a set of clauses in CMON . This
property makes CMON a valid clausal class for the monadic fragment. All clauses
C ∈ CMON can be represented in the following form:
C := L(a1) ∨ . . . ∨ L(an) ∨ L(x1) ∨ . . . ∨ L(xm) ∨ L(f1(y1)) ∨ ... ∨ L(fN(yN))
with L being any unary predicate symbol or possibly a predicate symbol of arity
zero in which case the argument ceases to apply. All ai are constants, all xj are
variables and all fk are Skolem functions with their according yk being a sequence
of variables as arguments.
What could go wrong...
If we can manipulate formulae of the monadic fragment to obtain clauses such as
this one:
(*) ¬R(f(a, y)) ∨ ¬R(f(y, z)) ∨R(f(a, z))
Then the following example shows how resolution can construct infinitely
many different clauses and thus never end. Condensing and subsumption deletion
are not applicable to these clauses and their inferences.
1. ¬R(f(a, y)) ∨ ¬R(f(y, z)) ∨R(f(a, z)) (given)
2. R(f(a, b)) (given)
3. ¬R(f(b, z)) ∨R(f(a, z)) (Res 1.1, 2.1)
4. ¬R(f(b, y)) ∨ ¬R(f(y, z)) ∨R(f(a, z)) (Res 1.1, 3.2)
5. ¬R(f(b, y′)) ∨ ¬R(f(y′, y)) ∨ ¬R(f(y, z)) ∨R(f(a, z)) (Res 1.1, 4.3)
4.1. INVESTIGATION OF CLAUSAL CLASSES 37
However, Skolemization of monadic formulae will not produce clauses of the
form (*) because it replaces every existentially quantified variable with a function
of all variables it depends on. Since different variables are replaced by different
Skolem terms with different Skolem functions and the same variable is always
replaced by the same Skolem term with the same arguments. Each of those ar-
guments represents the same variable that has been universally quantified over
the whole formula. Therefore they are unifiable regardless of renaming variables
given their predicate symbols are matching. If at some point this property is not
given any more, something went wrong and we have an inconsistency within our
calculus, because the same universally quantified variable changed to not being
universally quantified any more which is a contradiction with the soundness of
resolution and factoring.
Is it possible to express MON without Skolem functions?
As mentioned before, all arguments of a Skolem function represent dependencies
on universally quantified variables. These dependencies had not been visible as
obviously before. Since no predicate symbols with more than one argument are
being considered, the question arose whether it is possible to express the monadic
fragment without Skolem functions – meaning with Skolem constants only – or
else with monadic Skolem functions only. This has lead to an even more sim-
ple clausal class for the monadic fragment that has been investigated within the
scope of this project.
The monadic formula in Example 4.2 had already been given in conjunctive
normal form. Therefore, according to the miniscoping rules, it was not possible
to move the existential quantifier inwards over the conjunction. However, if we
transform the formula into disjunctive normal form before apply miniscoping, it
is no problem to move the existential quantifier inwards over the disjunction and
thereafter we can move it inwards over the conjunction of literals since every lit-
eral is monadic and therefore no dependencies remain. We will demonstrate this
for Example 4.2.
In transforming this formula we follow the steps of an algorithm that lead
non-functional monadic clauses. This main algorithm is:
38 CHAPTER 4. THE MONADIC FRAGMENT
1. Transformation of the formula into prenex normal form.
2. Transformation of the formula into disjunctive normal form.
3. Sorting the literals.
4. Miniscoping.
5. Transformation into clausal normal form
afterwards reduction rules can be applied, especially condensing. The key part
of this algorithm is its transformation into disjunctive normal form. According
to miniscoping rules we can now
Transformation into prenex normal form
A formula is in prenex normal form, if all of its quantifiers are in the beginning
of the formula. After transformation into prenex normal form the formula is of
the form (∀|∃)∗F where F is quantifier-free.
Example 4.2 is alreday the prenex normal form:
∀x∃y((¬P (x) ∨ P (y)) ∧ P (a) ∧Q(y))
⇒PNF ∀x∃y((¬P (x) ∨ P (y)) ∧ P (a) ∧Q(y))
Transformation into disjunctive normal form
A formula in disjunctive normal form is a disjunction of conjunctions. After
transformation into disjunctive normal form the formula is of the form (∀|∃)∗D1∨... ∨ Dn where each D1, ..., Dn is a conjunction of literals. This transformation
needs to be done in preparation to moving the ∃y further inside.
⇒dnf ∀x∃y((¬P (x) ∧ P (a) ∧Q(y)) ∨ (P (y)) ∧ P (a) ∧Q(y)))
4.1. INVESTIGATION OF CLAUSAL CLASSES 39
Sorting the Literals
In preparation for miniscoping we need to make sure that all literals that belong
to the same conjunction and have the same variable as their argument are placed
next to each other. This can always be done by sorting those literals and is valid
due to the commutativity of conjunctions. This leads to the same formula as in
the previous step but now for all Di are of the form D = E1 ∧ ... ∧ Em and each
E1, ..., Em is a conjunction of literals with the same variable as their argument.
Since all predicate symbols are monadic, every E contains exactly one variable
of the clause and all Ei, Ej with i 6= j cover different variables.
For our example this means:
⇒min ∀x∃y(¬P (x) ∧ P (a) ∧Q(y)) ∨ ∃y(P (y) ∧ P (a) ∧Q(y))
⇒min ∀x∃y(¬P (x) ∧ P (a) ∧Q(y)) ∨ ∃y(P (y) ∧Q(y) ∧ P (a))
In this case this transformation step was not necessary, because ∃y(P (y)∧P (a)∧Q(y)) does not contain a universally quantified variable. But if it would have
contained a free variable x instead it would look like ∃y(P (y)∧P (x)∧Q(y)), the
quantifier could according to the miniscoping rules in Section 2.3 not be moved
further inward and y would still be dependent on x which would lead to a Skolem
function f(x). This can be resolved in the following way by switching P (x) and
Q(y).
⇒min ∃y(P (y) ∧ P (x) ∧Q(y))
⇒min ∃y(P (y) ∧Q(y) ∧ P (x))
⇒min ∃y(P (y) ∧Q(y)) ∧Q(x)
⇒min P (a) ∧Q(a) ∧Q(x)
Miniscoping
We can now apply the miniscoping rules to move the quantifiers inwards until
they only cover literals with the same variable. When we remember the miniscop-
ing rules, existential quantifiers can always be moved inwards over a disjunction.
It can also be moved inwards over conjunctions when the variable only occurs in
40 CHAPTER 4. THE MONADIC FRAGMENT
one part of the conjunction.
Let us assume that quantifier in the very right of the prefix is an existential
quantifier. It can then be moved inwards over the disjunction. Now it separately
covers each D that contains the quantified variable. This D is a disjunction of
subformulae E. Each E contains all literals of D that cover the same variable.
Therefore the existential quantifier can be moved inwards over the conjunction
to cover only that E that contains the quantified variable.
Let us now assume that the quantifier in the very right of the prefix is an
universal quantifier. Then all existential quantifiers in the formula have either al-
ready been moved inwards and therefore cover exactly one variable or they occur
on the left side in the prefix which means that the universally quantified variable
is bound in the scope of such quantifiers. Therefore all existential quantifiers are
independent of this universal quantifier and it can be dropped.
We can do this with each universal and existential quantifier on the very
right of the prefix until no quantifiers are left in the prefix. This leads to a for-
mula where every existential quantifier only covers literals with its own variable
as their argument. This also means that there are no free variables within the
scope of each universal quantifier. Therefore each existential quantified variable
is independent of all other variables and will be replaced by a Skolem constant.
Therefore, Skolem constants are sufficient to express the monadic fragment.
This has been done for our Example 4.2:
⇒min (∀x¬P (x) ∧ ∃yQ(y) ∧ P (a)) ∨ (∃y(P (y) ∧Q(y)) ∧ P (a))
⇒min (¬P (x) ∧Q(b) ∧ P (a)) ∨ (P (c) ∧Q(c) ∧ P (a))
As described, no Skolem functions are needed. All dependencies have been ex-
pressed by replacing same variables by same Skolem constants.
4.1. INVESTIGATION OF CLAUSAL CLASSES 41
Transformation into CNF
Afterwards we need to transform the formula back into clausal normal form which
requires a transformation into conjunctive normal form. This gives us monadic
non-functional clauses.
Example 4.2 gives these clauses:
1. ¬P (x) ∨ P (c)
2. ¬P (x) ∨Q(c)
3. ¬P (x) ∨ P (a)
4. Q(b) ∨ P (c)
5. Q(b) ∨Q(c)
6. Q(b) ∨ P (a)
7. P (a) ∨ P (c)
8. P (a) ∨Q(c)
9. P (a) ∨ P (a)
Obtained Clauses
If we now apply factoring and subsumption deletion to the clauses in conjunctive
normal form to get a reduced set of clauses. Thus we obtain our final non-
functional set of clauses.
The reduced set of clauses for Example 4.2 is:
1. ¬P (x) ∨ P (c)
2. ¬P (x) ∨Q(c)
3. Q(b) ∨ P (c)
4. Q(b) ∨Q(c)
5. P (a)
42 CHAPTER 4. THE MONADIC FRAGMENT
This particular set of clauses is already saturated, meaning no further inferences
can be taken. Generally, this may not always be the case, though the clauses are
always simple enough for unrestricted resolution to form a decision procedure.
This technique can be applied to every monadic formula by following this
algorithm. Through this transformation every existentially quantified variable
can be replaced by a Skolem constant. Consequently, no Skolem functions are
needed at all and therefore no real function symbols are needed to represent the
monadic class. Accordingly we can define the simplified clausal class C ′MON for
the monadic fragment.
Definition 4.4. A clause C belongs to the simplified clausal class C ′MON of the
monadic fragment if it fulfils the following two conditions:
1. All predicate symbols in C have maximal arity 1.
2. All function symbols in C are constants.
All clauses C ∈ C ′MON can be represented in the following form:
C := L(a1) ∨ . . . ∨ L(an) ∨ L(x1) ∨ . . . ∨ L(xm)
with L being any unary predicate symbol or possibly a predicate symbol of arity
zero in which case the argument ceases to apply. All ai are constants or Skolem
constants and all xj are variables.
During this example we were able to see that the number of clauses grows
exponentially through the transformation from disjunctive normal form into con-
junctive normal form. This is necessary however, since resolution operates upon
conjunctions of disjunctions. It is also not possible to skip this step and simply
replace every existentially quantified variable with a constant. This is because
we could not discern which ones need to be the same and which ones need to be
different and this does effect the meaning of the formula.
Transforming formulae in the monadic fragment in the way described into
clauses belonging to C ∈ C ′MON is exponential in space and time. Tests described
in Section 6.4. have shown that all tested examples of the monadic fragment
are already solved very fast by SPASS. The costly transformation into clauses in
4.1. INVESTIGATION OF CLAUSAL CLASSES 43
C ′MON did not seem to make beneficial improvements and has for this reason not
been implemented.
Implementing this algorithm in SPASS would probably mean to add some
functionality. I have only seen transformations into anti-prenex form and not
seen any transformation into prenex-form. It should however be very similar and
the code for transformation into anti-prenex form could probably be duplicated
and modified. The same applies for disjunctive normal form. There is definitely a
transformation into conjunctive normal form but I am not sure if there is one for
disjunctive normal form as well. It might have to be implemented, but it would
be very similar.
The last part, meaning miniscoping, transformation into clausal normal form
and reduction rules are already implemented and and are used as a default. When
a formula is transformed by into disjunctive prenex normal form and literals are
sorted, the described clauses should be obtained. If not, some flags would have to
be changed that prevent SPASS from changing the input clauses before Skolem-
ization.
The remaining part that needs to be implemented is the sorting of literals.
In order to do this the formula needs to be restructured. A function could be
implemented that sorts a block of conjuncted literals. Since literals are saved
in a list, a normal sorting algorithm can be applied. First, we can consider the
variable in the last literal to be biggest. Then we look through the list and move
all other literals with the same variable to the end of the list. Afterwards, the
literal immediately left to those already sorted literals can be considered to be
biggest in the remainder of the literals. The same algorithm applies until the
literals are sorted.
Splitting
Another way to simplify clauses is splitting. By the means of splitting, one clause
is divided into multiple variable disjoint subclauses. In order for the clause to
be true, one of those new subclauses needs to be true. The following example
demonstrates this. Two clauses have been added to the previous example, because
44 CHAPTER 4. THE MONADIC FRAGMENT
the previous example already had only one variable per clause. Therefore splitting
would not make a difference.
1. ¬P (x) ∨ P (f(x))
2. Q(f(x))
3. P (a)
4. ¬Q(x) ∨R(y)
5. Q(x) ∨R(z)
Splitting transforms the set of clauses into a tree-like splitted clauses structure:
1. ¬P (x) ∨ P (f(x))
2. Q(f(x))
3. P (a)
�����
HHH
HH
4. ¬Q(x)
���
HHH
5. Q(x) 5. R(z)
4. R(y)
���
HHH
5. Q(x) 5. R(z)
In this manner the structure of the proof divides itself into multiple branches,
where each branch represents a simplified version of the original clauses set. In
order for a formula to be unsatisfiable, it must be shown that each branch results
into a contradiction. In order to show that a formula is satisfiable, it suffices to
show that one of the branches is satisfiable.
Our clausal classes CMON and C ′MON that have been defined within this section
can be simplified into the following clausal classes when splitting is used. C ′MON
can be simplified even more significantly than CMON . After splitting there are
more different types of clauses in each class, but all of them have reduced com-
plexity. The benefits of splitting for the monadic fragment have been discussed
in Section 6.3.
Definition 4.5. Let CsplitMON be the clausal class for the monadic fragment that
results from the clauses in CMON with full splitting. Then all clauses C ∈ CsplitMON
4.2. CLASS RECOGNITION 45
are of the form:
C :=
1.) L ∨ ... ∨ L
2.) L(a) ∨ ... ∨ L(a)
3.) L(x) ∨ ... ∨ L(x)
4.) L(f1(x1)) ∨ ... ∨ L(fk(xk)) ∨ L(x1) ∨ ... ∨ L(xn)
where L(s) is any unary literal with argument s1, L is a propositional literal, x is
a variable, a is a constant or Skolem constant and all x1, ..., xn are variables with
x1, ..., xn ∈ {x1} ∪ ... ∪ {xk}.
Definition 4.6. Let Csplit′
MON be the clausal class for the monadic fragment that
results from the clauses in C ′MON with full splitting. Then all clauses C ∈ Csplit
′
MON
are of the form:
C :=
1.) L ∨ ... ∨ L
2.) L(a) ∨ ... ∨ L(a)
3.) L(x) ∨ ... ∨ L(x)
where L(s) is any unary literal with argument s, L is a propositional literal, x
represents a variable and a represents a constant, which may possibly be a Skolem
constant.
4.2 Class Recognition
A clause C belongs to the clausal class CMON of the monadic fragment if the
following properties are fulfilled:
1. C is simple (C has a maximal term depth of 1).
2. All predicate symbols in C have maximal arity 1.
3. All function symbols in C are either constants or Skolem functions.
The implementation of class recognition for the monadic fragment in SPASS
has been simple because SPASS already supports all the necessary functions to
1This notation has been introduced in (Schmidt, 2011).
46 CHAPTER 4. THE MONADIC FRAGMENT
check whether all clauses fulfil the properties of belonging to the monadic clausal
class.
There is a loop within the analysis part of SPASS where all clauses are anal-
ysed. The analysis for monadic clauses has been added there. By doing so it was
possible to follow the same structure that Harbit (2012) used to extend SPASS
with class recognition for decidable fragments. This was very helpful and should
also be a good point of reference for future implementations of additional decid-
able fragments.
SPASS provides a function that checks whether a formula contains non-constant
function symbols. Its value is stored in the flag ana FUNCTIONS. There
are also flags that contain information about occurrence of non-ground monadic
predicate symbols and non-ground n-place predicates with n > 1, but no method
existed yet to check whether every predicate symbol is monadic. So I imple-
mented a function MON condition that checks whether every literal in a clause
is monadic, regardless of whether it is ground or not.
Therefore this function had to be added. It goes through all the literals in
a clause and checks whether they have a maximal arity of one. This function,
together with the functionality which is already provided by SPASS, then allowed
to check for every clause of the formula whether it fulfils all conditions to belong
to the monadic clausal class. The flag flag MON signalizes whether a formula
belongs to the monadic class or not. In the beginning it is set to true, and when
any of the clauses is not monadic, it is set to false.
The only difference between CMON and CMON ′ is that CMON ′ does not contain
Skolem functions. Class recognition must therefore check whether all clauses have
maximal term depth zero instead of maximal term depth one.
CsplitsMON and Csplits′
MON are the clausal classes that result from clauses in the classes
CMON and C ′MON with full splitting. Other than that they have the same require-
ments. When full splitting is enabled, there are only fully splitted clauses. This
means that we can use the same class recognition when full splitting is enabled
because the same properties need to be checked.
4.3. DECISION PROCEDURE 47
4.3 Decision Procedure
All clauses C ∈ CMON can be represented in the following form:
C := L(a1) ∨ . . . ∨ L(an) ∨ L(x1) ∨ . . . ∨ L(xm) ∨ L(f1(y1)) ∨ ... ∨ L(fN(yN))
A decision procedure for a clausal class is necessarily also a decision proce-
dure for all of its subclasses. CMON is the most general clausal class that we have
defined for the monadic fragment. The clauses of all other clausal classes that
we defined in this chapter also belong to CMON because they were the result of
additional restrictions. It is therefore sufficient to define and proof a decision
procedure for CMON .
As we remember from Section 2.5, to form a decision procedure for CMON , we
need to define a set of inference rules R such that:
1. CMON is closed under R
2. CMON is finitely bounded
Though simple, the monadic fragment can not generally be decided by resolution
on its own. An ordering is necessary to provide a decision procedure. Our example
of a monadic formula demonstrates how unordered resolution can lead to infinitely
many inferences.
1. ¬P (x) ∨ P (f(x)) (given)
2. Q(f(x)) (given)
3. P (a) (given)
4. P (f(a)) (Res 1.1, 3.1)
5. P (f(f(a))) (Res 1.1, 4.1)
6. P (f(f(f(a)))) (Res 1.1, 5.1)
...
48 CHAPTER 4. THE MONADIC FRAGMENT
In this example we can see the term depth growing in each clause derived in con-
secutive steps. Clause 4 is already outside of our clausal class CMON , therefore
CMON is not closed under unrestricted resolution. It also would not help to ex-
tend our clausal class in a way that it can contain clauses clauses of deeper term
depth than 1, because it would not be finitely bounded any more when clauses
of every term depth can occur.
Growing term depth can be prevented, when literals with term depth 1 are
greater in the ordering than literals with term depth 0. When applied within our
example from above, this would look as follows:
1. ¬P (x) ∨ P (f(x)) (given)
2. Q(f(x)) (given)
3. P (a) (given)
Suppose the underlined literals are maximal under the ordering. Then this set
of clauses is already saturated under ordered resolution, since all the maximal
literals are positive.
To define a decision procedure for the monadic fragment, we need an ordering
by term depth such that one of the literals with maximal term depth is maximal.
It would also be desirable to have an ordering by function arity, such that one of
the literals with maximal function arity is maximal.
The Knuth-Bendix Ordering (Knuth & Bendix, 1970) is already implemented
in SPASS and can be used for ordered resolution. It has the following properties:
1. ordering by term depth
2. ordering by function arity
when its parameters for function symbol weight and variable symbol weight are
set to the same value.
4.3. DECISION PROCEDURE 49
The calculus consisting of the inference rules resolution with ordering KBO
and ordered factoring forms a decision procedure for the monadic fragment. The
proof thereof is given in Section 4.4. Its soundness and completeness are guaran-
teed because it only uses standard inference rules in SPASS.
We can also use various reduction rules to fasten the proof search. The one of
them which is essential to termination is condensing. It ensures that every literal
occurs uniquely within its clause. Without condensing the clausal classes would
not be finitely bounded, because one literal could appear arbitrary many times
in each clause and therefore cause infinitely many possible clauses which are in
essence all the same.
In a nutshell, we need ordered resolution with ordering KBO with function
and variable weight set to 1 and factoring to form a decision procedure for MON.
Nothing needs to be considered during transformation into clausal normal form,
we can use splitting to obtain clauses of the form CsplitMON and without it we obtain
clauses of the form CMON . As a reduction rule we need condensing. All of this
is already implemented in SPASS and can be activated by the corresponding flags.
To define a decision procedure for the monadic fragment in SPASS, the fol-
lowing flags have been activated:
• ordered resolution (flag IORE) has been activated with the ordering (flag
ORD) set to KBO with function weight (flag FUNCWEIGHT) and variable
weight (flag VARWEIGHT) set to 1.
• positive factoring (flag IOFC to FACTORINGONLYRIGHT)
• Condensing (flag CNFCON) has been switched on. Other reduction rules
have been activated as well.
• For splitting two options have been tested, full splitting (flag SPLITS to
UNLIMITED) or no splitting (flag SPLITS to OFF).
50 CHAPTER 4. THE MONADIC FRAGMENT
4.4 Proof of Decision Procedure
Theorem 4.7. : Let Res� denote the resolution calculus with a Knuth-Bendix
Ordering, ordered positive factoring and subsumption deletion. Then Res� forms
a decision procedure for the monadic fragment, which can be shown by showing:
1. CMON is closed under Res�, i.e. for any Res�-inference C1...Cn
C, we have
C ∈ CMON when each C1, ..., Cn ∈ CMON .
2. CMON is finitely bounded. For this it suffices to show that given a finite
number of predicate and function symbols only finitely many non-variant
clauses belong to CMON .
Proof of Property 1.) CMON is closed under Res�, because the ordering
restricts resolution to the use of maximal literals. In Chapter 25 of the Handbook
of Automated Reasoning Fermuller et al. (2001) give a decision procedure of the
monadic fragment with a similar ordering. In order for CMON to be closed, we
need to show that the properties for class recognition remain true for clauses
produced by Res�. Those properties were:
1. C is simple (C has a maximal term depth of 1).
2. All predicate symbols in C have maximal arity 1.
3. All function symbols in C are either constants or Skolem functions.
The last two properties always remain fulfilled because neither resolution nor
factoring add new predicate symbols to clauses. Thus no function symbols are
added and all predicate or function symbols remain monadic. Regarding the max-
imal term depth we need to consider both resolution and factoring steps upon
the clauses in CMON . In the following reasoning, C and D will always represent
monadic clauses. For resolution, there are three possible cases:
case 1: Resolution between two literals of term depth 1. Let P (f(x1, ..., xn)) be
maximal in C and ¬P (f(y1, ..., yn)) be maximal in D and let resolution be
applicable between the two. Then resolution results in:
C ∨ P (f(x1, ..., xn)) ¬P (f(y1, ..., yn)) ∨D(C ∨D)σ
4.4. PROOF OF DECISION PROCEDURE 51
With σ = {x1/y1, ..., xn/yn}. C and D are monadic and have maximal term
depth 1. Since σ does not increase term depth, the resolvent has maximal
term depth 1 and belongs to CMON .
case 2: Res� between two literals of term depth 0. Let P (xn) and ¬P (yn) be
two unifiable literals that are maximal in C and D. Since no literal can
have greater term depth and thus be greater than the maximal literal, both
C and D must have term depth 0. Then resolution between the clauses
looks like this:
L(x1) ∨ ... ∨ L(xn−1) ∨ P (xn) ¬P (yn) ∨ L(yn−1) ∨ ... ∨ L(y1)
(L(x1) ∨ ... ∨ L(xn−1) ∨ L(yn−1) ∨ ... ∨ L(y1))σ
Again, σ = {xn/yn} does not increase term depth and thus the inference
has term depth 0 and belongs to CMON . In this case each xi, yi can be a
constant or variable.
case 3: The third case between one literal of term depth 0 and one literal of
term depth 1 is a bit more interesting, because σ actually does increase
term depth in this case. Let P (x) be maximal in C and ¬P (f(y1, ..., yn))
be the maximal literal in D. Then C has term depth 0 and D has maximal
term depth 1 according to their maximal literals. Then resolution results
in:
C ∨ P (x) ¬P (f(y1, ..., yn)) ∨D(C ∨D)σ
In this case, σ = {x/f(y1, ..., xn)} does increase term depth. Since both
clauses need to be variable disjoint, x only occurs in C ∨L(x). C has term
depth 0, therefore Cσ has term depth 1 if x occurs in C and term depth
0 otherwise. x does not occur in D, therefore the maximal term depth
of D and of the resolvent as a whole remains 1. The same applies when
negation occurs the other way around and ¬P (x) and P (f(y1, ..., yn)) are
the maximal literals in the clauses.
In a similar manner, there are three cases for ordered factoring:
case 1: Ordered positive factoring between two literals of term depth 1. Let
P (f(x1, ..., xn)) and P (f(y1, ..., yn)) be maximal in C and unifiable. Thus
52 CHAPTER 4. THE MONADIC FRAGMENT
C has maximal term depth 1. Then the inference is
C ∨ P (f(x1, ..., xn)) ∨ P (f(y1, ..., yn))
(C ∨ P (f(x1, ..., xn)))σ
with σ = {x1/y1, ..., xn/yn}. Since σ does not increase term depth of C ,
like the resolvent, the clause obtained still has maximal term depth 1.
case 2: Ordered positive factoring between two literals of term depth 0. Let
P (x) and P (y) be maximal in C and unifiable. Therefore C has term depth
0 because otherwise literals of term depth 0 would not be maximal. Then
the inference isC ∨ P (x) ∨ P (y)
(C ∨ P (x))σ
with σ = {x/y}. Since σ does not increase term depth and C has term
depth 0, the conclusion has term depth 0.
case 3: Ordered positive factoring between a literal of term depth 0 and a literal
of term depth 1 is not possible, because both literals would need to be
maximal, but literals of term depth 1 are always greater than literals of
term depth 0, which is a contradiction.
Proof of Property 2.) We have to show that CMON is finitely bounded,
meaning that given a finite number of predicate and function symbols only finitely
many non-variant clauses exist in CMON . We can count the maximal number of
different literals that can occur in a clauses:
CMON := L(a1) ∨ . . . ∨ L(an) ∨ L(x1) ∨ . . . ∨ L(xm) ∨ L(f1(y1)) ∨ ... ∨ L(fN(yN))
type 1: Literals with constants as argument occurring in L(a1) ∨ . . . ∨ L(an).
Let np be the number of predicate symbols and let nc be the total number
of constants, then np ∗ nc is the maximal number of different combinations
of predicate symbols and constants and therefore the maximal number of
different literals of this kind.
type 2: Literals with Skolem functions as argument occurring in L(f1(y1))∨ ...∨
4.4. PROOF OF DECISION PROCEDURE 53
L(fN(yN)).
Let np be the number of predicate symbols and let nf be the number of
function symbols, then there are np ∗nf different combinations of predicate
symbols and function symbols. All of the same Skolem functions originally
result from the same existentially quantified variable they represent. Each
argument represents the same universally quantified variable. Therefore
these arguments are always unifiable. If they were not, the same univer-
sally quantified variable over the whole formula would not be universally
quantified any more. This is a contradiction to the soundness of resolu-
tion and factoring, two equal predicate symbols in a clause with the same
Skolem function either already have the same variables as arguments or are
unifiable. This makes np ∗ nf the maximal number of different literals of
this type.
type 3: Literals with variables as argument occurring in L(x1) ∨ . . . ∨ L(xm).
Let np be the number of predicate symbols and |x| = |y1 ∪ ... ∪ yN | the
number of all variables that occur in the function symbols of the current
clause, but 1 as a minimum. Then np ∗ |x| is the maximal number of differ-
ent literals of this type, because all others could be unified.
Altogether,
np ∗ nc + np ∗ nf + np ∗ |x|
is the maximal number of different literals in a clause. If one clause C contains
all the literals of another clause D, it can be subsumed by the smaller clause C,
since Cσ ⊂ D. Therefore redundant clauses that contain the same literals as
another clause plus duplicate literals, can be deleted. It follows that the total
number of clauses that can be constructed out of a limited number of literals is
limited.
Lemma 4.8. Unordered resolution and factoring form a decision procedure for
C ′MON .
54 CHAPTER 4. THE MONADIC FRAGMENT
Proof. C ′MON is the subset of CMON that only contains monadic clauses with
term depth zero. Therefore, since CMON is finitely bounded, it follows that C ′MON
is finitely bounded as well.
Closure of C ′MON under Res also follows from the proof for CMON . Since only
clauses with term depth zero occur, only case 2 of resolution and factoring is
possible. Both cases result in a monadic clause with term depth 0 for every two
literals that can be unified and factored or resolved upon. The result therefore
also belongs to C ′MON when no ordering has been used. C ′
MON is therefore closed
under Res. This means that Res is a decision procedure for C ′MON .
Theorem 4.9. With the weights of function symbols and variable symbols both
set to 1 and let x1, ..., xn be variables, then the the following properties hold for
the Knuth-Bendix Ordering:
1. Ordering by term depth:
For all terms s, t it holds that s �kbo t if s is of the form f(x1, ..., xn) and t
is of the form xi for all i ∈ {1, ..., n}.
2. Ordering by function arity:
For all terms s, t it holds that s �kbo t if s is of the form f1(s1, ..., sn) and t
is of the form f2(t1, ..., tm), with n > m and no variable occurs more often
in f2(t1, ..., tm) than in f1(s1, ..., xs).
Definition 4.10. Knuth-Bendix Ordering. The formal definition of the Knuth-
Bendix Ordering as given by Weidenbach (2001) is the following:
If f, s are terms, then t �kbo s if occ(x, t) ≥ occ(x, s) for every variable x ∈(vars(t) ∪ vars(s)) and
4.4. PROOF OF DECISION PROCEDURE 55
(1) weight(t) > weight(s) or
(2) weight(t) = weight(s) and t = f(t1, ..., tk) and s = g(s1, ..., sl) and
(2a) f > g in the precedence or
(2b) f = g and
(2b1) status(f) = left and (t1, ..., tk) >lexkbo (s1, ..., sl) or
(2b2) status(f) = right and (tk, tk−1, ..., t1) >lexkbo (sl, sl−1, ..., s1)
Proof for Property 1.) Let s, t be s := f(x1, ..., xn) and t := xi. Then it is
easy to see that
weight(f) +i−1∑j=1
weight(xj) + weight(xi) +n∑
j=i+1
weight(xj) > weight(xi)
since all weights are positive and in our case non-zero. Therefore weight(s) =
1 +n > weight(t) = 1. It is also easy to see that every variable occurs equally or
more often in t than in s. Therefore according to definition f(x1, ..., xn) �kbo xifor all i ∈ {1, ..., n}.
Proof for Property 2.) Let s, t be s := f1(x1, ..., xn) and t := f2(x1, ..., xm)
with n > m and no variable occurs more often in t than in s. Then∑n
i=1weight(xi) >∑mi=1weight(xi) follows from n > m and since we said that all functions have the
same weight 1, also
weight(f1) +n∑i=1
weight(xi) > weight(f2) +m∑i=1
weight(xi).
holds. Therefore weight(s) = 1+n > weight(t) = 1+m and thus f1(x1, ..., xn) >kbo
f2(x1, ..., xm) for all such terms s, t.
Chapter 5
The Guarded Negation Fragment
The second part of the project focuses on the guarded negation fragment which is
an active area of research. The guarded negation fragment has been proven to be
decidable Barany et al. (2011), but thus far no implemented decision procedure
is known to us. Extending SPASS in a way that it recognizes the guarded nega-
tion fragment and calls a suitable decision procedure will guarantee a solution for
all problems that belong to this class and therefore also improve SPASS. From
the scientific perspective this would be interesting because it would be the first
implemented decision procedure for this fragment.
As mentioned before we will consider the guarded negation fragment without
equality. This decision has been made to reduce complexity and allow more
time to finding a decision procedure. Therefore we will refer from now on to the
definition of the guarded negation fragment as follows:
Definition 5.1. A formula ϕ belongs to the guarded negation fragment without
equality if:
ϕ ::= R(x) | ∃xϕ | ϕ ∨ ϕ | ϕ ∧ ϕ | α(xy) ∧ ¬ϕ(y)
where R(x) and α(xy) are unnegated atoms and α(xy) functions as a guard which
has all freely in ϕ(y) occurring variables as arguments.
Example 5.2. An example for a guarded negation formula is:
∃z(R(z) ∧ ¬∃x1, x2(Q(x1, x2) ∧ (Q(x1, z) ∧ ¬∃yP (x1, z, y))))
The literals R(z) and Q(x1, z) are the guards. Its structure is easier to see when
56
57
it is written as a formula tree:
∃z
∧
�����
HHHH
H
R(z) ¬
∃x1, x2
∧
�����
HHH
HH
Q(x1, x2) ∧���
HHH
Q(x1, z) ¬
∃y
P (x1, z, y)
Figure 5.1: Structure of an Example GNF formula
Barany et al. (2011) showed that the guarded fragment can be expressed by
the guarded fragment. Therefore the clausal class of the guarded negation frag-
ment can be expected to contain the clausal class of the guarded fragment.
In the following, we will describe another fragment that the guarded negation
fragment is able to express and that therefore needs to be contained in the clausal
class of the guarded negation fragment. It is motivated by the following definition
included in the guarded negation fragment:
¬α ∧ ¬ϕ
Where ϕ is any positive existential formula, meaning a existentially quantified
formula that consists out of positive literals connected by ∨ and ∧.
Definition 5.3. The definition of the fragments of first-order logic φ+ and its
58 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
negation φ− can be given as:
φ+ := R(x) | ∃xϕ | φ+ ∨ φ+ | φ+ ∧ φ+
φ− := ¬R(x) | ∀xϕ | φ− ∨ φ− | φ− ∧ φ−
where R(x) is a positive atom. φ+ is a subset of the guarded negation frag-
ment. The negation of a formula can be obtained by negating all of its literals,
operators and quantifiers. Therefore the negation of any formula in φ+ belongs
to φ− and vice versa.
Lemma 5.4. For all first-order logic formulae ϕ it holds that
ϕ ∈ φ+ ⇒ ¬ϕ ∈ φ−and
ϕ ∈ φ− ⇒ ¬ϕ ∈ φ+
Using these definitions the general representation of a guarded negation for-
mula
¬α ∧ ¬φ+
can be transformed to
¬α ∧ φ−
As a result all clauses that are necessary to express any formula in φ− are also
expected to belong to the clausal class of the guarded negation fragment, because
¬α ∧ φ− belongs to the guarded negation fragment and α and φ− are connected
with a conjunction which results in different clauses and there are no further
restrictions on φ−. The fragment φ− results in clauses C with the following
properties:
• C is non-functional
• all literals in C are negative
It is therefore possible that these clauses can appear in the clausal class of the
guarded negation fragment.
5.1. THEORETIC INVESTIGATION 59
5.1 Theoretic Investigation
In the beginning some examples of guarded negation formulae were created and
transformed by hand into clausal normal form but no specific pattern was recog-
nized. As a reference it was helpful to read about the guarded fragment because
example formulas and its clausal class and decision procedure are available. This
helped to gain a basic understanding of the definition of the guarded negation
fragment and gave an outlook of how its clausal class and decision procedure
could look like. Since the guarded negation fragment extends the guarded frag-
ment it was known that the clausal class of the guarded fragment will also extend
the clausal class of the guarded negation fragment.
In general, structural transformation is a good tool to create a clausal class
because it helps to preserve the syntactic structure and properties of a formula as
has been described by M. Baaz & Leitsch (2001) and Nonnengart & Weidenbachh
(2001).
First, full structural transformation has been investigated. Full structural
transformation means that a new predicate symbol is introduced for every sub-
formula which is more complex than a literal or atom. When exhaustively applied
to the guarded negation fragment structural transformation results in the follow-
ing clauses:
60 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
(Clauses obtained by Structural Transformation of Guarded Negation Formulae)
∃xϕ(x, x) 1.) ¬Qϕ(x, x) ∨Q∃(x) X
2.) Qϕ(x, f(x)) ∨ ¬Q∃(x) X
ϕ1(x1) ∨ ϕ2(x2) 3.) ¬Qϕ1(x1) ∨Q∨(x)
4.) ¬Qϕ2(x2) ∨Q∨(x)
5.) Qϕ1(x1) ∨Qϕ2(x2) ∨ ¬Q∨(x) X
ϕ1(x1) ∧ ϕ2(x2) 6.) ¬Qϕ1(x1) ∨ ¬Qϕ2(x2) ∨Q∧(x) (X)
7.) Qϕ1(x1) ∨ ¬Q∧(x) X
8.) Qϕ2(x2) ∨ ¬Q∧(x) X
α(xy) ∧ ¬ϕ(y) 9.) ¬α(xy) ∨Qϕ(y) ∨QGN(xy) X
10.) α(xy) ∨ ¬QGN(xy) X
11.) ¬Qϕ(y) ∨ ¬QGN(xy) X
In the context of the conjunction and disjunction, x denotes a sequence of vari-
ables such that V (x) = V (x1) ∪ V (x2). This means that x contains all variables
that appear in x1 and in x2. The new predicate symbols have been been named
after the subformula they represent. For example, Qϕ represents ϕ, Q∧ repre-
sents a conjunction and QGN represents a guarded negation and so forth. If the
subformula ϕ is an atom R, no predicate symbol Qϕ is introduced and R takes
the place of Qϕ in the clause.
The guarded negation formula has been defined as the formula that can be
constructed out of subformulae of the kind R(x), ∃xϕ(x, x), ϕ1(x1) ∨ ϕ2(x2),
ϕ1(x1)∧ϕ2(x2) and α(xy)∧ϕ(y). For this reason, the clauses that have been de-
rived from these subformulae describe the general form of all clauses that can be
derived form guarded negation formulae when this technique of structural trans-
formation is used. In practice however, each subformula should to be replaced by
5.1. THEORETIC INVESTIGATION 61
a unique, fresh predicate symbol.
One of the properties that are essential to form a decision procedure is that
a clause contains a covering literal. When we look more closely at the clauses
obtained by structural transformation of guarded negation formulae, all of them
have covering literals. The covering literals of each clause have been marked by
underlining them. All negative non-functional covering literals can function as
guards. Actually, all clauses but three have such guards.
All clauses fulfil at least two of the conditions for guarded clauses. All of the
clauses are simple which means that they do not contain nested function sym-
bols. And all functions are covering which means that they contain all variables
of the clause as their arguments. For this reason, all clauses except for the clauses
without a guard belong to the guarded class. These clauses have been marked
with a check mark because a decision procedure for them is already known.
The question was whether we can extend the guarded class to form a superclass
that contains all clauses of the guarded negation fragment and guarded fragment.
For this purpose the remaining unguarded clauses needed to be investigated. One
of them is:
6.) ¬Qϕ1(x1) ∨ ¬Qϕ2(x2) ∨Q∧(x) (X)
This clause has a positive covering literal which is per definition not a guard.
But it also contains two negative literals. Since V (x) = V (x1)∪V (x2), those two
negative literals together contain all the variables that appear in x. This lead
to the idea, that those two negative literals could form a combined guard or set
of guards. When both literals are selected, they might have the same covering
properties as a guard that has only one literal.
This gave an idea of how the guarded class could be extended. We could allow
multiple negative guards that cover all variables that occur in the clause. More
precisely, all variables that occur in positive literals would be guarded in negative
literals. We would still require all clauses to be simple. Whether this changes
the decidability of the clausal class needed to be further investigated and proven,
but at least there seemed to be no major issues with it.
62 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
Let us consider the remaining unguarded clauses:
3.) ¬Qϕ1(x1) ∨Q∨(x)
4.) ¬Qϕ2(x2) ∨Q∨(x)
As has been said before, both of them do contain a positive covering literal. But
when this literal is chosen to be maximal, resolution is possible with one of the
guarded clauses such as:
8.) Qϕ2(x2) ∨ ¬Q∧(x)
A simple example can be given by:
1. ¬P (x, y) ∨Q(x, y, z) (given)
2. P (y, z) ∨ ¬Q(x, y, z) (given)
3. ¬P (x, y) ∨ P (y, z) (Res 1.2, 2.2)
As we can see, the resolvent has no guard and no covering literal at all. That
makes it very difficult to define a decision procedure. Let us now consider an
example for what happens when we decide to make the non-covering literal of
this clause maximal. We can then apply resolution with a matching clause of
type (2):
2.) Qϕ(x, f(x)) ∨ ¬Q∃(x)
Again, we can give a little example to demonstrate what can happen. In this
case, the non-covering literal has been selected and needs to be resolved upon:
1. ¬P (x, y, z) ∨R(x, y, z, w) (given)
2. P (x, y, f(x, y)) ∨ ¬Q(x, y) (given)
3. R(x, y, f(x, y), w) ∨ ¬Q(x, y) (Res 1.1, 2.1)
This results in a set of clauses, where the positive literal still contains all the vari-
ables of the clause, but it also contains a functional term which does not contain
5.1. THEORETIC INVESTIGATION 63
all the variables of the clause and is therefore non-covering. This is problematic,
because it could lead to an increase of term depth.
Initially, all such literals seem to be positive but this can change during the res-
olution step. For example, we can resolve upon clauses of the type (11). Clauses
of this type contain only negative literals, in particular one negative guard and
additional negative literals. This makes it possible to derive clauses that contain
negative functional literals. Resolution between two literals with non-functional
terms can lead to an increase of term depth when at least one of them is non-
covering.
All together we have shown that the clauses obtained by structural transfor-
mation are closely related to the guarded fragment. Most of the clauses already
are guarded clauses. Others belong to an extended set of the guarded class. But
some exceptions do not belong to the guarded class and inferences upon those
clauses lead to non-covering literals and possibly lead to increased term depth.
For these reasons the clauses that have been obtained by full structural transfor-
mation were not a good foundation for a decision procedure.
Interestingly, conjunctions are part of the guarded fragment and not restricted
in any way. Nevertheless it was the clauses obtained by structural transforma-
tion to a conjunctive subformula that caused a problem and did not belong to
the guarded class. Therefore, the structural transformation by which guarded
formulae are transformed into guarded clauses must be different to the structural
transformation we applied to the guarded fragment. Otherwise the same clauses
would be derived and they would have to be part of the guarded class.
The theoretic investigation continued by investigating more deeply how the
guarded fragment is transformed into clausal normal form to obtain guarded
clauses. This has been described in detail in Section 3.3 of the background part.
As a result of this research it became evident that the guarded fragment uses a
specific structural transformation to produce guarded clauses.
The structural transformation that has been describe by Ganzinger & Nivelle
(1999) renames only universally quantified subformulae. The guarded formula
64 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
is first transformed into NNF and then every universally quantified subformula
∀x(¬G ∨H) is replaced by new predicate symbols α(y) where y are all free vari-
ables that occur in ∀x(¬G∨H). The definition ∀xy(¬G∨α(y)∨H) of each new
predicate symbol is added to the formula. An example has been given in Section
3.3. This way the formula is transformed into guarded clauses.
It seemed likely that a similar method can be applied for the guarded negation
fragment to obtain a nice, decidable set of clauses. We will first investigate the
negation normal form of guarded negation formulae and then apply structural
transformation upon specific subformulae.
5.2 Negation Normal Form
The structural transformation to obtain guarded clauses is based on a formula
in its negation normal form. A formula is in negation normal form, when all of
its negations have been moved down until there are no negations left except for
immediately before an atom. The rules for this transformation can be found in
Section 2.3.
The investigation of guarded negation formulae in negation normal form showed
that every GNF formula follows a specific pattern of alternating subformulae. It
is a pattern of alternating negation quantifiers. This pattern is dependent upon
how many times a specific subformulae has been affected by negation with a
guard.
Definition 5.5. From now on we will refer to formulae ¬ϕ that have been negated
and guarded by a guard α in the manner of α ∧ ¬ϕ as being within the scope of
a guard α. All subformulae of ¬ϕ are also within the scope of α. The guard α
can be said to effect or negate every subformulae of ¬ϕ.
First, we will describe the pattern of negation within guarded negation for-
mulae. The guarded negation fragment requires negations to be guarded. Every
guard negates the subformula it guards. This means that in any guarded nega-
tion formula in its original form there are exactly as many negations as there are
guards. When those formulae are transformed into negation normal form, all of
5.2. NEGATION NORMAL FORM 65
∨∧
∃ ∧∨Positive
Negative
∧
α
∨
¬αPositive∧ ∨
∧
α
...
1x guarded∀
∃
∨∧Negative
∨
¬α
∀
2x guarded
3x guarded
unguarded
Figure 5.2: Structure of GNF Formulae in Negation Normal Form
66 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
these negations are moved down until they reach an atom. Then for each atom
the number of negations equals the number of guards it is effected by. Since two
negations cancel each other out, this leads to a formula which shows a clear alter-
nating pattern of negative and positive literals. Up to the first guard, all literals
are positive. Afterwards it depends upon the number of guards that effect the
literal:
Lemma 5.6. Within the scope of an even number of guards, all literals are pos-
itive. Within the scope of an odd number of guards, all literals are negative.
The same pattern applies to quantifiers. Initially only existential quantifiers
are allowed in a GNF formula and all universal quantifiers are the result of negated
existential quantifiers. After transformation into negation normal form the quan-
tifier is either universal or existential depending on how many times the quantifier
has been negated within the process of moving down all negations. Thus we can
see that the pattern of quantifiers in negation normal form goes along with the
pattern of the negated literals. Up to the first guard only existential quantifiers
occur. Later on, the type of quantifier depends on the number of guards it has
been effected by:
Lemma 5.7. All quantifiers are universal within the scope of an odd number of
guards and all quantifiers are existential within the scope of an even number of
guards.
Our Example 5.2 demonstrates this pattern in Negation Normal form:
∃yP (x1, z, y) is within the scope of two guards and therefore positive with an
existential quantifier. ¬Q(x1, x2) and ¬Q(x1, z) are found within the scope of
one quantifier and therefore negative literals. In the beginning of the formula we
find an existential quantifier within the scope of zero quantifiers and an universal
quantifier within the scope of one quantifier. All of this goes along with Lemma
5.6 and Lemma 5.7.
These patterns are clearly dependent on how many times the subformula has
5.3. STRUCTURAL TRANSFORMATION 67
∃z
∧
���
��
HHH
HH
R(z) ∀x1, x2
∨
���
��
HHH
HH
¬Q(x1, x2) ∨
����
HHH
H
¬Q(x1, z) ∃y
P (x1, z, y)
Figure 5.3: Structure of an Example GNF Formula in Negation Normal Form
been negated with a guard and they are independent of where and in which com-
bination guarded negation occurs in a formula.
This explicit pattern of negation and quantifiers has been helpful deciding a
more directed structural transformation strategy and allows us to draw conclu-
sions about the form and structure of guarded negation clauses.
5.3 Structural Transformation
Figure 5.4 describes the general form of guarded negation formulae with linearly
nested guards. This highlights the structure of subformulae when they are within
the scope of an even number or an odd number of guards. It also describes the
clauses into which each part of the formula can be transformed.
In Figure 5.4 each ellipse and each triangle represent a subformula which can
be build out of arbitrarily many of the logical connectives and quantifiers that
are written within it. The figure also includes a note whether the literals within
this subformula are positive or negative and whether the clauses obtained from
this subformula would be ground or whether they could contain function sym-
bols. If the formula in Figure 5.4 would continue in depth with nested guarded
68 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
∨∧
∀∀
∃ ∧∨Positive ground
Negative ground
Negative
∀
Negative
∧ ∧∨
∧
α
∨
¬αPositive∧ ∨
∃
Positive functional
∧ ∃
∨
∨ Positive functional
∧∨
∧
α
∨∧Negative functional
∃
∀∀
Negative
∀∧ ∧∨∨
Negative
∨
...
A
B
C
¬α
Ground clauses
Multi-guarded clauses
Guarded clauses
...
Figure 5.4: Visualization of a Structural Transformation Technique for GNFFormulae in Negation Normal Form
5.3. STRUCTURAL TRANSFORMATION 69
negations, the parts B and C would be continuously repeated. This would lead
to the sequence A, B, C, B, C, ...
In the following we will focus on the structure of clauses that can be obtained
from formulae that correspond to each of the parts A, B and C of the formula in
Figure 5.4.
Each GNF formula can be cut into subformulae of the types A, B and C.
This can be achieved by introducing a new predicate symbol for each uppermost
existential quantifier and each uppermost universal quantifier as shown by the
triangles in Figure 5.4. The cut has been indicated by a diagonal line on top of
the triangles.
This structural transformation strategy transforms any guarded negation for-
mulae into subformulae of three kinds:
1. ground clauses (from part A)
2. clauses with multiple guards (from part B)
3. guarded clauses (from part C)
Part A
Let us first consider part A of the original formula. Let Part A be defined as
the beginning of a GNF formula up to the first universal quantifier. This part of
a formula can always be obtained by renaming each uppermost subformula that
starts with an universal quantifier. Renaming replaces such subformulae with
a new predicate symbol whose arguments are all free variables of the replaced
formula. The definition of these new predicate symbols will be considered within
the discussion of formulae of part B. Within part A, the new predicate symbols
do not differ significantly from all other literals.
GNF formulae of the form A do not contain universal quantifiers. Since no
free variables are allowed in GNF formulae, all variables need to be existentially
quantified. This leads by the process of Skolemization to ground formulae.
70 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
If a GNF formula does not have guards at all, no negation occurs. This leads
to positive ground clauses. If it has guards then after renaming there are no uni-
versal quantifiers left within the scope of these guards. There can still be negative
literals. This leads to ground clauses with positive and negative literals.
Part B
Let us move on to part B of the original formula. Let part B be defined as sub-
formula of the original formula that begin with an universal quantifier and do not
contain any existential quantifiers. As has been said before, universal quantifiers
can only occur as negated existential quantifiers within the negation scope of a
guard. Thus they can not occur naturally in the beginning of a GNF formula.
Structural transformation needs to be applied to obtain formulae of the form B.
In part A we renamed each subformula that begins with an universal quan-
tifier. Such subformulae belong to part B. Later on we will see that they can
also be introduced in part C. We already replaced these subformulae with a new
predicate symbol. Now we need to introduce a definition for them.
In the following we will discuss the general instance of a subformula that be-
gins with an universal quantifier and that has been replaced by a predicate symbol
QB. We will refer to the replaced formula as FB. It can always be brought into
the form of B by renaming each uppermost subformula that starts with an exis-
tential quantifier. Then it belongs to part B because it begins with a universal
quantifier and does not contain existential quantifiers any more.
To introduce the definition of a renamed formula, it is usually necessary to
pay attention to the polarity of the renamed formula. Without equalities per-
mitted, the polarity describes whether the subformula occurs negated within the
context of the whole formula. Further details can be reread in Section 2.3. In the
beginning we transformed the whole GNF formula into negation normal form.
As a consequence the whole formula except for some literals is positive. We do
not rename literals, therefore we can always ensure positive polarity for struc-
tural transformation. The definition of QB is ∀x(QB(x)→ FB) which is equal to
∀x(¬QB(x) ∨ FB). As we will see, this definition is easy to categorize once we
5.3. STRUCTURAL TRANSFORMATION 71
established the structure of FB.
Formulae in part B begin with a universal quantifier. This means according
to Lemma 5.7 that our formula FB is placed within the scope of an odd number
of guards. This also means that all literals are negative unless further guards are
introduced. Therefore a formula of type B without guards contains only negative
non-functional literals. This also means that all occurrences of positive literals
need to be guarded.
Let us now evaluate the structure of formulae of part B. We already estab-
lished that formulae of part B have no existential quantifiers. Therefore there
will be no Skolem functions and the resulting clauses are non-functional. There
are, however, universal quantifiers, which means that the clauses will generally
not be ground.
There are two cases. In the beginning we are in the scope of an odd number of
guards. Therefore we can have universal quantifiers and all literals are negative.
This leads to negative non-functional clauses. There can also be guards. They
too will be negated and therefore of the form ¬α(xy) ∨ ϕ(y). The formula ϕ
then is necessarily within an even scope of guards. As soon as ϕ itself contains a
guard, we are back to case one within the scope an odd number of guards.
A formula within the scope of an even number of guards does only contain
positive literals. Within part B it also contains no quantifiers, because the quan-
tifiers would be existential quantifiers and therefore be eliminated by renaming.
The predicate symbols that are introduced by renaming are also positive and do
not differ significantly from the other positive literals. There are no quantifiers
within this part of the formula. Therefore all of its variables are freely occurring
variables and guarded by their respective guard. This guard is negative and per
definition non-functional. The guard α and the formula ϕ are connected by a
disjunction. This means that due to the distributivity law the guard is part of
all clauses that can be derived from ϕ. This leads to clauses in which all positive
literals are guarded a the negative non-functional literal, namely the guard ¬α.
Altogether we can say that formulae of part B lead to non-functional clauses
72 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
with negative literals in which all positive literals are guarded by at least one of the
negative literals. This has been verified by tests and examples. The structure of
the clauses remains the same for the definition ∀x(¬QB(x)∨FB) because it only
adds a negative literal to the clauses obtained by FB which is a formula of part B.
Part C
Finally we get to discuss part C of the original formula. Let part C be defined as
subformulae of the original formula that always begin with an existential quanti-
fier and contain no universal quantifiers. Universal quantifiers can be eliminated
by renaming in the same way as discussed in parts A and B. The major difference
to part A is that the formula can contain free variables. It is therefore usually
not ground. Another major difference is that formulae of part C do not occur
in the beginning of a GNF formula. They have been introduced by structural
transformation in part B.
5.3. STRUCTURAL TRANSFORMATION 73
Overall we have only existential quantifiers. Let bring the formula in prenex
form by moving all existential quantifiers to the beginning of the formula. Then
all existentially quantified variables will be replaced by Skolem functions with all
free variables as their arguments. This leads to a formula with covering Skolem
functions in which all variables are free variables.
Let us now consider the definition that needs to be introduced for a subfor-
mula FC of part C when it has been replaced by a new predicate symbol QC
within part B. Then the definition will be ∀x(QC(x) → FC(x)) which is equiv-
alent to ∀x(¬QC(x) ∨ FC(x)) where x are all free variables in FC . We already
established that after Skolemization only free variables remain in FC . Therefore
QC guards all variables in FC . QC and FC are connected by a disjunction, there-
fore due to the distributivity law QC will be as a guard in all clauses that can
be obtained from FC . Therefore clauses obtained from formulae in part C will
always be guarded clauses.
As a summary, subformulae of the first and last kind result in either ground
clauses or guarded clauses and therefore belong to the guarded class. subformu-
lae of the second kind result in clauses with multiple negative guards, where all
positive literals are guarded by at least one negative literal.
Another GNF Structural Transformation Strategy
We will now describe another way of doing structural transformation which is
easier to understand but more difficult to be implemented in SPASS. It results
in similar clauses to the structural transformation described and will be given in
order to validate the results.
This structural transformation strategy cuts the formula wherever there is
a guard such that all negative literals are together and all positive literals are
together with the negated guard. Figure 5.5 demonstrates, where the formula
needs to be cut.
If the guard occurs positively, which means there is a subformula α ∨ ϕ, the
guarded subformula ϕ is replaced by a new predicate symbol. Since the guard
74 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
is a positive literal, it is according to Lemma 5.6 within the scope of an even
number of guards and therefore the guarded subformula ϕ is within the scope of
an odd number of guards. It therefore contains only negative literals and univer-
sal quantifiers up to another guard. The predicate symbol Q that replaces this
formula is positive and occurs negatively in its definition ¬Q ∨ ϕ along with all
other negative literals. All guarded subformulae will be replaced by new nega-
tive predicates as described in the next paragraph. Therefore these subformulae
contain only negative literals and no existential quantifiers. This leads to clauses
with negative non-functional literals.
If the guard occurs negatively, the subformula ¬α(xy)∨ϕ(x) is replaced by a
new negative predicate symbol ¬Q(xy). The only freely occurring variables of the
formula are xy. Since the guard is a negative literal, according to Lemma 5.6 it
occurs within the scope of an odd number of guards, therefore ϕ(x) occurs within
the scope of an even number of guards and thus contains only positive literals and
existential quantifiers. After Skolemization all of the existential quantified vari-
ables have been replaced with Skolem functions that are dependent only of the free
variables xy. Therefore, after Skolemization the variables xy are the only vari-
ables that are left in the formula. Therefore the definition Q(xy)∨¬α(xy)∨ϕ(x)
of this predicate symbol results in guarded clauses.
5.3. STRUCTURAL TRANSFORMATION 75
∨∧
∃ ∧∨Positive
Negative
∧
α
∨
¬αPositive∧ ∨
∧
α
...
Negative non-func. clauses∀
∃
∨∧Negative
∨
¬α
∀
Guarded clauses
Ground clauses
Negative non-func. clauses
Figure 5.5: Visualization of a Structural Transformation Technique for GNFFormulae in Negation Normal Form
76 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
5.4 Guarded Negation Clauses
The clauses that have been obtained by the main structural transformation strat-
egy in Section 5.3 can be combined in the definition of multi-guarded clauses:
Definition 5.8. Multi-guarded clauses. A simple clause C is called multi-guarded
if every functional subterm in C contains all the variables of C, and, if C is non-
ground, C contains a set of non-functional negative literals such that each positive
literal is guarded in at least one negative literal of C, whereby guarded means
that the guarding literal contains all variables of the guarded literal.
Example 5.9. An example for a multi-guarded clause is:
¬Q(z) ∨ ¬P (v, w) ∨ ¬P (x, y) ∨R(v, w) ∨ ¬P (f(z, x, y, v, w), y) ∨Q(x)
At first sight the main difference to guarded clauses is the fact that multiple
literals together form a guard instead of a single negative literal as in Ganzinger
& Nivelle (1999):
Definition 5.10. Guarded clauses. A simple clause C is called guarded if every
functional subterm in C contains all the variables of C, and, if C is non-ground,
C contains a non-functional negative literal, called guard, which contains all the
variables of C.
An example of a guarded clause is:
¬P (x, y) ∨ ¬P (f(x, y), y) ∨Q(x)
As we can see, every guarded clause is also a multi-guarded clause where the set
of guarding negative literals consists of only one negative literal. Ground clauses
belong to both clauses classes.
Guarded clauses and clauses in which all literals are negative and non-functional
have been obtained by two different structural transformation strategies and they
correspond with the clauses we were expecting in the beginning. They are, how-
ever, not sufficient as a clausal class for the guarded negation fragment because
5.5. DECIDABILITY OF MULTI-GUARDED CLAUSES 77
a simple inference like
1. ¬P (x, y) ∨ ¬P (v, w) (given)
2. ¬Q(x′, y′) ∨ P (f(x′, y′), y′) ∨Q(x′) (given)
3. ¬Q(x, y′) ∨Q(x) ∨ ¬P (v, w) (Res 1.1, 2.2)
between two such clauses already results in a multi-guarded clause which contains
positive literals and does not belong to the guarded fragment.
Multi-guarded clauses contain both guarded clauses and negative non-functional
clauses as well as at least some of their inferences. We will now further investigate
the inferences between multi-guarded clauses.
5.5 Decidability of Multi-Guarded Clauses
In order to discuss the decidability of multi-guarded clauses, we will look at them
as a provisional clausal class for the guarded negation fragment. Then we will
try to define a set of inference rules R for this clausal class such that the multi-
guarded class is closed under R and finitely bounded. For this purpose it might
be necessary to adapt the definition of multi-guarded clauses and make it more
general to include all R-inferences while still being finitely bounded. If this does
not succeed, no decision procedure has been found and the clausal class as well
as the set of inference rules need further refinement and investigation.
Ordered Resolution with selection function based on the
Decision Procedure for Guarded Clauses
Multi-guarded clauses are an extension of guarded clauses. Therefore the decision
procedure of guarded clauses already decides this part of the clausal class. It can
be reviewed in Section 3.3. We will make an adjustment to see if this decision
procedure for the guarded fragment can be extended for multi-guarded clauses.
For now, the ordering will be left as it is, which is a lexicographic path ordering
based on a precedence f � c � p � tt. The selection function will be slightly
changed for the case of non-functional clauses in order to select all guards. The
78 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
change has been highlighted:
• If a clause is non-functional and contains a guard then all of its guards are
selected by Σ.
• If a clause contains a functional negative literal, one of these is selected.
• If a clause contains a positive functional literal, but no negative functional
literal, no literal is selected.
Concerning the non-functional negative literals that do not actively guard
positive literals or functional negative literals, we will try different selection func-
tions. First we will see what can happen when we select all of them as if every
one of them is a guard for itself.
The interesting part is to check is how inferences of non-functional multi-
guarded clauses with other multi-guarded or guarded clauses will look like. As
a first case we will look at ordered resolution between a non-functional multi-
guarded clause and a guarded clause that contains a positive functional literal.
Let us consider the following example:
1. ¬P (z, y) ∨ ¬P (y, x) ∨ P (x, x) (given)
2. ¬P (x′, y′) ∨ P (y′, f(x′, y′)) (given)
3. ¬R(x′′) ∨ P (x′′, f(x′′)) (given)
4. ¬R(x′′) ∨ ¬P (x′, f(x′′)) ∨ P (f(x′, f(x′′)), f(x′, f(x′′))) (Res 1.1,3.2),(Res 1.2, 2.2)
5. ¬R(x′′) ∨ ¬P (x′, f(x′′)) ∨ ¬P (x′, f(x′, f(x′′)))
∨ P (f(x′, f(x′, f(x′′))), f(x′, f(x′, f(x′′))) (Res 1.1, 4.2),(Res 1.2, 2.2)
...
This inference with σ = {y/f(x′′), y′/f(x′′), z/x′′, x/f(x′, f(x′′))} leads to in-
creased term depth. The resolved clause is also not multi-guarded. The next
inference with
σ′ = {y/f(x′, f(x′′)), y/f(x′, f(x′′)), x/f(x′, f(x′, f(x′′)))}
5.5. DECIDABILITY OF MULTI-GUARDED CLAUSES 79
shows that this resolution example can lead to infinitely many inferences. There-
fore our clausal class is not closed under ordered resolution under the selection
function we defined.
We can try to modify the selection function. In this example the increased
term depth can be avoided by selecting only the literal which is actively guarding
a positive literal. Then the same example leads to the following inference:
1. ¬P (z, y) ∨ ¬P (y, x) ∨Q(x) (given)
2. ¬P (x′, y′) ∨ P (y′, f(x′, y′)) (given)
3. ¬R(x′′) ∨ P (x′′, f(x′′)) (given)
4. ¬P (z, y) ∨ ¬P (x′, y) ∨Q(f(x′, y)) (Res 1.2, 2.2)
In this case the inference with σ = {y′/y, x/f(x′, y)} is again a multi-guarded
clause. But this does not generally need to be the case. It will be interesting
to further investigate this new selection strategy of selecting all negative literals
that are actively functioning as a guard. But the following example shows that
this selection strategy also does not always lead to multi-guarded clauses:
1. ¬P (x, y) ∨ ¬P (y, z) ∨Q(w) ∨ ¬P (z, w) (given)
2. ¬Q(x′) ∨ P (x′, f(x′)) (given)
3. ¬P (f(x), z) ∨ ¬P (z, w) ∨ ¬Q(x) ∨Q(w) (Res 1.1, 2.2)
4. ¬P (f(f(x)), w) ∨ ¬Q(f(x)) ∨Q(w) (Res 2.2, 3.1)
The first inference contains a negative non-functional literal which is not guarded.
This again leads in the second inference with σ = {x/f(x), z/f(f(x))} to an in-
ference with growing term depth and a positive literal that is not guarded. Thus
we can clearly see that the resolvent is not a multi-guarded clause.
We can also see that this example can lead to arbitrary term depth, but each
time we resolve upon a literal of clause 1. Clause 1 is a given clause with finitely
many literals. This means that this step can be done only finitely many times.
Therefore this example does not lead to infinitely many inferences.
80 CHAPTER 5. THE GUARDED NEGATION FRAGMENT
It still shows that it is problematic to define a resolution decision procedure
for multi-guarded clauses because so far this class has not been closed under
this resolution method. The question remains open whether there is a bigger
finitely bounded clausal class which contains the inferences made by this resolu-
tion method.
We can also see from the examples that every inference we made so far does
not fulfil the property any more that every functional term should contain all
variables of the clause.
Hyperresolution
Hyperresolution can be performed by selecting all negative clauses. It is no
decision procedure for guarded clauses as well as for multi-guarded clauses because
resolution between ground clauses and negative literals can lead to infinitely many
inferences. The following example demonstrates this:
1. P (a) (given)
2. ¬P (x) ∨ P (f(x)) (given)
3. P (f(a)) (Res 1.1, 2.1)
4. P (f(f(a))) (Res 2.1, 3.1)
...
Altogether this leads to the conclusion that the clausal class of multi-guarded
clauses is not closed under the inference systems that have been considered.
Therefore no decision procedure for the guarded negation fragment has been
found yet.
Chapter 6
Results and Findings
6.1 Testing Environment
The TPTP library is a big library of first-order logic problems. TPTP stands
for Thousands of Problems for Theorem Provers. Sutcliffe (2009) describes that
the problems have been collected with the intent to form an independent, large
collection of problems. This allows statistically relevant evaluation for all auto-
mated theorem provers and comparison among them. Since then it became the
standard library for the evaluation of automated theorem provers.
All large tests were supported by a high performance computing clusters CFS
and Redqueen. They are maintained by the University of Manchester. CSF has
6,288 cores and Redqueen has 624 cores. CSF is the largest high performance
computing cluster of the university.
For each problem a lot of information needed to be saved. First, the whole
SPASS output was saved. But this produced thousands of different files and it
was not even possible to copy those results from the server. This made it nec-
essary to store only the relevant information of the SPASS output, such as the
problem name, to which decidable classes it belongs, the result SPASS found and
how long it took to find the result. This information has been directly saved
into SQL statements by the batch script that runs the tests. This way the infor-
mation can be easily obtained from the server and stored into a data base. In
this case a MySQL database has been used. This made it easy to compare the
results of different versions of SPASS. The batch script is appended in Appendix
81
82 CHAPTER 6. RESULTS AND FINDINGS
class time limit solved by extension solved by basic total
PVD 500 sec 329 (93.7%) 305 (86.9%) 351200 sec 328 (93.4%) 303 (86.3%)
ESP1 500 sec 421 (75.9%) 408 (73.6%) 554200 sec 406 (73.3%) 401 (72.4%)
ESP+ 500 sec 446 (77.0%) 433 (74.8%) 579200 sec 431 (74.4%) 426 (73.6%)
BSH 500 sec 410 (94.0%) 410 (94.0%) 436200 sec 410 (94.0%) 409 (93.8%)
GC 500 sec 156 (98.1%) 156 (98.1%) 159200 sec 154 (96.9%) 154 (96.9%)
OCCI 500 sec 304 (95.3%) 304 (95.3%) 319200 sec 304 (95.3%) 303 (95.0%)
Table 6.1: Comparison of the Performance of the Basic Version of SPASS and itsExtension With Decision Procedures
A to this dissertation for anyone who wants to repeat the tests or for further tests.
6.2 Initial Tests
The first test was to repeat the tests of Harbit (2012) with a longer time frame of
500 seconds instead of 200 seconds to see whether further improvements will be
made. SPASS was run both with and without extension upon the whole TPTP
library version 5.3.0 as categorized and given to me by Y. Harbit. This is the
summary of the results:
From this table we see that the main improvements have been achieved in the
two classes PVD and ESP. ESP+ contains many problems that belong to ESP1
and no improvement beyond that has been achieved. The biggest difference is
made in the ESP1 class the extended version solves all problems that the basic
version solves plus 7 more within the extended time limit.
Overall we see that both versions solved the majority of problems. Within the
classes where already more than 90% of the problems had been solved after 200
6.3. MONADIC FRAGMENT 83
seconds only minor progress has been made within the additional 300 seconds.
Most room for further improvement within a reasonable time seems to be within
the ESP1 class.
In the classes BSH, GC and OCCI both versions perform equally well. One
possible explanation could be that the automatically selected ordering and selec-
tion functions of the basic version already form a decision procedure for many
examples of these classes. However, this would need to be subject to further
investigation.
6.3 Monadic Fragment
The implemented decision procedure for the monadic fragment was tested for 208
monadic problems in the TPTP library version 5.3.0. As shown in Table 7.1 of
the monadic problems were already solved fast by the basic version and by the
extension by Y. Harbit. There were no differences within the result.
The most interesting observation was the comparison of the decision proce-
dure with and without splitting that had been implemented within the scope of
this project. Without splitting, there were two problems whose solution has not
been found within a time limit of 500 seconds. One of them was satisfiable and
one of them was an unsatisfiable problem. For satisfiable problems splitting is
generally faster, because it simplifies the formula and the theorem prover only
needs to prove that one branch of the splitted formula is satisfiable.
Interestingly, splitting has also been faster for the unsatisfiable problem. In
this case the theorem prover needs to prove unsatisfiability for each branch of the
splitted set of clauses. It is probably still faster, because the splitted clauses are
a lot shorter and similar clauses can be subsumed. The clauses of this particular
problem became very large without splitting.
Overall almost every monadic problem was solved in less than one second.
There were six exceptions that have been printed in Table 7.2. Among them are
the two examples that ran out of time without splitting. In every case except for
84 CHAPTER 6. RESULTS AND FINDINGS
approach solved average time
no splitting 204/206 0:05full splitting 206/206 0:00first extension 206/206 0:00basic version 206/206 0:00
Table 6.2: Comparison of Different Implementations for MON
problem full splitting no splitting diff
MSC007-1-008.dfg Proof 0:04 Time-out 8:21 8:17SYN430-1.dfg Completion 0:00 Time-out 8:21 8:21SYN007+1.014.dfg Proof 0:05 Proof 1:24 1:19SYN431-1.dfg Completion 0:00 Completion 0:09 0:09SYN431+1.dfg Completion 0:00 Completion 0:07 0:07PUZ015-2.006.dfg Proof 0:01 Proof 0:01 0:00
Table 6.3: Comparison of the Performance With and Without Splitting forMonadic Problems With the Minimum Runtime of 1 second
one tie the approach with splitting was superior to the approach without splitting.
6.4 Structural Transformation Strategies
Some structural transformation strategies are already implemented in SPASS like
full structural transformation. Others as the structural transformation strategy
that has been described for the guarded negation fragment in Section 5.3 had to
be implemented to be tested.
A guarded negation example with different combinations of guarded subfor-
mulae has been desigend for testing purposes. This is the formula in negation
normal form:
6.4. STRUCTURAL TRANSFORMATION STRATEGIES 85
Example 6.1.
∃u, v(A(u, v) ∧ ∀w(
(¬(A(w, v) ∨ P (v, w) ∨ ∀x, y(
¬A(x, y) ∨ ∃z(
R(z) ∨ ∃x1(
P (x, z) ∧ P (y, x1))
) ∨ (∀x2(P (x2, u)) ∧ (
¬A(u, v) ∨ (∃x3(P (x3, v))) ∧ ∃x4, x5(
P (x4, x5) ∨ (R(x4) ∧ ∃x6(
S(x4, x5, x6, u) ∧ A0 ∧ ∀x7, x8(
¬P (x7, x8)))))))))
It is given in negation normal form to make it easier to see where structural
transformation will be applied. The SPASS file of this problem contains the for-
mula in the form of a guarded negation formula where no negations have been
resolved and needed to be transformed into negation normal form by SPASS.
The SPASS file for this example as well as the resulting clauses for different
structural transformations can be found in Appendix B. Other examples have
been designed and tested as well with corresponding results. Therefore it seemed
to be sufficient to give one example to represent them.
As described in Section 5.1, full structural transformation leads to very short
clauses, but some of them are without guards. This has been confirmed by test-
ing. The structural transformation into multi-guarded clauses of section 5.3 that
renames quantified subformulae has been implemented to evaluate whether it re-
sults in the clauses that have been described.
All tested examples resulted in kinds of clauses that have been described and
thus confirmed the theory in chapter 6. Comparison with other structural trans-
formation strategies has shown that the structural transformation into multi-
guarded clauses leads to the shortest and most clearly structured clauses that
have been obtained yet. Examples can be seen in Appendix B.
86 CHAPTER 6. RESULTS AND FINDINGS
Discussion of multi-guarded clauses
Section 5.3 as well as the tests that have been performed showed that the struc-
tural transformations that have been used result in multi-guarded clauses. From
one perspective these clauses are more simple than the clauses that resulted from
other clausal normal form transformations. This is an improvement and might
enable theorem provers to find determine satisfiability faster than before.
On the drawback multi-guarded clauses can contain any negative non-functional
literals. These literals do not need to be guarded and do not need to follow any
other restrictions. Section 5.5 has shown that can lead to problems such as in-
creasing term depth. It is therefore necessary to consider these clauses and where
they come from in particular to make adjustments to the structural transforma-
tion that has been used.
These clauses result from universally quantified subformulae of the kind φ−
that has been described in the beginning of chapter 5. It would be helpful to
consider how structural transformation can be applied for formulae of this kind.
One idea is to apply structural transformation without including the universal
quantifier. This leaves all universally quantified variables to be free variables
that can possibly be guarded by the newly introduced predicate symbol for this
formula.
Hitherto structural transformation had been applied to the whole universally
quantified subformula ∀xϕ instead of renaming the subformula ϕ which then con-
tains all occurances of the variables x as free variables. It might be possible to
restructure the formula in a way that uses the fresh predicate symbol for the
formula as a guard. It would be interesting to make some test with this and see
the resulting clauses.
6.4. STRUCTURAL TRANSFORMATION STRATEGIES 87
Further enhancement of class recognition
For some examples it has also been tested whether the derived clauses also belong
to the guarded fragment. During this process it has been observed that structural
transformation influences whether a problem belongs to the guarded class or not.
One of those examples is the problem dochGC3.dfg in Appendix B. In automode
the extended version of SPASS lead to the following output:
> $ ./SPASS examples/GNF/dochGC3.dfg
--------------------------SPASS-START-----------------------------
Input Problem:
1[0:Inp] || -> R1(skc1)*.
2[0:Inp] || R2(U,V,W,skc1)* -> Q(V,W)*.
3[0:Inp] || R2(U,V,W,skc1)* -> Q(skf3(V),V)*.
4[0:Inp] || R2(U,V,W,skc1)* -> P(skc1,skf3(V),V)*.
5[0:Inp] || R2(U,V,W,skc1)* -> P(skc1,U,skf2(U,X,Y))*.
6[0:Inp] || R2(U,V,W,skc1) -> R(U,V,W,skc1,skf2(U,W,V))*.
This is a first-order Horn problem without equality.
The following monadic predicates have finite extensions: R1.
Axiom clauses: 6 Conjecture clauses: 0
Clause 3 in particular is not guarded because it contains the variable X which
does not occur in any negative literal of the clause. Therefore this set of clauses
does not belong to the clausal class of the guarded fragment. The clauses do also
not belong to any other decidable clausal class that has been implemented:
Usable Clauses belong to GC : 0
Usable Clauses belong to EPS1 : 0
Usable Clauses belong to EPS+ : 0
Usable Clauses belong to PVD : 0
Usable Clauses belong to OCCI : 0
Usable Clauses belong to BSH : 0
When full structural transformation is activated by setting the flag -CNFRenaming=2
these clauses were derived:
88 CHAPTER 6. RESULTS AND FINDINGS
> $ ./SPASS -CNFRenaming=2 examples/GNF/dochGC3.dfg
Warning: You have set your own rules. Check the completeness of
the resolution method used.
--------------------------SPASS-START-----------------------------
Input Problem:
1[0:Inp] || -> SkP7(skc1)*.
2[0:Inp] || SkP7(U)* -> R1(U)*.
3[0:Inp] || SkP6(U)* SkP7(U)* -> .
4[0:Inp] || SkP0(U,V,W)* -> Q(V,U)*.
5[0:Inp] || SkP5(U,V,W,X)* -> SkP6(U)*.
6[0:Inp] || SkP0(U,V,W)* -> P(W,V,U)*.
7[0:Inp] || SkP1(U,V) -> SkP0(V,skf2(U,V),U)*.
8[0:Inp] || SkP2(U,V,W,X,Y)* -> Q(Y,X)*.
9[0:Inp] || SkP2(U,V,W,X,Y)* -> SkP1(W,Y)*.
10[0:Inp] || SkP2(U,V,W,X,Y)* -> P(W,V,U)*.
11[0:Inp] || SkP3(U,V,W,X,Y)* -> R(Y,X,W,V,U)*.
12[0:Inp] || SkP3(U,V,W,X,Y)* -> SkP2(U,Y,V,W,X)*.
13[0:Inp] || SkP4(U,V,W,X) -> SkP3(skf3(U,V,W,X),X,W,V,U)*.
14[0:Inp] || R2(U,V,W,X)* -> SkP4(U,V,W,X)* SkP5(X,W,V,U)*.
This is a first-order Non-Horn problem without equality.
This is a problem that contains sort information.
This problem belongs to the WGC Class.
This problem belongs to the GC Class.
The following monadic predicates have finite extensions: SkP7.
Axiom clauses: 14 Conjecture clauses: 0
All of these clauses are guarded. This means that the derived set of clauses
belongs to the clausal class of the guarded fragment when a different normal form
transformation has been used. They still do not belong to any other clausal class
that has been implemented:
Usable Clauses belong to GC : 1
Usable Clauses belong to EPS1 : 0
Usable Clauses belong to EPS+ : 0
Usable Clauses belong to PVD : 0
Usable Clauses belong to OCCI : 0
Usable Clauses belong to BSH : 0
6.4. STRUCTURAL TRANSFORMATION STRATEGIES 89
This indicates that different normal form transformation can be used to help
the the SPASS extension of Harbit (2012) to recognize more problems in decidable
classes. She already implemented decision procedures for many decidable clausal
classes. It could lead to further improvements when we ensure that formulae of
decidable fragments for which decision procedures have been implemented will
always be transformed into clauses of their respective clausal classes.
For some fragments like the monadic fragment standard normal form transfor-
mation always results in clauses of its clausal class. For other decidable fragments
like the guarded fragment a specific kind of structural transformation is useful.
If class recognition is not successful after standard normal form transforma-
tion, it might be worth trying another transformation, for instance the structural
transformation for the guarded fragment and try class recognition again. An
alternative would be to recognize guarded formulae before they are transformed
into clauses. Then the specific transformation method for guarded formulae can
be activated. In both ways it can be ensured that all guarded formulae are rec-
ognized to belong to a decidable clausal class. The same can be done for other
fragments that require specific normal form transformation.
This could add a new perspective to what Nonnengart & Weidenbachh said
(Nonnengart & Weidenbachh, 2001, p. 337):
“It is well-known that the quality of such a translation has a great impact on
the success of an afterwards applied automated reasoning system. From this per-
spective, a clausal normal form of some formula is better than another one if it
enables a system to find a proof/counter-model in a shorter period of time.”
We have seen examples of how structural transformation strategies determine
the structure of the derived set of clauses and which clausal class they belong
to. This makes them relevant for resolution decision procedures and there is still
more work that can be done in this area.
Chapter 7
Conclusions
Two decidable fragments of first-order logic with different degree of difficulty have
been examined in respect to their resolution decision procedures.
One of the aims for the monadic fragment was to find a simple clausal class.
This aim has been achieved. The clausal class for the monadic fragment has been
reduced to a non-functional clausal class which is decidable by resolution without
ordering. This has been achieved by a transformation method via disjunctive
normal form which eliminated dependencies. Nevertheless this clausal class has
not been implemented because of exponential growth in space and time. It has,
however, been described how the algorithm for this transformation could be im-
plemented.
The other aims for the monadic fragment of defining a decision procedure for
this fragment and implementing it in SPASS were achieved, too. It took some
effort to get the basic understanding of decidable classes and decision procedures
that is necessary for defining and proving a resolution decision procedure but this
also helped with the analysis of the guarded negation fragment.
The implementation part has been easier than expected. This was due to
the simplicity of the monadic fragment and the good functionality provided by
SPASS. Once the decision procedure had been defined, there were no considerable
obstacles for its implementation. This has also been due to the implementation
of Harbit (2012) that provided a good structure for implementations for class
recognition and decision procedures of further decidable classes.
90
91
Concerning her work the idea came up that different structural transforma-
tions could enhance class recognition. It would be interesting to make further im-
plementations and tests concerning this matter, especially regarding the guarded
fragment.
The most challenging aim of this project was to make progress in developing
a resolution decision procedure for the guarded negation fragment. The struc-
ture of the guarded negation fragment has been analysed in depth and with the
use of different structural transformations. This will support future work on this
fragment because the same transformations do not need to be tried again.
Additionally, we drew conclusions about how structural transformation could
be adapted to avoid clauses that had been problematic. Multi-guarded clauses
had been introduced as a clausal class for the guarded negation fragment. This
clausal class has no restrictions on negative non-functional literals which lead to
infinitely growing term depth. This can be avoided when there is a covering literal
as a guard for these negative literals. It will therefore be interesting to find out
how structural transformation can be adapted to restrict occurrences of negative
literals in a way that results in a decidable clausal class.
An idea how to go about this matter was to apply structural transformation
not for universally quantified subformulae ∀xϕ as a whole as it has been described
in Section 5.3 but to rather rename the subformula ϕ which then contains the
variables x if at all as free variables that can be guarded by the predicate symbol
that has been introduced.
Though progress has been made in developing a clausal class and decision
procedure for the guarded negation fragment, the problem itself still remains un-
solved. For this reason further implementations were not possible yet and both
developing a decision procedure and implementing it remains subject to future
work.
Bibliography
Bachmair, L., & Ganzinger, H. 2001. Resolution Theorem Proving. Pages
19 – 99 of: Robinson, A., & Voronkov, A. (eds), Handbook of Automated
Reasoning. Amsterdam: North-Holland.
Barany, V., ten Cate, B., & Segoufin, L. 2011. Guarded Negation. Pages
356–367 of: Aceto, L., Henzinger, M., & Sgall, J. (eds), Automata,
Languages and Programming - 38th International Colloquium, ICALP 2011,
Zurich, Switzerland, July 4-8, 2011, Proceedings, Part II. Lecture Notes in
Computer Science, vol. 6756. Springer.
Behmann, H. 1922. Beitrage zur Algebra der Logik, insbesondere zum Entschei-
dungsproblem. Mathematische Annalen, 86(3-4), 163–229.
Church, A. 1936. A Note on the Entscheidungsproblem. J. Symbolic Logic, 1,
40–44.
Fermuller, C. G., Leitsch, A., Hustadt, U., & Tammet, T. 2001.
Resolution Decision Procedures. Pages 1791 – 1849 of: Robinson, A., &
Voronkov, A. (eds), Handbook of Automated Reasoning. Amsterdam: North-
Holland.
Ganzinger, H., & Nivelle, H. De. 1999. A Superposition Decision Procedure
for the Guarded Fragment with Equality. Pages 295–303 of: In Proc. LICS’99.
IEEE Computer Society Press.
Harbit, Y. 2012. An Extension of SPASS deciding First-Order Clausal Classes.
M.Sc. Thesis, University of Manchester.
Knuth, D. E., & Bendix, P. B. 1970. Simple Word Problems in Universal
Algebras. Pages 263 – 297 of: Leech, J. (ed), Computational Problems in
Abstract Algebra. Pergamon.
92
BIBLIOGRAPHY 93
Kovacs, L., & Voronkov, A. 2013. First-Order Theorem Proving and Vam-
pire. Pages 1–35 of: Proceedings of the 25th International Conference on Com-
puter Aided Verification (CAV 2013), July 13-19, 2013, Saint Petersburg, Rus-
sia, Natasha Sharygina and Helmut Veith (editors), Springer Lecture Notes in
Computer Sciences.
Lowenheim, L. 1915. Uber Moglichkeiten im Relativkalkul. Math. Ann., 76,
447–470.
M. Baaz, U. Egly, & Leitsch, A. 2001. Normal Form Transformations. Pages
273 – 333 of: Robinson, Alan, & Voronkov, Andrei (eds), Handbook
of Automated Reasoning. Handbook of Automated Reasoning. Amsterdam:
North-Holland.
Nonnengart, A., & Weidenbachh, C. 2001. Computing Small Clause Nor-
mal Forms. Pages 335 – 367 of: Robinson, Alan, & Voronkov, Andrei
(eds), Handbook of Automated Reasoning. Handbook of Automated Reasoning.
Amsterdam: North-Holland.
Piskac, Ruzica, de Moura, Leonardo, & rner, Nikolaj Bjø. 2008.
Deciding Effectively Propositional Logic with Equality.
Robinson, J. A. 1965. A Machine-Oriented Logic Based on the Resolution
Principle. J. ACM, 12(1), 23–41.
Schmidt, R. A. 2011. COMP61111: Logic and Applications. Lecture 19: Reso-
lution decision procedures. University of Manchester.
Schmidt, R. A., & Korovin, K. 2015. COMP60332: Automated Reasoning
and Verification. Lecture slides Week 4. University of Manchester.
Sutcliffe, G. 2009. The TPTP Problem Library and Associated Infrastructure:
The FOF and CNF Parts, v3.5.0. Journal of Automated Reasoning, 43(4), 337–
362.
Sutcliffe, G. 2015. Geoff Sutcliffe’s Overview of Automated Theorem Proving,
URL http: // www. cs. miami. edu/ ~ tptp/ OverviewOfATP. html .
Turing, A. 1936/37. On Computable Numbers with an Application to the
Entscheidungsproblem. Proc. of the London Math. Soc., 2(42), 230–265.
94 BIBLIOGRAPHY
Weidenbach, C. 2001. Combining Superposition, Sorts and Splitting. Pages
1965 – 2013 of: Robinson, Alan, & Voronkov, Andrei (eds), Handbook
of Automated Reasoning. Handbook of Automated Reasoning. Amsterdam:
North-Holland.
Appendix A
Batch Script and Test Results
This is the batch script that has been used to run the tests as multiple parallel
tasks on a HPC system:
#!/bin/bash
#$ -S /bin/bash
#$ -cwd
#$ -V
#$ -t 1-858
# total examples in TEST: 858
# set path variables
FILE_PATH="~/scratch/problems/Test"
FILENAMES="~/scratch/problems/problem_names.txt"
OUTPUT_FILES="~/scratch/output/testrun1"
echo "Job Number = $SGE_TASK_ID"
# read name of input file
INFILE=‘awk "NR==$SGE_TASK_ID" ~/scratch/problems/problem_names.txt‘
#
# ...or used sed to print the n-th line of a file:
#
# INFILE=‘sed -n "${SGE_TASK_ID}p" my_file_list.txt‘
95
96 APPENDIX A. BATCH SCRIPT AND TEST RESULTS
#
echo "input file = $INFILE"
OUTPUT_FILE=‘~/scratch/versions/basic_version/spass/SPASS -PGiven=0
-TimeLimit=500 ~/scratch/problems/Test/$INFILE‘
echo "OUTPUT_FILE"
echo "$OUTPUT_FILE"
WITHOUT_EQ=‘echo "$OUTPUT_FILE" | awk ’/without equality/ {print $1}’‘
MONADIC=‘echo "$OUTPUT_FILE" | awk ’/This is a monadic/ {print $1}’‘
NON_HORN=‘echo "$OUTPUT_FILE" | awk ’/Non-Horn problem/ {print $1}’‘
FSYMBOLS=‘echo "$OUTPUT_FILE" | awk ’/There are no function symbols/
{print $1}’‘
NO_FSYMBOLS=‘if [ -n "$FSYMBOLS" ]; then echo 1; else echo 0; fi‘;
IS_MONADIC=‘if [ -n "$MONADIC" ]; then echo "1"; else echo "0"; fi‘;
IS_HORN=‘if [ -n "$NON_HORN" ]; then echo "0"; else echo "1"; fi‘;
WITH_EQUALITY=‘if [ -n "$WITHOUT_EQ" ]; then echo "0";
else echo "1"; fi‘;
RESULT=‘echo "$OUTPUT_FILE" | awk ’/SPASS beiseite:/ {print $3}’‘
TIME=‘echo "$OUTPUT_FILE" | awk ’/SPASS spent/ {print $3}’‘
ORDERING=‘echo "$OUTPUT_FILE" | awk ’/Ordering/ {print $3 $4}’‘
echo "insert into basic_test1 values (’$INFILE’, ’1’, ’basic’,’$RESULT’,
’$TIME’, ’$IS_MONADIC’, ’$IS_HORN’, ’$WITH_EQUALITY’, ’$NO_FSYMBOLS’,
’$ORDERING’)" >> ~/scratch/output/testrun1/results_basic1.sql;
These are some of the results. Every difference in the results of Y. Harbit’s
version and the basic version was that the basic version ran out of time while her
version found a result:
mysql> SELECT
97
basic_test1.result AS basic_result,
basic_test1.time AS basic_time,
yasmines_test1.result AS yasmines_result,
yasmines_test1.time AS yasmines_time
FROM basic_test1, yasmines_test1
WHERE basic_test1.fname = yasmines_test1.fname
AND basic_test1.result != yasmines_test1.result
-> ;
+--------------+------------+-----------------+---------------+
| basic_result | basic_time | yasmines_result | yasmines_time |
+--------------+------------+-----------------+---------------+
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Proof | 00:00:12 |
| Ran | 00:08:20 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:02 |
| Ran | 00:08:20 | Proof | 00:00:01 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:20 | Completion | 00:00:01 |
| Ran | 00:08:20 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:20 | Completion | 00:00:01 |
| Ran | 00:08:21 | Completion | 00:00:03 |
| Ran | 00:08:20 | Completion | 00:00:01 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:00 |
| Ran | 00:08:21 | Completion | 00:00:04 |
98 APPENDIX A. BATCH SCRIPT AND TEST RESULTS
| Ran | 00:08:21 | Completion | 00:00:04 |
| Ran | 00:08:20 | Proof | 00:01:45 |
+--------------+------------+-----------------+---------------+
24 rows in set (0.00 sec)
All results of my version were in harmony with Y. Harbit’s results:
mysql> SELECT own_test1.fname, own_test1.is_MON,
own_test1.result AS own_result, own_test1.time AS own_time,
yasmines_test1.result AS yasmines_result,
yasmines_test1.time AS yasmines_time
FROM own_test1, yasmines_test1
WHERE own_test1.fname = yasmines_test1.fname
AND own_test1.result != yasmines_test1.result
-> ;
Empty set (0.00 sec)
Appendix B
Structural Transformation
Results
The SPASS input file of the GNF formula that has been used as an example:
begin_problem(GNF).
list_of_descriptions.
name({* GNF formula *}).
author({* Arconya *}).
status(satisfiable).
description({* GNF formula.*}).
end_of_list.
list_of_symbols.
predicates[(A,2),(A0,0),(R,1),(P,2),(S,4)].
end_of_list.
list_of_formulae(axioms).
formula(
exists([X1,X2],
and(A(X1,X2),not(
and(exists([X3],and(
and(A(X3,X2),not(P(X2,X3)),
exists([X4,X5],
and(A(X4,X5),not(
99
100 APPENDIX B. STRUCTURAL TRANSFORMATION RESULTS
exists([X6],or(
R(X6),
exists([X7],and(P(X4,X6),P(X5,X7))))))))),
or(exists([X8],P(X8,X1)),
and(A(X1,X2),not(
and(exists([X9],P(X9,X2)),
exists([X10,X11],or(P(X10,X11),and(
R(X10),
exists([X12],and(S(X10,X11,X12,X1),
and(A0,not(
exists([X13,X14],P(X13,X14))
)))))))))))))))),1).
end_of_list.
end_problem.
SPASS transforms a formula into clausal normal form with the flag -Flotter.
The SPASS output for a formula in negation normal form and for the structural
transformation it uses can be printed with the flag -CNFPRenaming.
Full str. Transformation:
list_of_clauses(axioms, cnf).
clause( || -> SkP18(skc1,skc0),1).
clause( || SkC1 -> A0,2).
clause( || SkC1 -> SkC0,3).
clause( || SkC2 -> SkP14(U,V),4). ( -> unguarded!!)
clause( || SkC0 P(U,V) -> ,5).
clause( || SkP6(U,V) -> SkP5(V),6).
clause( || SkP6(U,V) -> SkP4(U),7).
clause( || SkP9(U,V) -> SkP8(V),8).
clause( || SkP0(U,V,W,X) -> SkC1,9).
clause( || SkP2(U,V,W) -> R(W),10).
101
clause( SkP5(U) || -> P(skf3(U),U),11).
clause( SkP8(U) || P(V,U) -> ,12).
clause( || SkP9(U,V) -> SkP7(U,V),13).
clause( || SkP18(U,V) -> A(V,U),14).
clause( || SkP18(U,V) -> SkP17(U,V),15).
clause( || SkP17(U,V) -> SkP16(V,W,U),16). ( -> unguarded!!)
clause( || SkP2(U,V,W) -> SkP1(W,V,U),17).
clause( SkP4(U) || -> SkP3(U,skf2(U),skf1(U)),18).
clause( || SkP10(U,V,W,X) -> P(X,W),19).
clause( || SkP10(U,V,W,X) -> P(V,U),20).
clause( || SkP13(U,V) -> SkP12(V,U,skf5(U,V)),21).
clause( || SkP0(U,V,W,X) -> S(X,W,V,U),22).
clause( || SkP7(U,V) A(V,U) -> SkP6(V,U),23).
clause( || SkP12(U,V,W) -> SkP11(V,W,U) R(W),24).
clause( || SkP14(U,V) A(V,U) -> SkP13(V,U),25).
clause( || SkP16(U,V,W) -> SkP9(W,U) SkP15(W,V),26).
clause( || SkP3(U,V,W) -> SkP2(U,V,W) P(W,V),27).
clause( || SkP15(U,V) A(V,U) -> P(U,V) SkC2,28).
clause( || SkP1(U,V,W) -> SkP0(W,skf0(U,V,W),V,U),29).
clause( || SkP11(U,V,W) -> SkP10(skf4(U,V,W),W,V,U),30).
end_of_list.
102 APPENDIX B. STRUCTURAL TRANSFORMATION RESULTSRename
each
alternating
quantifier:
list_of_clauses(axioms,
cnf).
clause(
||
->
A(skc0,skc1),1).
(ground)
clause(
||
->
SkP3(skc0,skc1),2).
(ground)
clause(
||
SkC0
P(U,V)
->
,3).
(GC)
clause(
SkP0(U)
||
->
A0
P(skc3,skc2),4).
(GC)
clause(
SkP0(U)
||
->
SkC0
P(skc3,skc2),5).
(GC)
clause(
SkP1(U)
||
->
P(skf3(U),U),6).
(GC)
clause(
SkP0(U)
||
->
R(skf0(U))
P(skc3,skc2),7).
(GC)
clause(
||
SkP2(U,V)
->
P(V,skf4(V))
R(skc4),8).
(GC)
clause(
||
SkP2(U,V)
->
P(U,skf5(U))
R(skc4),9).
(GC)
clause(
SkP0(U)
||
->
S(skf0(U),skf2(U),skf1(U),U)
P(skc3,skc2),10).
(GC)
clause(
||
P(U,V)
SkP3(V,W)
A(X,W)
A(Y,Z)
->
P(W,X)
SkP2(Z,Y),11).
(MGC)
clause(
||
A(U,V)
SkP3(U,V)
A(W,V)
A(X,Y)
->
SkP0(U)
P(V,W)
SkP2(Y,X),12).
(MGC)
clause(
||
A(U,V)
SkP3(U,V)
A(W,V)
A(X,Y)
->
SkP1(V)
P(V,W)
SkP2(Y,X),13).
(MGC)
end_of_list.
103
Rename
each
first
universal
quantifier:
list_of_clauses(axioms,
cnf).
clause(
||
->
A(skc0,skc1),1).
clause(
||
->
SkP0(skc0,skc1),2).
clause(
||
SkC0
P(U,V)
->
,3).
clause(
||
P(U,V)
SkP0(V,W)
A(X,W)
A(Y,Z)
->
P(Y,skf4(Y))
P(W,X)
R(skc4),4).
clause(
||
P(U,V)
SkP0(V,W)
A(X,W)
A(Y,Z)
->
P(Z,skf5(Z))
P(W,X)
R(skc4),5).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(X,skf4(X))
P(skf0(V),V)
P(V,W)
R(skc4),6).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(Y,skf5(Y))
P(skf0(V),V)
P(V,W)
R(skc4),7).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(X,skf4(X))
A0
P(skc3,skc2)
P(V,W)
R(skc4),8).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(Y,skf5(Y))
A0
P(skc3,skc2)
P(V,W)
R(skc4),9).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(X,skf4(X))
SkC0
P(skc3,skc2)
P(V,W)
R(skc4),10).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(Y,skf5(Y))
SkC0
P(skc3,skc2)
P(V,W)
R(skc4),11).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(X,skf4(X))
R(skf1(U))
P(skc3,skc2)
P(V,W)
R(skc4),12).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(Y,skf5(Y))
R(skf1(U))
P(skc3,skc2)
P(V,W)
R(skc4),13).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(X,skf4(X))
S(skf1(U),skf3(U),skf2(U),U)
P(skc3,skc2)
P(V,W)
R(skc4),14).
clause(
||
A(U,V)
SkP0(U,V)
A(W,V)
A(X,Y)
->
P(Y,skf5(Y))
S(skf1(U),skf3(U),skf2(U),U)
P(skc3,skc2)
P(V,W)
R(skc4),15).
end_of_list.
104 APPENDIX B. STRUCTURAL TRANSFORMATION RESULTSWithout
renaming:
list_of_clauses(axioms,
cnf).
clause(
||
->
A(skc0,skc1),1).
clause(
||
P(U,skc0)
A(V,skc1)
A(W,X)
->
P(W,skf0(W))
P(skc1,V)
R(skc8),2).
clause(
||
P(U,skc0)
A(V,skc1)
A(W,X)
->
P(X,skf1(X))
P(skc1,V)
R(skc8),3).
clause(
||
A(skc0,skc1)
A(U,skc1)
A(V,W)
->
P(V,skf0(V))
P(skc2,skc1)
P(skc1,U)
R(skc8),4).
clause(
||
A(skc0,skc1)
A(U,skc1)
A(V,W)
->
P(W,skf1(W))
P(skc2,skc1)
P(skc1,U)
R(skc8),5).
clause(
||
A(skc0,skc1)
A(U,skc1)
A(V,W)
->
P(V,skf0(V))
A0
P(skc4,skc3)
P(skc1,U)
R(skc8),6).
clause(
||
A(skc0,skc1)
A(U,skc1)
A(V,W)
->
P(W,skf1(W))
A0
P(skc4,skc3)
P(skc1,U)
R(skc8),7).
clause(
||
A(skc0,skc1)
A(U,skc1)
A(V,W)
->
P(V,skf0(V))
R(skc5)
P(skc4,skc3)
P(skc1,U)
R(skc8),8).
clause(
||
A(skc0,skc1)
A(U,skc1)
A(V,W)
->
P(W,skf1(W))
R(skc5)
P(skc4,skc3)
P(skc1,U)
R(skc8),9).
clause(
||
P(U,V)
A(skc0,skc1)
A(W,skc1)
A(X,Y)
->
P(X,skf0(X))
P(skc4,skc3)
P(skc1,W)
R(skc8),10).
clause(
||
P(U,V)
A(skc0,skc1)
A(W,skc1)
A(X,Y)
->
P(Y,skf1(Y))
P(skc4,skc3)
P(skc1,W)
R(skc8),11).
clause(
||
A(skc0,skc1)
A(U,skc1)
A(V,W)
->
P(V,skf0(V))
S(skc5,skc7,skc6,skc0)
P(skc4,skc3)
P(skc1,U)
R(skc8),12).
clause(
||
A(skc0,skc1)
A(U,skc1)
A(V,W)
->
P(W,skf1(W))
S(skc5,skc7,skc6,skc0)
P(skc4,skc3)
P(skc1,U)
R(skc8),13).
end_of_list.
105
This is the SPASS input file dochGC3.dfg which belongs to differnt clausal
classes depending on which normal form transformation has been used.
begin_problem(dochGC3).
list_of_descriptions.
name({* GNF and GF formula *}).
author({* Arconya *}).
status(satisfiable).
description({*This is not within GC
with standard SPASS structural transformation applied.*}).
end_of_list.
list_of_symbols.
predicates[(R1,1),(R2,4),(P,3),(Q,2),(R,5)].
end_of_list.
list_of_formulae(axioms).
formula(
exists([Z],
and(R1(Z),
not(
exists([X1,X2,X3],
and(R2(X1,X2,X3,Z),
not(
exists([Y],
and(R(X1,X2,X3,Z,Y),
and(
Q(X2,X3),
P(Z,X1,Y),
exists([Z3],
and(P(Z,Z3,X2),Q(Z3,X2)))
))))))))),1).
end_of_list.
end_problem.