Symbol Elimination for Parametric Second-Order Entailment Problems
(with Applications to Problems in Wireless Network Theory)
Abstract
We analyze possibilities of second-order quantifier elimination for formulae containing parameters – constants or functions. For this, we use a constraint resolution calculus obtained from specializing the hierarchical superposition calculus. If saturation terminates, we analyze possibilities of obtaining weakest constraints on parameters which guarantee satisfiability. If the saturation does not terminate, we identify situations in which finite representations of infinite saturated sets exist. We identify situations in which entailment between formulae expressed using second-order quantification can be effectively checked. We illustrate the ideas on a series of examples from wireless network research.
1 Introduction
The main motivation for this work was a study of models for graph classes naturally occurring in wireless network research – in which nodes that are close are always connected, nodes that are far apart from each other are never connected and any other node pairs can, but do not need to be connected. Transformations can be applied to such graphs to make them symmetric; this way we can define further graph classes. When checking inclusion between graph classes described using transformations we need to check entailment of second-order formulae. In addition, many such graph class descriptions are parametric in nature, so the goal is, in fact, to obtain (weakest) conditions on the parameters used in such descriptions that guarantee that graph classes are non-empty or that inclusions hold. This can be achieved by eliminating “non-parametric” constants or function symbols used in the description of such classes.
In this paper we combine methods for general symbol elimination (which we use for eliminating existentially quantified predicates) with methods for property-directed symbol elimination (which we use for obtaining conditions on “parameters” under which formulae are satisfiable or second-order entailment holds). For general second-order quantifier elimination we use a form of ordered resolution similar to that proposed in [18]. For property-directed symbol elimination we use a method we proposed in [41]. The advantage of using such a two-layered approach is that it avoids non-termination that might occur if using only general symbol elimination methods. The main application area we consider in this paper is the analysis of inclusions between graph classes arising in wireless network research. Our main contributions are:
-
•
We analyze theories used in modeling graph classes and prove locality of theories of “distances” occurring in this context.
-
•
We analyze possibilities of general symbol elimination, using a simple specialization of the hierarchical superposition calculus (a form of ordered resolution) for eliminating a predicate symbol .
-
•
If saturation terminates, we analyze possibilities of obtaining weakest constraints on parameters occurring in the clauses which guarantee satisfiability, using methods for property-directed symbol elimination.
-
•
If the saturation does not terminate, we study possibilities of representing an (infinite) saturated set as a set of constrained clauses in which the constraints are interpreted in the minimal model of a set of constrained Horn clauses.
-
•
We analyze possibilities of effectively checking entailment between formulae expressed using second-order quantification.
-
•
We illustrate the ideas on examples related to the study of wireless networks.
Related work. The study of second-order quantifier elimination goes back to the beginning of the 20th century (cf. [10, 2, 3]). Most of its known applications are in the study of modal logics or knowledge representation [19, 22]; in many cases second-order quantifier elimination is proved only for very restricted fragments (cf. e.g. [43]). In [18], Gabbay and Ohlbach proposed a resolution-based algorithm for second-order quantifier elimination which is implemented in the system SCAN. In [5], Bachmair et al. mention that hierarchical superposition (cf. [8, 9] for further refinements) can be used for second-order quantifier elimination modulo a theory. In [34, 24], Hoder et al. study possibilities of symbol elimination in inference systems (e.g. the superposition calculus and its extension with ground linear rational arithmetic and uninterpreted functions). The main challenge when using saturation approaches for symbol elimination is the fact that the saturated sets might be infinite. Sometimes finite representations of possibly infinite sets of clauses exist: for this, Horbach and Weidenbach introduced a melting calculus [27], later used in [25, 26] and [16]. Similar aspects were explored in the study of acceleration for program verification modulo Presburger arithmetic by Boigelot, Finkel and Leroux [14, 17], in relationship with array systems by [4], or in the study of constrained Horn clauses (cf. e.g. the survey [12]).
Orthogonal to this direction of study is what we call “property-directed” symbol elimination: There, given a theory and a ground formula satisfiable w.r.t. , the goal is to derive a (weakest) universal formula over a subset of the signature, such that is unsatisfiable w.r.t. . We devised methods for solving such problems in [41] and used them for interpolant computation [41], and invariant generation [36].
We are not aware of other similar approaches to the area of computational (geometric) graph theory. Existing approaches use a logical representation of graphs based on monadic second-order logic (cf. e.g. [15]) or higher-order theorem provers like Isabelle/HOL (cf. e.g. [1]). Our approach is orthogonal; it allows a reduction of many problems to satisfiability modulo a suitable theory.
Structure of the paper. In Section 2 we present the motivation for our research. In Section 3 we introduce the notions on (local) theory extensions needed in the paper and prove the locality of theories of distance functions. In Section 4 we describe (and slightly extend) a method for property-directed symbol elimination we proposed in [41]. In Section 5 we present the calculus we use for eliminating predicate , and analyze possibilities of giving finite representations for infinite saturated sets and of investigating the satisfiability of the saturated sets. In Section 6 we use these ideas for checking class inclusion. In Section 7 we discuss the way in which we tested the methods we propose on various examples. In Section 8 we present conclusions and plans for future work.
This paper is an extended version of [37] which contains full proofs of the results, a more detailed description of the examples, a description of the systems we used for testing and several examples illustrating how these systems were used.
Table of Contents
section.1.1 section.1.2 section.1.3 subsection.1.3.1 subsection.1.3.2 section.1.4 section.1.5 subsection.1.5.1 subsection.1.5.2 section.1.6 section.1.6.1 section.1.7 section.1.8 section.A.1 subsection.A.1.1 subsection.A.1.2 subsection.A.1.3 section.A.2 section.A.3
2 Motivation
Graph Classes. Graph classes important in wireless network research are: The class of unit disk graphs (two nodes are connected iff they are different and their distance is ); the class of quasi unit disk graphs, for (two distinct nodes with distance are always connected and nodes with distance are never connected); the class of directed transmission graphs for (every node has a maximum communication distance ; an edge from to exists iff and the distance between and is ).
Many graph classes (where is a sequence of symbols denoting parameters) can be described using inclusion, exclusion and transfer axioms.
The inclusion axioms specify which edges have to exist. For a graph class the condition under which an edge must exist can be described by a formula . Therefore, inclusion axioms have the form:
The exclusion axioms specify which edges are not allowed to exist. For a class the condition under which an edge is not allowed to exist can be described by a formula . Therefore, transfer axioms have the form:
The transfer axioms specify which edges must exist as a consequence of the existence of another edge . For a class , we describe these these conditions by a formula . Therefore, inclusion axioms have the form:
.
If the description of the graph class depends on parameters , the formulae and might contain parameters. We will sometimes indicate this by adding the parameters to the arguments, i.e. writing resp. .
We can, e.g., define the classes , and using axioms:
-
•
: axiom , where is the formula ;
-
•
: axiom , where is the formula ;
-
•
: axiom , where is the formula ,
(where is supposed to be a parameter).
With this notation, the inclusion axiom states that if and an edge from to must exist; the exclusion axiom states that if then we are not allowed to have an edge from to . The transfer axiom states that if and are different and there is an edge from to and then there must exist an edge also from to .
By combining such axioms we obtain axiomatizations for new
graph classes. If the classes and of graphs are axiomatized
by axioms and then is an axiomatization for the intersection .
For instance, the class
is axiomatized by .
We may want to check whether a graph class has non-empty models, or to determine (weakest) conditions on the parameters under which this is the case. This is one of the problems which will be analyzed in this paper.
Simple transformations on graph classes. We can define transformations on graphs that transform the edges and leave the set of vertices unchanged, and form graph classes
Two examples of transformations are and : Given a graph , we can build the symmetric supergraph resp. symmetric subgraph , defined by:
We can thus define the classes and .
The class of quasi unit disk graphs [7, 35] can, for instance, be described as
We might want to obtain an axiomatization for that depends only on the predicates or test whether the class is the same as the class described by .
To find an axiomatization of a graph class , where is a transformation, we need to find a first-order formula equivalent to where is a class of clauses describing class and is a formula describing the way the edges of the graph can be obtained from the description of the graph . We here analyze possibilities of eliminating second-order quantifiers.
Checking class inclusion. If we can find such formulae for two graph classes, then we can also check containment (provided the formulae belong to decidable theory fragments). In this paper we analyze situations in which this is possible.
3 Theories and local theory extensions
We assume known the basic notions in (many-sorted) first-order logic. We consider signatures of the form , where is a set of sorts, is a family of function symbols and a family of predicate symbols, such that for every function symbol (resp. predicate symbol ) their arity (resp. ), where , is specified. If is a fixed countable set of fresh constants, we denote by the extension of with constants in . We assume known standard definitions from first-order logic such as -structure, model, satisfiability, unsatisfiability. A -structure is a tuple
where, for every , is a non-empty set (the universe of sort of the structure), for every with arity , , and for every with arity , .
If is a -structure, we will denote by the extension of , where we have an additional constant (of sort ) for each element of sort of (which we denote with the same symbol) with the natural interpretation mapping the constant to the element of .
If and is a -structure, we denote its reduct to by .
Notation. We will denote with (indexed versions of) variables and with (indexed versions of) constants; will stand for a sequence of variables , and for a sequence of constants .
Theories. Theories can be defined by specifying a set of axioms, or by specifying a class of structures (the models of the theory). If and are formulae we write (resp. – also written as ) to express the fact that every model of (resp. every model of which is also a model of ) is a model of . We denote “falsum” with . means that is unsatisfiable; means that there is no model of in which is true.
A theory over a signature allows quantifier elimination (QE) if for every formula over there exists a quantifier-free formula over which is equivalent to modulo . Examples of theories which allow quantifier elimination are rational and real linear arithmetic (, ), the theory of real closed fields, and the theory of absolutely-free data structures.
Sometimes, in order to define more complex theories we can consider theory extensions and combinations thereof. Local theory extensions are a class of theory extensions for which hierarchical reasoning is possible.
3.1 Local theory extensions
In what follows, for simplicity we present the main notions in the one-sorted case; the extension to the many-sorted case is immediate.
Let be a signature, and be a “base” theory with signature . We consider extensions of with new function symbols (extension functions) whose properties are axiomatized using a set of (universally closed) clauses in the extended signature , such that each clause in contains function symbols in . Especially well-behaved are the -local theory extensions, i.e. theory extensions as defined above, in which checking ground satisfiability can be done using a finite instantiation scheme described by a suitable closure operator , without loss of completeness. We express this with the following condition:
For every finite set of ground -clauses (for an additional | |
set of constants) it holds that if and only if | |
is unsatisfiable. |
where, for every set of ground -clauses, is the set of instances of in which the terms starting with a function symbol in are in , where is the set of ground terms starting with a function in occurring in or .
Partial and total models. In [38] we showed that local theory extensions can be recognized by showing that certain partial models embed into total ones, and in [30] we established similar results for -local theory extensions and generalizations thereof. We introduce the main definitions here, following mainly the presentation from [30] and [42].
Let be a first-order signature with set of function symbols and set of predicate symbols . A partial -structure is a structure , where is a non-empty set, for every -ary , is a partial function from to , and for every -ary , . We consider constants (0-ary functions) to be always defined. is called a total structure if the functions are all total. Given a (total or partial) -structure and we denote the reduct of to by .
The notion of evaluating a term with variables w.r.t. an assignment for its variables in a partial structure is the same as for total algebras, except that the evaluation is undefined if and at least one of is undefined, or else is not in the domain of .
Definition 1
A weak -embedding between two partial -structures and , where and is a total map such that
-
(i)
is an embedding w.r.t. , i.e. for every with arity and every , if and only if .
-
(ii)
whenever is defined (in ), then is defined (in ) and , for all .
Definition 2 (Weak validity)
Let be a partial -algebra and a valuation for its variables. weakly satisfies a clause (notation: ) if either some of the literals in are not defined or otherwise all literals are defined and for at least one literal in , is true in w.r.t. . is a weak partial model of a set of clauses if for every valuation and every clause in .
Recognizing -local theory extensions. In [38] we proved that if every weak partial model of an extension of a base theory with total base functions can be embedded into a total model of the extension, then the extension is local. In [28] we lifted these results to -locality.
Let be a partial -structure with total -functions. Let be the extension of the signature with constants from . We denote by the following set of ground -terms:
Let be the class of all weak partial models of , such that is a total model of , the -functions are possibly partial, is finite and all terms in are defined (in the extension with constants from ). We consider the following embeddability property of partial algebras:
Every weakly embeds into a total model of . |
We also consider the property , which additionally requires the embedding to be elementary, and the property , which requires that every structure embeds into a total model of with the same support. If is the identity, we refer to these properties as , and .
When establishing links between locality and embeddability we require that the clauses in are flat and linear w.r.t. -functions. When defining these notions we distinguish between ground and non-ground clauses.
Definition 3
An extension clause is flat (resp. quasi-flat) when all symbols below a -function symbol in are variables (resp. variables or ground -terms). is linear if whenever a variable occurs in two terms of starting with -functions, the terms are equal, and no term contains two occurrences of a variable.
A ground clause is flat if all symbols below a -function in are constants. A ground clause is linear if whenever a constant occurs in two terms in whose root symbol is in , the two terms are identical, and no term which starts with a -function contains two occurrences of the same constant.
Definition 4 ([30])
With the above notations, let be a map associating with and a set of -ground terms a set of -ground terms. We call a term closure operator if the following holds for all sets of ground terms :
-
(1)
,
-
(2)
,
-
(3)
,
-
(4)
for any map , , where is the canonical extension of to extension ground terms.
Theorem 1 ([28, 30])
Let be a first-order theory and a set of universally closed flat clauses in the signature . The following hold:
-
(1)
If all clauses in are linear and is a term closure operator with the property that for every flat set of ground terms , is flat then either of the conditions and implies .
-
(2)
If the extension satisfies then holds.
The linearity assumption needed to prove that implies can be relaxed if the closure operator has additional properties.
Theorem 2
Let be a set of -flat clauses, with the property that every variable occurs only once in every term. Let be a term closure operator with the property that for every flat set of ground terms , is flat.
Assume that and have the property that for every flat set of ground terms and for every clause , if contains terms and (where are extension functions and and are not necessarily different), if then . Then implies .
Proof: The proof is included in Appendix 0.B.111A similar result can be proved also in the case in which some variables occur several times below a function symbol if has the property that if and then and .
Theorem 3 ([39, 28])
The following theory extensions have property , hence are local:
-
(i)
The extension of a theory with uninterpreted function symbols.
-
(ii)
The extension of a theory containing a predicate which is reflexive with a function satisfying the axioms where:
-
–
are -formulae with if
( can be 1 and can be ), -
–
has the form (1) or (2) or (3) , where are -terms and in case (3) .
-
–
Hierarchical reasoning. Consider a -local theory extension . Condition requires that for every finite set of ground -clauses, iff . In all clauses in the function symbols in only have ground terms as arguments, so can be flattened and purified. We thus obtain a set of clauses , where and do not contain -function symbols and contains clauses of the form , where , and are constants. This transformation allows us to reduce testing satisfiability w.r.t. to testing satisfiability w.r.t. .
Theorem 4 ([38])
Let be a set of clauses.
Assume that
is a
-local theory extension.
For any finite set of ground -clauses,
let
be obtained from by introducing, in a bottom-up manner, new
constants for subterms where and are constants, together with
definitions (included in ) and
replacing the corresponding terms with the constants in
and .
Then if and only if
where
This method is implemented in the program H-PILoT (Hierarchical Proving by Instantiation in Local Theory Extensions) [29].
3.2 Locality of theories of distances
The theories related to wireless networks used in Section 2 refer to cost or distance functions. We prove that axiomatizations for such functions define local theory extensions. We first formalize the properties of metric spaces , i.e. sets endowed with a distance function satisfying the usual axioms of a metric, and prove a locality property. We then consider variants that contain only some of these axioms.
Theorem 5
Let be the disjoint two-sorted combination of , the pure theory of equality (no function symbols), sort , and (linear real arithmetic), sort . Let be the extension of with a function with arity satisfying the following set of axioms:
Let be defined for every set of ground terms by
Then the following hold:
-
(1)
is a closure operator on ground terms.
-
(2)
For every finite set of ground terms, is finite.
-
(3)
is a -local extension of satisfying condition .
Proof: (1) Clearly, for every set of ground terms, and contain the same constants of sort , so . Since the only extension function symbol is , for every set of ground terms. The fact that if we have follows from the definition. It is also easy to check that for every map , , i.e. is stable under renaming of constants.
(2) If is finite, then it contains finitely many constants (say ). has then elements.
(3) To prove that is a -local extension of , we prove that it satisfies the embeddability condition (), i.e. that for every partial model of with the properties:
-
(i)
All function symbols in are everywhere defined; is partially defined.
-
(ii)
The set is finite, and closed under .
can be extended to a total function on that satisfies the axioms .
Let be a partial model of (where is the support of sort p, the support of sort num, and a partial function from to ) satisfying the conditions above. Then:
-
•
whenever defined, , and if , ;
-
•
whenever it is defined;
-
•
if and are defined then ; and
-
•
if are defined then .
Let .
Let . By the assumption that is defined only for finitely many tuples , is finite and by condition (ii) above (as is closed under ), . Thus, , such that is totally defined and is nowhere defined on (for every two different elements , is undefined and for every there is no such that or is defined).
Since is finite, the maximum exists.
Consider an arbitrary distance function on such that is finite (such a function is guaranteed to exist, since the distance axioms are consistent: We can for instance regard all points in as points in the unit circle and consider the euclidian distances between these points). Thus, the distance function on is totally defined and bounded. Let be such that for all .
We now show how to extend on . If or are empty we have a total extension of already. Assume they are both non-empty. Let and . We construct a totally defined function as follows:
where , is such that , where .
We show that is a total function that satisfies all the axioms :
-
•
It is clear that is a total function and that for all , i.e. it satisfies axiom .
-
•
Let . Then , with or , and since satisfies axiom , . Thus satisfies axiom too.
-
•
Let . If for or , then – since satisfies axiom . If then ; the case when is similar. Thus satisfies axiom too.
-
•
Let . If , with or , and then , so as satisfies axiom , . If and or and then by definition , so we cannot have . Thus satisfies axiom too.
-
•
We show that satisfies the triangle inequality (axiom ). Let . We show that . We distinguish the following cases:
- Case 1: .
-
Then .
- Subcase 1.a: .
-
Then .
- Subcase 1.b: .
-
Then .
- Case 2: .
-
Then .
- Subcase 2.a: .
-
Then .
- Subcase 2.b: .
-
Then .
- Case 3: .
-
Then .
- Subcase 3.a: .
-
Then , since satisfies axiom .
- Subcase 3.b: .
-
Then .
- Case 4: .
-
Then .
- Subcase 4.a: .
-
Then , since satisfies axiom .
- Subcase 4.b: .
-
Then .
In [30] it was proved that condition for implies -locality of the extension if the clauses in are flat and linear. The clauses in are flat, but are not linear. In the proof of the fact that embeddability implies locality linearity is needed in order to ensure that if we have a model of we can define a partial model of and argue that (by ) this model embeds into a total model of . We construct as follows: Its universe(s) are the same as for , and is defined in if there exists constants which interpret in as and occurs in . This definition is used to associate with every valuation in in which all terms in a clause are defined a substitution such that .
If the clause is linear the substitution can be defined without problems. If contains a variable in different terms, it might be difficult to define because for different occurrences of we might find different suitable terms.
This problem does not occur here because of the fact that adds all necessary instances that allow to define without problems.
Alternatively, it can be easily checked that all assumptions in Theorem 2 hold in this case, so in this case embeddability entails locality.
We can still obtain local theory extensions if we leave out some of the metric axioms. Below we consider, for instance, extensions with a function in which all the axioms of a metric except for the triangle inequality hold.
Theorem 6
Let be the disjoint two-sorted combination of the theory of pure equality (no function symbols), sort , and (linear real arithmetic), sort . Let be the extension of with a function with arity satisfying the following set of axioms:
Let be defined for every set of ground terms by
Then is a -local extension of .
Proof: To prove locality we have to show that every partial model of which is closed under can be extended to a total model. Let be a partial model of (where is the support of sort p, the support of sort num, and a partial function from to ) satisfying the conditions above. We construct a total function as follows:
It is easy to check that satisfies all the axioms in . The considerations in the previous proof (or Theorem 2) can be used also in this case to show that embeddability implies locality in spite of the non-linearity due to the choice of the closure operator.
Theorem 7
Let be the disjoint combination of the theory of pure equality (sort ) and linear real arithmetic (sort ). The following extensions of with a function (sort ) are -local, with being the identity function.
-
(i)
, the extension of with an uninterpreted function .
-
(ii)
, where .
The extension , where is -local, where .
Proof. (i) and (ii) are a direct consequence of Theorem 3; the locality proof for is similar to the one for .
We present all the results together in the following theorem:
Theorem 8
Let be the disjoint combination of the theory of pure equality (sort ) and linear real arithmetic (sort ). The following extensions of with a function (sort ) are -local for a suitable closure operator :
-
(1)
, where are axioms of a metric, is -local, where .
-
(2)
, where contains all axioms of a metric except for the triangle inequality, is -local, where .
-
(3)
, the extension of with an uninterpreted function , and , where , are -local, where .
4 Property-directed symbol elimination and locality
In [41] we proposed a method for property-directed symbol elimination described in Algorithm 1. We present a slight generalization.
Input: | Theory extension with signature |
---|---|
where is a set of parameters | |
Set of ground -terms | |
Output: | (universal -formula) |
- Step 1
-
Purify as described in Theorem 4 (with set of extension symbols ). Let be the set of -clauses obtained this way.
- Step 2
-
Let . Among the constants in , we identify
-
(i)
the constants , , where is a constant parameter or is introduced by a definition in the hierarchical reasoning method,
-
(ii)
all constants occurring as arguments of functions in in such definitions.
Replace all the other constants with existentially quantified variables (i.e. replace with ).
-
(i)
- Step 3
-
Construct a formula equivalent to w.r.t. using a method for quantifier elimination in .
- Step 4
-
Replace each constant introduced by definition with the term in . Let be the formula obtained this way. Replace with existentially quantified variables .
- Step 5
-
Let be .
Theorem 9 ([40, 41])
Let be a -theory allowing quantifier elimination222If does not allow QE but has a model completion which does, and if we use QE in in Algorithm 1, , but might not be the weakest universal formula with the property that . be a set of parameters (function and constant symbols) and be such that . Let be a set of clauses in the signature in which all variables occur also below functions in . Assume satisfies condition for a suitable closure operator with for every set of ground -clauses. Then, for , Algorithm 1 yields a universal -formula such that which is entailed by every universal formula with .
Proof: The fact that was proved in [41]. We show that if then for every set of universal constraints on the parameters, if is unsatisfiable then every model of is a model of .
In [41] it is shown that if the extension satisfies condition then also the extension satisfies condition . If is flat and linear then the extension is -local. Let . By -locality, is unsatisfiable if and only if is unsatisfiable, if and only if (with the notations in Steps 1–5 of Algorithm 1) is unsatisfiable. Let be a model of . Then in there are no possible values for the constants , for which is true in . Hence, , so (with the notation used when describing Steps 1–5) . It follows that .
This reduction method was implemented in sehpilot (for details cf. Section 7).
5 Second-order quantifier elimination
Let be a theory with signature and be predicate symbols which are not in . Let and ; be a -formula and a -formula.
A -structure is a model of (notation: ) if there exists a -structure such that and .
We say that entails w.r.t. (and use the notation: ) iff for every -structure which is a model of , if then .
If there exists a first-order formula over the signature such that for every model of , iff , we say that and are equivalent w.r.t. (and write ).
We consider here only the elimination of one predicate; for formulae of the form the process can be iterated. Let be a theory with signature and let , where .
Let be a universal first-order -formula. Our goal is to compute, if possible, a first-order -formula such that . We adapt the hierarchical superposition calculus proposed in [8, 9] to this case.
We consider theories over many-sorted signatures , where the set of sorts consists of a set of interpreted sorts and a set of uninterpreted sorts. The models of the theories are -structures , where each support of interpreted sort is considered to be fixed. Following the terminology used in [8, 9], we will refer to elements in the fixed domain of sort as domain elements of sort .
Let be a universal first-order formula over signature . We can assume, without loss of generality, that is a set of clauses of the form , where is a clause over the signature and is a clause containing literals of the form , where are variables333We can bring the clauses to this form using variable abstraction.. Such clauses can also be represented as constrained clauses in the form We will refer to clauses of this form as constrained -clauses.
Let be a strict, well-founded ordering on terms that is compatible with contexts and stable under substitutions. As in [9] we assume that has the following properties:444These conditions are satisfied by an LPO with an operator precedence in which the predicate symbol (which can be regarded as function symbol with output sort ) is larger than the other operators and domain elements are minimal w.r.t. which is supposed to be well-founded on the domain elements.
-
(i)
is total on ground terms,
-
(ii)
for every domain element of interpreted sort and every ground term that is not a domain element.
Let be the calculus containing the following ordered resolution and factorization rules for constrained -clauses:
where (i) | (i) | ||
---|---|---|---|
(ii) | is strictly maximal in | (ii) | is maximal in |
(iii) | is maximal in |
Redundancy. The inference rules are supplemented by a redundancy criterion meant to specify:
-
•
a set of redundant clauses (which can be removed), and
-
•
a set of redundant inferences (which do not need to be computed).
We say that a set of clauses is saturated up to -redundancy w.r.t. if every inference with premises in is redundant (i.e. in ).
The following notion of redundancy for clauses is often used: A (constrained) clause is redundant w.r.t. a set of clauses if all its ground instances are entailed w.r.t. by ground instances of clauses in which are strictly smaller w.r.t. . We will use the following notion of redundancy for inferences: If is a redundancy criterion for clauses, we say that an inference on ground clauses is redundant w.r.t. if either one of its premises is redundant w.r.t. and or, if is the conclusion of then there exist clauses that are smaller w.r.t. than the maximal premise of and .
A non-ground inference is redundant if all its ground instances are redundant.
Example 1 (Semantic -entailment; redundancy criterion )
We say that a constrained -clause is -semantically entailed by if the following conditions hold:
-
(i)
,
-
(ii)
and
-
(iii)
for every ground substitution .
We say that a clause is -redundant w.r.t. a set of clauses if it is -semantically entailed by a clause in .
Note that if is -semantically entailed by then and for every ground substitution , so -redundant clauses are -redundant.
We call the notion of redundancy induced on inferences also -redundancy.
Let be a redundancy criterion with . We want to prove that if is a set of constrained -clauses over background theory , its saturation (up to -redundancy) under , and the set of clauses in not containing , then for every model of , is a model of if and only if there exists a -structure with and . The proof of this fact is very similar to the proof of the completeness of hierarchical superposition. Since our goal is different, we present here all the details just for the sake of completeness. (The results are probably known, already in [5] it was mentioned that hierarchical superposition can be used for second-order quantifier elimination.) We start with a lemma.
Lemma 10
Let , be a theory with signature and let be a -structure which is a model of . For every element we add a new constant of sort (which we denote ). Let be the set of all constants introduced this way, and be the extension of with constants from which are interpreted in the usual way.
Let be a set of clauses over signature . Then the following are equivalent:
-
(1)
is a model of .
-
(2)
is a model of the set of all ground instances of in which the variables are replaced with constants in .
Proof: (1) (2): Assume that is a model of . Let be a clause in . Then is obtained from a clause by replacing every variable with a constant (such that if the variable has sort then ). Let be defined by for every occurring in and defined arbitrarily for all the other variables. Since is a model of , the clause is true in in the valuation . But is obtained by evaluating the function and predicate symbols as in and every variable occurring in as . This is exactly the value of in , thus is a model of .
(2) (1): Assume that is a model of . Let and let be a valuation. For every , let . As discussed before, the value of in w.r.t. is the same as the value of in , where is the substitution that associates with every variable the constant . Since is a model of the set and , is also a model of . It follows that is true in w.r.t. for every valuation , i.e. that is a model of .
Theorem 11
Let be a set of constrained -clauses over background theory , its saturation (up to -redundancy) under , and the set of clauses in not containing . For every model of the following are equivalent:
-
(1)
is a model of .
-
(2)
There exists a -structure with and .
Proof: First, note that for constrained -clauses the hierarchical superposition calculus specializes to : With the terminology used in [5, 8, 9], the background signature is ; the only foreground symbol is . Since there are no “background”-sorted terms starting with a “foreground” function symbol, sets of -clauses are sufficiently complete. (Even if we regard predicates as functions with values in the domain , since predicates can only take values 0 or 1 sufficient completeness is guaranteed.) Since in the special case we consider there are no foreground terms, in this case all substitutions are simple as well.
(2) (1) follows from the soundness of the hierarchical superposition calculus.
(1) (2) is proved with a model construction similar to the one used for proving completeness of hierarchical superposition. Let be a model of and . Consider the extension of the signature obtained by adding to a set containing a constant of sort for every element .
Since is a model of , by Lemma 10, is a model of the set of instances of in which the variables are replaced with constants in .
By Zermelo’s theorem, there exists a total well-founded strict order on the set of all constants in , and starting with this ordering we can obtain a total well-founded strict ordering (which we denote again with ) on the set of all ground terms over , which can be extended in the usual way to the set of all ground clauses over the signature , such that the literals containing the predicate symbol are larger than the literals not containing .555This is compatible with regarding as a function symbol with output sort and using an ordering in which is the largest function symbol.
Consider the clauses in the set ordered increasingly according to the clause ordering induced by the atom ordering. Since is saturated w.r.t. , is also saturated w.r.t. . We construct a model for using a canonical model construction, similar to the one usually used for proving completeness of ordered resolution. We sketch the construction here:
We start with an interpretation in which all atoms in the set are false. The clauses in are smaller than the clauses containing the predicate symbol and by assumption are all true in , hence also in the interpretation that we start with (and will remain true in the process of constructing ). We therefore only need to consider the set of all constrained -clauses containing the predicate symbol . When considering a clause , we assume that we already constructed a partial interpretation that makes true all clauses strictly smaller than .
-
•
If is true in the partial interpretation nothing needs to be done.
-
•
If is false in the partial interpretation we need to change such that becomes true (such that the clauses smaller than remain true).
We proceed as follows: If is false in and contains exactly one maximal literal which is positive (which needs to start with and is for instance of the form ), we change the interpretation of such that it contains the tuple , i.e. such that becomes true. We denote this by setting . Otherwise we do not change the interpretation, i.e. .
The candidate model is the limit of all these changes, .
We can show that the expansion of with the constants in (with the usual interpretation) is a model of in the usual way: Assume that there exists a clause in which is not true in . Since the ordering on is well-founded, we consider without loss of generality the smallest clause in which is false in . We can show in the usual way that using a resolution or a factorization step we can produce a smaller clause false in , which is either in or in , so in both cases we obtain a contradiction.
Since is a model of , and for every sort (hence ), it follows that is a model of .
Corollary 12
Let be a theory, be a set of constrained -clauses and be a set of constrained -clauses obtained by saturating in up to redundancy. Let be a -structure which is a model of . Then is a model of if and only if there exists a -structure with and .
Proof: Follows from the fact that in the proof of Theorem 11 the clauses which are redundant are entailed (w.r.t. ) by clauses that are smaller hence cannot be minimal counterexamples and cannot influence the way model is built because every redundant clause is true in .
5.1 Case 1: Saturation is finite
If the saturation of under (up to -redundancy) is finite and is the set of clauses in not containing then, by Theorem 11, the universal closure of the conjunction of the clauses in is equivalent to .
Example 2
Consider a class of graphs described by the following set of constrained -clauses:
For arbitrary predicates and we can generate with an infinite set of clauses including, e.g., all clauses of the form:
If we assume that satisfy the additional axioms defining a theory :
then all inferences by resolution between clauses (1) and (2), (2) and (3) are -redundant. The inferences between (2) and (2) are also -redundant: Consider a ground instance of such an inference (the maximal literals are underlined):
The ground instance of (2) differs from the conclusion of the inference above only in the background part and is smaller than the first premise of the inference. If holds then entails the conclusion of the inference above, which makes the inference redundant w.r.t. .
Thus, only the inference of clauses (1) and (3) yields a non-redundant resolvent:
so is saturated up to -redundancy. By Theorem 11, is satisfiable iff is satisfiable w.r.t. .
When modelling concrete situations, the predicates and might not be arbitrary, but might have definitions using other symbols with given properties.
Example 3
The theory might be actually described in a detailed way. Let be a graph class described by the set of axioms in Example 2, where are defined by the axioms:
where is a distance or cost function. We can regard the theory extension , where is one of the theories , , or introduced in Theorem 8, and the theory in which are regarded as uninterpreted unary function symbols. Therefore, can be represented as a -local extension of the disjoint combination of a theory of real numbers and of pure equality, for a suitable closure operator. We can use the hierarchical reduction in Theorem 4 to check that and are valid w.r.t. .
In applications we might not be interested in checking the satisfiability of or the satisfiability of w.r.t. , but in a specific model satisfying (we refer to it as “canonical model”).
This is the case, for instance, in the applications in wireless network theory analyzed in Section 2: The vertices of the graphs considered in this context are very often points in the Euclidian space, and the distance is a concrete function which can be, for instance, the Euclidean metric, or a concrete cost function – which might satisfy additional properties (for instance positivity or symmetry). If we want to analyze such graph classes in full generality, we might assume that some of the properties of some of the parameters are not fully specified.
Let be a model of a theory describing properties of function symbols in a set we want to model. We assume that contains a set of “parameters” (function symbols whose properties are “underspecified” in ). In some situations, if we are given a set of constrained clauses, we might be interested in obtaining (weakest) universal conditions on such that for every fixed model of which also satisfies , there exists an interpretation for in for which is satisfied, i.e. . We present a situation in which this is possible.
Theorem 13
Let be a theory with signature , a set of constrained -clauses. Assume that the saturation of up to -redundancy w.r.t. is finite; let be the set of clauses in not containing .
Let be a set of parameters. Assume that one of the following conditions holds:
-
(i)
allows quantifier elimination or
-
(ii)
is a local theory extension satisfying condition for a suitable term closure operator and allows quantifier elimination.
If (i) holds, we can use quantifier elimination and if (ii) holds then we can use Algorithm 1 to obtain a (weakest) universal constraint on the parameters such that every model of is a model of (the universal closure of) , hence .
Proof: By the completeness of the hierarchical superposition calculus, is satisfiable iff the set of clauses in which do not contain is satisfiable. We denote by the formula represented by the set of clauses .
Let be a model of . Assume that is not a model for . Then is true in . In particular, it follows that is satisfiable. We can apply Algorithm 1 to construct a weakest universal formula over the signature with the property that is unsatisfiable, i.e. with the property that . Then every model of which also satisfies the constraints in is a model of .
Example 4
Consider again the situation described in Example 3. We show how one can use Theorem 2 and Algorithm 1 to derive constraints on the parameters under which for every model of
is unsatisfiable in (we consider the case in which is an uninterpreted function; other axioms for can be analyzed as well).
Note that the formula above is unsatisfiable in any model of whose support of sort has cardinality 1. If we only consider models with then we can proceed as follows:
Step 1: We purify the formula by introducing new constants: and obtain: .
Step 2: We quantify existentially all constants not denoting terms starting with – or used as arguments of – and obtain: .
Step 3: After quantifier elimination in a combination of and the theory of sets with cardinality with equality [36] we obtain .666We can consider only models whose support of sort is infinite. The theory that formalizes this is the model completion of the theory of pure equality which allows quantifier elimination. We can then use the method for quantifier elimination in combinations of theories with QE described in [36].
Step 4: We replace the constants with the terms they denote and quantify the arguments existentially and obtain: .
Step 5: We negate this condition and obtain: .
Example 5
We find an axiomatization for the graph class , when class is described by the set of constrained clauses in Example 2 and and satisfy conditions . Let be obtained by saturating under up to redundancy. A graph iff there exists a graph such that . This condition can be described by , where , which can be written in the form of constrained clauses as:
To find an axiomatization for the class we need to eliminate the second-order quantifier from the formula .
The base theory is , the extension of with the uninterpreted function symbol , with signature .
Since the background theory in this case is not arithmetic, and since the method for second-order quantifier elimination implemented in SCAN [18] is very similar to , we used SCAN on the clause set :
and obtained a set of clauses representing the formula containing axioms , where
and axioms :
The universal closure of the conjunction of these clauses is equivalent w.r.t. to the formula , and thus axiomatizes .
5.2 Case 2: Finite representation of possibly infinite saturated sets
The saturation of a set of constrained -clauses up to redundancy under might be infinite. We here consider a very special case under which a finite set of constrained -clauses can have a saturation that can be finitely described: The situation in which the set of clauses can be finitely saturated under ordered resolution.
Theorem 14
Let be a finite set of constrained -clauses and .
Assume that the saturation of under ordered resolution is finite, , and the set of all possible inferences used for deriving these clauses is finite and can be effectively described. If , then . Assume now that . Let be a model of , the theory with as canonical model (i.e. ). Let be the set of all instances of in which the variables are replaced with elements in (seen as constants). Then:
-
(1)
The saturation of up to -redundancy can be described as where are given by the minimal model of the constrained Horn clauses777The definitions are presented in Appendix 0.C. w.r.t. :
-
(2)
Let be the extension of with predicates whose interpretation is given by . Let be such that . Then iff is satisfiable w.r.t. .
Proof: Obviously, is satisfiable (it has one
trivial model, in which all predicate symbols are true).
If is a model of , in this theorem we consider constrained
Horn clauses over an assertion language that has one canonical model,
namely , i.e. w.r.t. the corresponding theory .
In [12] it is shown –
using a canonical model construction – that every set of
constrained Horn clauses
over an assertion language that has canonical models has a unique least
model.
This model is
defined inductively by taking
and
.
The construction stabilizes at the first limit ordinal with an interpretation ; so the set of constrained Horn clauses has a unique least model w.r.t. .
This construction of this unique least model parallels the saturation process for the set of ground instances of the clauses ; the saturated set is:
where are clauses in or are obtained (in a finite number of steps) from clauses in using resolution and/or factorization. If we allow for potentially infinite disjunctions it can be described as:
and models for can be built in a similar way to the way the interpretations for in the minimal model for are built.
To prove (2) note that the following are equivalent:
- (i)
;
- (ii)
There exists a -structure with and ;
- (iii)
;
- (iv)
;
- (v)
for every sequence of elements in ;
- (vi)
for every sequence of elements in ;
- (vii)
;
- (viii)
is satisfiable w.r.t. ;
where ( is the set of all clauses in () which do not contain .
(i) and (ii) are equivalent by definition; (ii) and (iii) by Theorem 11; (iii) and (iv) by Lemma 10; (iv) and (v) by the fact that the conjunction of all clauses of can be succinctly represented by taking a possibly infinite disjunction in the constraint in front of ; (v) and (vi) are equivalent due to (1); (vi) and (vii) by definition.
(vii) (viii): By assumption (vii), . Since are the interpretations of in the least model for w.r.t. it follows that , hence is satisfiable w.r.t. .
(viii) (vii): Assume now that is satisfiable w.r.t. , i.e. there exists an expansion of with interpretations for the predicates such that . Let be the least model of . It can be constructed with the canonical construction explained before, by considering the set of instances of clauses in with constants in and marking as true if we have a rule . Note that does not contribute to this model building process. This means that the least model of is actually the least model of , hence in the least model of the formula is true, which means that .
If has only one (canonical) model and is supported by [23], we can use for checking whether is satisfiable888If the set of constrained -clauses (hence the set of constrained Horn clauses ) contains at least one parameter then often returns “unknown”. In addition, if can prove satisfiability of for a non-parametric problem, the model it returns is not guaranteed to be minimal in general, and cannot be used for representing the saturated set of clauses. By Theorem 14 (2), satisfiability of is sufficient for proving the satisfiability of in this case..
Example 6
Consider the set consisting of the following constrained -clauses:
over the theory of integers without multiplication with model . Saturating without any simplification strategy yields the infinite set consisting of:
(i) We first show how Theorem 14 can be used in this case. Let , where and . We can saturate as follows: From and we can derive ; from and we can derive a clause of type , from and a clause of type and from and a clause of type . We obtain . By Theorem 14, the saturation of is :
,
where are given by the minimal model of :
cannot check whether this set of Horn constraints is satisfiable because of the parameter . If we replace with yields the following solution:
.
(ii) Alternatively, note that if we use the fact that we obtain an infinite set of clauses consisting of:
If we regard in each clause as a universally quantified variable (with additional condition ) we obtain:
If , iff .
Remark: In linear integer arithmetic the interpretations of in the minimal model of w.r.t. the model , for a fixed interpretation of (say as ) are: , and .
Example 6(ii) uses acceleration techniques, in particular the following result:
Theorem 15 ([14, 17])
Let be a set of constrained clauses of the form:
where describe vectors of variables, a vector of constants in , is a condition expressible in Presburger arithmetic and is a matrix over , and , where .
The interpretation of in the minimal model of is Presburger definable if is finite. If then the interpretation of in the minimal model of is Presburger definable if and only if is finite.
Acceleration techniques have been investigated e.g. for fragments of theories of arrays with read and write in the presence of iterators and selectors in [4]. Similar ideas are used in the superposition calculus in [16, 27], and in approaches which combine superposition and induction [31] or use solutions for recurrences in loop invariant generation [33, 32]. We plan to analyze such aspects in future work.
6 Checking Entailment
Let be a theory with signature , and let and be finite sequences of different predicate symbols with , and for .
Let be a universal -formula and be a universal -formula. We analyze the problem of checking whether “ entails w.r.t. ” holds.
Example 7
Such questions arise in the graph-theoretic problems discussed in Section 2. Let be a class of graphs described by axioms and be a class of graphs described by axioms . Let be a theory used for expressing these axioms. Consider the and transformations described in Section 2. Then (i.e. for every graph we have ) if and only if .
Assume that there exist -formulae and such that and . Such formulae can be found either by saturation999We can iterate the application of for variables (in this order). This corresponds to a variant of ordered resolution which we denote by ; if saturation terminates the conjunction of clauses not containing is equivalent to , where is the clause form of . by successively eliminating , or by using acceleration techniques or other methods. In this case, iff (which is the case iff ).
The problem of checking whether is in general undecidable, even if and are universal formulae and is the extension of Presburger arithmetic or real arithmetic with a new function or predicate symbol (cf. [44]).
If is in a fragment of for which checking satisfiability is decidable, then we can effectively check whether . This is obviously the case when is a decidable theory. We will show that a similar condition can be obtained for local theory extensions of theories allowing quantifier elimination if and are universal formulae and the extensions satisfy a certain “flatness property” which allows finite complete instantiation and that in both cases we can also generate constraints on “parameters” under which entailment holds.
Theorem 16
Assume that there exist -formulae and such that and . If is a decidable theory then we can effectively check whether . If has quantifier elimination and the formulae contain parametric constants, we can use quantifier elimination in to derive conditions on these parameters under which .
Theorem 17
Assume that there exist universal -formulae and such that and , and that , where is a decidable theory with signature where is a set of interpreted sorts and is a set of (universally quantified) clauses over , where (i) is a new set of uninterpreted sorts, (ii) are sets of new function, resp. predicate symbols which have only arguments of uninterpreted sort , and all function symbols in have interpreted output sort . Assume, in addition, that all variables and constants of sort in and occur below function symbols in . Then:
-
(1)
We can use the decision procedure for to effectively check whether (hence if ).
-
(2)
If allows quantifier elimination and the formulae (hence also ) contain parametric constants and functions, we can use Algorithm 1 for obtaining constraints on the parameters under which .
Proof: Let be the set of constants of uninterpreted sort occurring in and . Note that is satisfiable w.r.t. iff is satisfiable, where is the set of all instances of in which the variables of sort are replaced with constants of sort in . (1) The hierarchical reasoning method in Theorem 4 allows us to reduce testing whether to a satisfiability test w.r.t. . (2) If allows QE we can use Theorem 2.
6.1 Application: Checking class inclusion
We illustrate how Theorem 17 can be used for checking one of the class inclusions mentioned in Section 2.
Example 8
Let , be axiomatized by , where:
We want to check whether , where and is described by .
We obtain the axiomatization by eliminating from
and the axiomatization by eliminating from
We check whether , i.e. whether is unsatisfiable w.r.t. , where is the disjunction of the following ground formulae (we ignore the negation of the first clause obviously implied by ):
By Theorem 17 (2), we can consider the set of all instances of in which the variables of sort are replaced with the constants , then use a method for checking ground satisfiability of w.r.t. ( is uninterpreted), ( is positive), ( is symmetric) and ( is a metric). For this, we use H-PILoT [29] in which we enforce the right instantiation by adding relevant instances to the query. This allows us to check that is unsatisfiable for , but satisfiable for (this is so for all four theories).
For cases 4 and 5 we use an implementation of Algorithm 1, sehpilot to derive conditions on parameters under which is unsatisfiable. We give here two examples:
(1) We consider and to be parameters, i.e. we eliminate only from . For we get the condition
(2) We consider only to be a parameter, i.e. we eliminate the symbols and . For we obtain the condition
This condition holds e.g. if for all , i.e. if is a constant function. Adding this as an additional condition we get unsatisfiability of with for and , but not for and .
Checking the other inclusion We now check whether , where and . We have the axiomatizations , for the two classes.
We check whether , i.e. whether is unsatisfiable w.r.t. , where is the disjunction of the following ground formulae (we ignore the negation of the first clause obviously implied by ):
We use H-PILoT for checking ground satisfiability of w.r.t. . For and we obtain unsatisfiability of for , thus we have proved that the inclusion holds for these two theories. For and we get satisfiability for cases 2 and 3. We use Algorithm 1 to obtain conditions on parameters such that and is unsatisfiable.
If we consider and to be parameters, i.e. we eliminate only from we obtain the condition
It is easy to see that this condition holds if is symmetric.
7 Tests
We tested the methods we proposed on several examples. We used various tools for solving the various types of symbol elimination considered in this paper.
Second-order quantifier elimination. Since the implementations of the hierarchical superposition calculus we are aware of have as background theory linear arithmetic and in our examples we had more complex theories, we used a form of abstraction first: We renamed the constraints over more complex theories with new predicate symbols, and used SCAN [18] for second-order quantifier elimination. SCAN performs second-order quantifier elimination in first-order logic. It takes as input a formula of the form containing predicate symbols and applies a clause form transformation, ordered resolution and de-Skolemization on this formula. In case of termination and if de-Skolemization is possible, it returns a first-order formula equivalent to , which does not contain the predicate symbols .
Satisfiability checking and property-directed symbol elimination. For satisfiability checking we used H-PILoT [29] (after preparing the input such that the instances that have to be used are clear for the prover). H-PILoT carries out a hierarchical reduction to the base theory. Standard SMT provers or specialized provers can be used for testing the satisfiability of the formulae obtained after the reduction. H-PILoT uses eager instantiation and the hierarchical reduction, so provers like CVC4 [6] or Z3 [13, 11] are in general faster in proving unsatisfiability. The advantage of using H-PILoT is that knowing the instances needed for a complete instantiation allows us to correctly detect satisfiability (and generate models) in situations in which e.g. CVC4 returns “unknown”, and use property-directed symbol elimination to obtain additional constraints on parameters which ensure unsatisfiability.
For obtaining the constraints on parameters we used the method described in Algorithm 1 proposed in [41] which was implemented in sehpilot for the case in which the base theory is the theory of real-closed fields. sehpilot (Symbol Elimination with H-PILoT) receives a list of parameters as a command line (and possibly a list of already existing constraints on these parameters) and uses H-PILoT for the hierarchical reduction to a problem in the base theory (Step 1 in Algorithm 1) and for generating a corresponding REDLOG file. The constants are classified as required in Step 2 of Algorithm 1 and the REDLOG file is changed accordingly such that only those symbols that are not a parameter or argument of a parameter are considered to be existentially quantified. Redlog is used for quantifier elimination (Step 3 of Algorithm 1); then the constants contained in the obtained formula are replaced back with the terms they represent (Step 4). Finally, the formula obtained this way is negated (Redlog is used for further simplifications).
The way we used these tools is illustrated on some tests in Appendix 0.A.
8 Conclusions
In this paper, we analyzed possibilities of combining general second-order symbol elimination and property-directed symbol elimination. For eliminating existentially quantified predicates from universal first-order formulae we used a constrained resolution calculus (obtained from specializing the hierarchical superposition calculus). We analyzed situations in which saturation terminates and two possibilities of obtaining finite representations also in cases in which saturation might not terminate: (i) Using an encoding of the constraints of the saturated set of clauses as smallest fixpoints of certain families of constrained Horn clauses and (ii) using acceleration. For checking the satisfiability of families of constrained Horn clauses we used the fixpoint package of Z3 [23].
If the saturation terminates, or the infinite saturated set of clauses has a finite representation, we can use the obtained set of clauses for checking entailment. We proved a -locality property for a class of formulae; this allowed us to use the prover H-PILoT (after preparing the input such that the instances that have to be used are clear) for analyzing the satisfiability of formulae w.r.t. models in a theory and for checking entailment between formulae. Property-based symbol elimination proved useful for obtaining (weakest) constraints on “parameters” used in the description of the theory such that satisfiability or entailment is guaranteed in models satisfying .
In future work we would like to find possibilities of identifying situations in which second-order quantifier elimination using resolution terminates and study possibilities of using (and generalizing) methods based on constrained Horn clauses or acceleration for obtaining finite representations of potentially infinite clause sets. We would also like to analyze possibilities of checking entailment when the second-order quantifier elimination method returns a fixpoint and not a formula. (The main obstacle when working on this problem was that returns “unknown” in the presence of parameters.)
Acknowledgments: We thank Hannes Frey and Lucas Böltz for the numerous discussions we had on the problems in wireless networks discussed in Section 2, Renate Schmidt for maintaining a website where one can run SCAN online and for sending us the executables and instructions for running them. We thank the reviewers for their helpful comments.
References
- [1] M. Abdulaziz, K. Mehlhorn, and T. Nipkow. Trustworthy graph algorithms (invited talk). In P. Rossmanith, P. Heggernes, and J. Katoen, editors, Proc. 44th Int. Symposium on Mathematical Foundations of Computer Science (MFCS 2019), volume 138 of LIPIcs, pages 1:1–1:22. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019.
- [2] W. Ackermann. Untersuchungen über das Eliminationsproblem der mathematischen Logik. Mathematische Annalen, 110:390––413, 1935.
- [3] W. Ackermann. Zum Eliminationsproblem der mathematischen Logik. Mathematische Annalen, 111:61–63, 1935.
- [4] F. Alberti, S. Ghilardi, and N. Sharygina. Definability of accelerated relations in a theory of arrays and its applications. In P. Fontaine, C. Ringeissen, and R. A. Schmidt, editors, Frontiers of Combining Systems - 9th International Symposium, FroCoS 2013, Nancy, France, September 18-20, 2013. Proceedings, LNCS 8152, pages 23–39. Springer, 2013.
- [5] L. Bachmair, H. Ganzinger, and U. Waldmann. Refutational theorem proving for hierarchic first-order theories. Appl. Algebra Eng. Commun. Comput., 5:193–212, 1994.
- [6] C. W. Barrett, C. L. Conway, M. Deters, L. Hadarean, D. Jovanovic, T. King, A. Reynolds, and C. Tinelli. CVC4. In G. Gopalakrishnan and S. Qadeer, editors, Computer Aided Verification - 23rd International Conference, CAV 2011, Snowbird, UT, USA, July 14-20, 2011. Proceedings, LNCS 6806, pages 171–177. Springer, 2011.
- [7] L. Barrière, P. Fraigniaud, L. Narayanan, and J. Opatrny. Robust position-based routing in wireless ad hoc networks with irregular transmission ranges. Wireless Communications and Mobile Computing, 3(2):141–153, Mar 2003.
- [8] P. Baumgartner and U. Waldmann. Hierarchic superposition with weak abstraction. In M. P. Bonacina, editor, Automated Deduction - CADE-24 - 24th International Conference on Automated Deduction, Proceedings, LNCS 7898, pages 39–57. Springer, 2013.
- [9] P. Baumgartner and U. Waldmann. Hierarchic superposition revisited. In C. Lutz, U. Sattler, C. Tinelli, A. Turhan, and F. Wolter, editors, Description Logic, Theory Combination, and All That - Essays Dedicated to Franz Baader on the Occasion of His 60th Birthday, LNCS 11560, pages 15–56. Springer, 2019.
- [10] H. Behmann. Beiträge zur Algebra der Logik, insbesondere zum Entscheidungsproblem. Mathematische Annalen, 86(3-4):163–229, 1922.
- [11] N. Bjørner, L. de Moura, L. Nachmanson, and C. M. Wintersteiger. Programming Z3. In J. P. Bowen, Z. Liu, and Z. Zhang, editors, Engineering Trustworthy Software Systems - 4th International School, SETSS 2018, Chongqing, China, April 7-12, 2018, Tutorial Lectures, LNCS 11430, pages 148–201. Springer, 2019.
- [12] N. Bjørner, A. Gurfinkel, K. L. McMillan, and A. Rybalchenko. Horn clause solvers for program verification. In L. D. Beklemishev, A. Blass, N. Dershowitz, B. Finkbeiner, and W. Schulte, editors, Fields of Logic and Computation II - Essays Dedicated to Yuri Gurevich on the Occasion of His 75th Birthday, LNCS 9300, pages 24–51. Springer, 2015.
- [13] N. Bjørner and L. Nachmanson. Navigating the universe of Z3 theory solvers. In G. Carvalho and V. Stolz, editors, Formal Methods: Foundations and Applications - 23rd Brazilian Symposium, SBMF 2020, Ouro Preto, Brazil, November 25-27, 2020, Proceedings, LNCS 12475, pages 8–24. Springer, 2020.
- [14] B. Boigelot. Symbolic Methods for Exploring Infinite State Spaces. PhD thesis, Université de Liège, 1998.
- [15] B. Courcelle. The expression of graph properties and graph transformations in monadic second-order logic. In G. Rozenberg, editor, Handbook of Graph Grammars and Computing by Graph Transformations, Volume 1: Foundations, pages 313–400. World Scientific, 1997.
- [16] A. Fietzke, E. Kruglov, and C. Weidenbach. Automatic generation of invariants for circular derivations in SUP(LA). In N. Bjørner and A. Voronkov, editors, Logic for Programming, Artificial Intelligence, and Reasoning - 18th International Conference, LPAR-18, Mérida, Venezuela, March 11-15, 2012. Proceedings, LNCS 7180, pages 197–211. Springer, 2012.
- [17] A. Finkel and J. Leroux. How to compose Presburger-accelerations: Applications to broadcast protocols. In M. Agrawal and A. Seth, editors, FST TCS 2002: Foundations of Software Technology and Theoretical Computer Science, 22nd Conference, Proceedings, LNCS 2556, pages 145–156. Springer, 2002.
- [18] D. M. Gabbay and H. J. Ohlbach. Quantifier elimination in second–order predicate logic. In B. Nebel, C. Rich, and W. Swartout, editors, Principles of Knowledge Representation and Reasoning (KR92), pages 425–435. Morgan Kaufmann, 1992. Also published as a Technical Report MPI-I-92-231, Max-Planck-Institut für Informatik, Saarbrücken, and in the South African Computer Journal, 1992.
- [19] D. M. Gabbay, R. A. Schmidt, and A. Szalas. Second-Order Quantifier Elimination - Foundations, Computational Aspects and Applications, volume 12 of Studies in logic : Mathematical logic and foundations. College Publications, 2008.
- [20] H. Ganzinger. Relating semantic and proof-theoretic concepts for polynominal time decidability of uniform word problems. In 16th Annual IEEE Symposium on Logic in Computer Science, Proceedings, pages 81–90. IEEE Computer Society, 2001.
- [21] R. Givan and D. A. McAllester. Polynomial-time computation via local inference relations. ACM Trans. Comput. Log., 3(4):521–541, 2002.
- [22] V. Goranko, U. Hustadt, R. A. Schmidt, and D. Vakarelov. SCAN is complete for all sahlqvist formulae. In R. Berghammer, B. Möller, and G. Struth, editors, Relational and Kleene-Algebraic Methods in Computer Science: 7th International Seminar on Relational Methods in Computer Science and 2nd International Workshop on Applications of Kleene Algebra, LNCS 3051, pages 149–162. Springer, 2004.
- [23] K. Hoder, N. Bjørner, and L. M. de Moura. Z- an efficient engine for fixed points with constraints. In G. Gopalakrishnan and S. Qadeer, editors, Computer Aided Verification - 23rd International Conference, CAV 2011, Snowbird, UT, USA, July 14-20, 2011. Proceedings, LNCS 6806, pages 457–462. Springer, 2011.
- [24] K. Hoder, L. Kovács, and A. Voronkov. Interpolation and symbol elimination in Vampire. In J. Giesl and R. Hähnle, editors, Automated Reasoning, 5th International Joint Conference, IJCAR 2010, Proceedings, LNCS 6173, pages 188–195. Springer, 2010.
- [25] M. Horbach and V. Sofronie-Stokkermans. Obtaining finite local theory axiomatizations via saturation. In P. Fontaine, C. Ringeissen, and R. A. Schmidt, editors, Frontiers of Combining Systems - 9th International Symposium, FroCoS 2013, Proceedings, LNCS 8152, pages 198–213. Springer, 2013.
- [26] M. Horbach and V. Sofronie-Stokkermans. Locality transfer: From constrained axiomatizations to reachability predicates. In S. Demri, D. Kapur, and C. Weidenbach, editors, Automated Reasoning - 7th International Joint Conference, IJCAR 2014, Held as Part of the Vienna Summer of Logic, VSL 2014, Proceedings, LNCS 8562, pages 192–207. Springer, 2014.
- [27] M. Horbach and C. Weidenbach. Deciding the inductive validity of queries. In E. Grädel and R. Kahle, editors, Computer Science Logic, 23rd international Workshop, CSL 2009, 18th Annual Conference of the EACSL, Proceedings, LNCS 5771, pages 332–347. Springer, 2009.
- [28] C. Ihlemann, S. Jacobs, and V. Sofronie-Stokkermans. On local reasoning in verification. In C. R. Ramakrishnan and J. Rehof, editors, Tools and Algorithms for the Construction and Analysis of Systems, 14th International Conference, TACAS 2008, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2008, Budapest, Hungary, March 29-April 6, 2008. Proceedings, LNCS 4963, pages 265–281. Springer, 2008.
- [29] C. Ihlemann and V. Sofronie-Stokkermans. System description: H-PILoT. In R. A. Schmidt, editor, Automated Deduction - CADE-22, 22nd International Conference on Automated Deduction, Montreal, Canada, August 2-7, 2009. Proceedings, LNCS 5663, pages 131–139. Springer, 2009.
- [30] C. Ihlemann and V. Sofronie-Stokkermans. On hierarchical reasoning in combinations of theories. In J. Giesl and R. Hähnle, editors, Automated Reasoning, 5th International Joint Conference, IJCAR 2010, Proceedings, LNCS 6173, pages 30–45. Springer, 2010.
- [31] A. Kersani and N. Peltier. Combining superposition and induction: A practical realization. In P. Fontaine, C. Ringeissen, and R. A. Schmidt, editors, Frontiers of Combining Systems - 9th International Symposium, FroCoS 2013, Proceedings, LNCS 8152, pages 7–22. Springer, 2013.
- [32] L. Kovács. Invariant generation for p-solvable loops with assignments. In E. A. Hirsch, A. A. Razborov, A. L. Semenov, and A. Slissenko, editors, Computer Science - Theory and Applications, Third International Computer Science Symposium in Russia, CSR 2008, Proceedings, LNCS 5010, pages 349–359. Springer, 2008.
- [33] L. Kovács. Reasoning algebraically about p-solvable loops. In C. R. Ramakrishnan and J. Rehof, editors, Tools and Algorithms for the Construction and Analysis of Systems, 14th International Conference, TACAS 2008, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2008, Proceedings, LNCS 4963, pages 249–264. Springer, 2008.
- [34] L. Kovács and A. Voronkov. Interpolation and symbol elimination. In R. A. Schmidt, editor, Automated Deduction - CADE-22, 22nd International Conference on Automated Deduction, Proceedings, LNCS 5663, pages 199–213. Springer, 2009.
- [35] F. Kuhn, R. Wattenhofer, and A. Zollinger. Ad hoc networks beyond unit disk graphs. Wireless Networks, 14(5):715–729, Oct 2008.
- [36] D. Peuter and V. Sofronie-Stokkermans. On invariant synthesis for parametric systems. In P. Fontaine, editor, Automated Deduction - CADE 27 - 27th International Conference on Automated Deduction, Proceedings, LNCS 11716, pages 385–405. Springer, 2019.
- [37] D. Peuter and V. Sofronie-Stokkermans. Symbol elimination and applications to parametric entailment problems. In Proceedings of FroCoS 2021. Springer, 2021. To appear.
- [38] V. Sofronie-Stokkermans. Hierarchic reasoning in local theory extensions. In R. Nieuwenhuis, editor, Automated Deduction - CADE-20, 20th International Conference on Automated Deduction, Proceedings, LNCS 3632, pages 219–234. Springer, 2005.
- [39] V. Sofronie-Stokkermans. Hierarchic reasoning in local theory extensions. In Proceedings of the 20th International Conference on Automated Deduction (CADE), LNCS 3632, pages 219–234, Jul 2005.
- [40] V. Sofronie-Stokkermans. On interpolation and symbol elimination in theory extensions. In N. Olivetti and A. Tiwari, editors, Automated Reasoning - 8th International Joint Conference, IJCAR 2016, Proceedings, LNCS 9706, pages 273–289. Springer, 2016.
- [41] V. Sofronie-Stokkermans. On interpolation and symbol elimination in theory extensions. Log. Methods Comput. Sci., 14(3), 2018.
- [42] V. Sofronie-Stokkermans. On interpolation and symbol elimination in theory extensions. Log. Methods Comput. Sci., 14(3), 2018.
- [43] M. Voigt. Towards elimination of second-order quantifiers in the separated fragment. In P. Koopmann, S. Rudolph, R. A. Schmidt, and C. Wernhard, editors, Proceedings of the Workshop on Second-Order Quantifier Elimination and Related Topics (SOQE 2017), Dresden, Germany, December 6-8, 2017, volume 2013 of CEUR Workshop Proceedings, pages 67–81. CEUR-WS.org, 2017.
- [44] M. Voigt. Decidable fragments of first-order logic and of first-order linear arithmetic with uninterpreted predicates. PhD thesis, Saarland University, Saarbrücken, Germany, 2019.
Appendix 0.A Tests
We here present some of the tests we made for the examples in the paper. We show how we used the tools on these examples including the corresponding input and output files.
0.A.1 Tests for Example 3
We used H-PILoT to check that , and from Example 2 are valid w.r.t. . For this we show, one after the other, that the negation of each of these formulae is unsatisfiable w.r.t. . We start with . In the input file for H-PILoT we have the axioms for a metric specified under Clauses and the negation of is the Query.
H-PILoT performs the hierarchical reduction described in Theorem 10, then hands the reduced problem over to a prover to check for satisfiability. We here used Z3, which is also the default prover used by H-PILoT. We obtain the following output from H-PILoT:
The answer is “unsat” (unsatisfiable), so we have proved that is valid w.r.t. . In the same way we can prove validity of and w.r.t. , and also the validity of the three formulae w.r.t. , and .
Remark. The encoding in H-PILoT presented above did not use two different sorts and as described in the theoretical considerations. Since in our case the sort can be considered to be uninterpreted and there are no function symbols of arity , the following holds: Let be a flat ground formula over a signature containing a binary function and a unary function with the property that the only constraints on the constants used as arguments for and are equalities and disequalities. Then the following are equivalent:
-
(1)
is satisfiable w.r.t. the extension of with a binary function satisfying the metric axioms and a unary free function symbol .
-
(2)
is satisfiable w.r.t. the extension of the two-sorted theory with the free function .
Indeed, from every model of w.r.t. the extension of with a binary function satisfying the metric axioms and a unary free function symbol , we can define a model
of as follows:
-
•
Take as an isomorphic copy (via isomorphism ) of the set
, -
•
Define as follows:
-
–
;
-
–
.
-
–
The converse implication is analogous, with the only difference that we first construct a partial algebra by considering an injective map from the support of sort in and then we use the locality property of to prove the existence of a total model with support .
0.A.2 Tests for Example 4
We use sehpilot (an implementation of Algorithm 1) to derive constraints on the parameters such that
is unsatisfiable (we consider the case in which is an uninterpreted function). Since sehpilot first uses H-PILoT for the hierarchical reduction (and afterwards Redlog for quantifier elimination), the input file is in H-PILoT syntax:
Note that when using sehpilot the user has to specify which symbols have to be eliminated.
Assume that and are parameters (and thus should not be eliminated). Since the variable occurs as an argument of and (which are parameters), should not be eliminated. We have to eliminate the remaining symbols, i.e. and . We obtain the following output (in verbose mode) from sehpilot:
The generated constraint is exactly the constraint we obtained by applying Steps 1-5 of Algorithm 1 by hand in Example 4.
We used verbose mode for the output of sehpilot such that more details are displayed in the output file. This way one can follow easily the different steps. One can for example see which new constants are introduced in the hierarchical reduction (, and ) and which terms they represent. The output also shows the result obtained directly after the elimination (), the negation of this result (, and finally the universally quantified formula with the constants replaced back with the corresponding terms ().
Remark: The current implementation of sehpilot assumes that the problems are expressed in a local extension of the theory of real closed fields and a reduction to quantifier elimination in the theory of real-closed fields is performed. For the examples we considered this does not lead to loss of generality because the constraints on constants of sort are only equalities and disequalities. If variables initially of sort are eliminated, they do not occur below any parameter. Such variables occur separately from the variables of original sort in the quantifier elimination problem.
This means that the quantifier elimination problem is of the form
where are variables of sort and are variables of sort , which is equivalent to:
Quantifier elimination in the theory of real-closed fields can be used for the formula .
If we consider theories whose models of sort contain infinitely many elements, then – since the constraint contains only equalities and disequalities – the method for quantifier elimination in the theory of infinite sets can be simulated by the method for quantifier elimination in real closed fields. This is the reason why for this type of problems we can use quantifier elimination in the theory of real closed fields without problems.
0.A.3 Tests for Example 8
In order to check whether the class containment
holds we have to check whether is unsatisfiable for all (where is the axiomatization for and the are the ground formulae obtained from the negation of , the axiomatization of the other class; cf. Example 8).
We assume that is a metric. Using H-PILoT we can show that is unsatisfiable w.r.t. for . We here only show the test for the case in detail (the case is similar and yields the same results).
We check satisfiability of w.r.t. using H-PILoT. We have the following input file:
Note that the trivial equalities at the end of the file are used to ensure that H-PILoT computes sufficiently many instances. We obtain the following output from H-PILoT:
Since we know that is a -local theory extension and we ensured that H-PILoT computes sufficiently many instances, we know that is satisfiable. This means that the class inclusion does not hold in general. We use sehpilot to derive (weakest) conditions on parameters such that unsatisfiability of is guaranteed.
We first consider to be the only parameter, i.e. we tell sehpilot to eliminate and ( and appear as arguments of parameter and are therefore not eliminated). The input file is the same file that was used for checking satisfiability with H-PILoT. We get the following output (using verbose mode) from sehpilot:
Redlog does not simplify the results of the quantifier elimination very well, so in many cases one obtains long formulae, which sometimes can be simplified. In this case the constraint computed by sehpilot can be simplified to
We could also choose different parameters, e.g. we could assume and to be parameters and then tell sehpilot to eliminate only . In this case the computed constraint will be:
This constraint can be simplified to
Appendix 0.B Proof of Theorem 2
Theorem 2. Let be a set of -flat clauses, with the property that every variable occurs only once in every term. Let be a term closure operator with the property that for every flat set of ground terms , is flat.
Assume that and have the property that for every flat set of ground terms and for every clause , if contains terms and (where are extension functions and and are not necessarily different), if then . Then implies .
Proof: Assume that is not a -local extension of . Then there exists a set of ground clauses (with additional constants) such that but has a weak partial model in which all terms in are defined. We assume w.l.o.g. that , where contains no function symbols in and consists of ground unit clauses of the form where are constants in and .
We construct another structure, , having the same support as , which inherits all relations in and all maps in from , but on which the domains of definition of the -functions are restricted as follows: for every , is defined if and only if there exist constants such that is in and for all . In this case we define . The reduct of to coincides with that of . Thus, is a model of . By the way the operations in are defined in it is clear that satisfies , so satisfies .
We now show that . Let be a clause in . If is ground then all its terms are defined, and all terms starting with an extension function are contained in , i.e. , so is true in , hence it is also true in .
Now consider the case in which is not ground. Let be an arbitrary valuation. Again, if there is a term in such that is undefined, we immediately have that weakly satisfies . So let us suppose that for all terms occurring in , is defined. We associate with a substitution as follows: Let be a variable.We have the following possibilities:
Case 1: does not occur below any extension function. This case is unproblematic. We can define arbitrarily.
Case 2: occurs in a unique term (which may occur more than once) and occurs only once in . From the fact that is defined, we know that there are ground terms which we will denote by such that . Since is defined, . We can define .
Case 3: occurs in two or more terms of the form , , , but occurs at most once in any term of , where are function symbols, not necessarily different (but in terms starting with the same function symbols occurs on different positions).
From the fact that is defined, we know that there are ground terms which we will denote by such that for every with :
-
•
for and , and
-
•
,
i.e. .
We know that has the property that for every clause , if contains terms and and if
and
then also and.
This means that we can define for every linear variable; for every variable which occurs in different terms, let be one of the terms obtained as before (say ) and define .
Thus, we can construct a substitution with and . As we can infer .
We now show that is closed under . By definition, iff there exist with for all and . Thus,
As , weakly embeds into a total algebra satisfying . But then , so , which is a contradiction.
Remark: A similar result can be proved also in the case in which
some variables occur several times below a function symbol
if has the property that
if
and
then
and .
Appendix 0.C Constrained Horn Clauses: Definitions
We give the definitions of constrained Horn clauses, mainly following the presentation in [12].
Definition 5 ([12])
Conjunctions of constrained Horn clauses are constructed as follows:
A clause where the head is a formula is called a query or a goal clause. The terminology “fact clause” is used for a clause whose head is an uninterpreted predicate and body is a formula .
It is easy to see that in Theorem 14, if we guarantee that the formulae are formulae whose terms and predicates are interpreted over then all clauses of the form
are constrained Horn clauses, hence:
is a set of constrained Horn clauses.