This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: University Koblenz-Landau, Germany

Symbol Elimination for Parametric Second-Order Entailment Problems
(with Applications to Problems in Wireless Network Theory)

Dennis Peuter    Philipp Marohn and Viorica Sofronie-Stokkermans
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 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} of the hierarchical superposition calculus (a form of ordered resolution) for eliminating a predicate symbol PP.

  • 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 𝒯{\mathcal{T}} and a ground formula GG satisfiable w.r.t. 𝒯{\mathcal{T}}, the goal is to derive a (weakest) universal formula Γ\Gamma over a subset of the signature, such that ΓG\Gamma\wedge G is unsatisfiable w.r.t. 𝒯{\mathcal{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 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} calculus we use for eliminating predicate PP, 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 𝐔𝐃𝐆{\bf UDG} of unit disk graphs (two nodes are connected iff they are different and their distance is 1\leq 1); the class 𝐐𝐔𝐃𝐆(r){\bf QUDG}(r) of quasi unit disk graphs, for r(0,1]r\in(0,1] (two distinct nodes with distance r\leq r are always connected and nodes with distance >1>1 are never connected); the class 𝐃𝐓𝐆(𝐫,r){\bf DTG}(\mathbf{r},r) of directed transmission graphs for r>0r>0 (every node vv has a maximum communication distance 𝐫(v)r{\mathbf{r}}(v)\leq r; an edge from vv to ww exists iff vwv\neq w and the distance between vv and ww is 𝐫(v)\leq{\mathbf{r}}(v)).

Many graph classes 𝐂(p¯){\bf C}({\overline{p}}) (where p¯{\overline{p}} 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 𝐂{\bf C} the condition under which an edge E(u,v)E(u,v) must exist can be described by a formula πCi(u,v)\pi_{C}^{i}(u,v). Therefore, inclusion axioms have the form:

(1)u,v(πCi(u,v)E(u,v))(1)\quad\quad\forall u,v~{}(\pi_{C}^{i}(u,v)\rightarrow E(u,v))

The exclusion axioms specify which edges are not allowed to exist. For a class 𝐂{\bf C} the condition under which an edge E(u,v)E(u,v) is not allowed to exist can be described by a formula πCe(u,v)\pi_{C}^{e}(u,v). Therefore, transfer axioms have the form:

(2)u,v(πCe(u,v)¬E(u,v))(2)\quad\quad\forall u,v~{}(\pi_{C}^{e}(u,v)\rightarrow\lnot E(u,v))

The transfer axioms specify which edges E(u,w)E(u,w) must exist as a consequence of the existence of another edge E(u,v)E(u,v). For a class 𝐂{\bf C}, we describe these these conditions by a formula πCt(u,v,w)\pi_{C}^{t}(u,v,w). Therefore, inclusion axioms have the form:

(3)u,v,wπCt(u,w,v)E(u,v)E(u,w)(3)\quad\quad\forall u,v,w~{}\pi_{C}^{t}(u,w,v)\land E(u,v)\rightarrow E(u,w).

If the description of the graph class 𝐂{\bf C} depends on parameters p¯{\overline{p}}, the formulae πCi,πCe\pi_{C}^{i},\pi_{C}^{e} and πCt\pi_{C}^{t} might contain parameters. We will sometimes indicate this by adding the parameters to the arguments, i.e. writing πCi(u,v,p¯),πCe(u,v,p¯)\pi_{C}^{i}(u,v,{\overline{p}}),\pi_{C}^{e}(u,v,{\overline{p}}) resp. πCt(u,v,w,p¯)\pi_{C}^{t}(u,v,w,{\overline{p}}).

We can, e.g., define the classes 𝐌𝐢𝐧𝐃𝐆(r){\bf MinDG}(r), 𝐌𝐚𝐱𝐃𝐆(r){\bf MaxDG}(r) and 𝐂𝐑𝐆{\bf CRG} using axioms:

  • 𝖬𝗂𝗇𝖣𝖦(r){\sf MinDG}(r): axiom (1)(1), where πi(u,v,r)\pi^{i}(u,v,r) is the formula uvd(u,v)ru\neq v\land d(u,v)\leq r;

  • 𝖬𝖺𝗑𝖣𝖦(r){\sf MaxDG}(r): axiom (2)(2), where πe(u,v,r)\pi^{e}(u,v,r) is the formula d(u,v)>rd(u,v)>r;

  • 𝖢𝖱𝖦{\sf CRG}: axiom (3)(3), where πt(u,w,v)\pi^{t}(u,w,v) is the formula uwd(u,w)d(u,v)u\neq w\land d(u,w)\leq d(u,v),

(where rr is supposed to be a parameter).

With this notation, the inclusion axiom 𝖬𝗂𝗇𝖣𝖦(r){\sf MinDG}(r) states that if uvu\neq v and d(u,v)rd(u,v)\leq r an edge from uu to vv must exist; the exclusion axiom 𝖬𝖺𝗑𝖣𝖦(r){\sf MaxDG}(r) states that if d(u,v)>rd(u,v)>r then we are not allowed to have an edge from uu to vv. The transfer axiom 𝖢𝖱𝖦{\sf CRG} states that if uu and ww are different and there is an edge from uu to vv and d(u,w)d(u,v)d(u,w)\leq d(u,v) then there must exist an edge also from uu to ww.

By combining such axioms we obtain axiomatizations for new graph classes. If the classes 𝐀{\bf A} and 𝐁{\bf B} of graphs are axiomatized by axioms 𝖠𝗑𝖠{\sf Ax_{A}} and 𝖠𝗑𝖡{\sf Ax_{B}} then 𝖠𝗑𝖠𝖠𝗑𝖡{\sf Ax_{A}}\wedge{\sf Ax_{B}} is an axiomatization for the intersection 𝐀𝐁{\bf A}\cap{\bf B}.
For instance, the class 𝐔𝐃𝐆=𝐌𝐢𝐧𝐃𝐆(1)𝐌𝐚𝐱𝐃𝐆(1){\bf UDG}={\bf MinDG}(1)\cap{\bf MaxDG}(1) is axiomatized by 𝖬𝗂𝗇𝖣𝖦(1)𝖬𝖺𝗑𝖣𝖦(1){\sf MinDG}(1)\wedge{\sf MaxDG}(1).

We may want to check whether a graph class 𝐂(p¯){\bf C}({\overline{p}}) has non-empty models, or to determine (weakest) conditions on the parameters p¯{\overline{p}} 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 γ\gamma on graphs that transform the edges and leave the set of vertices unchanged, and form graph classes

γ(𝐂)={γ(G)G𝐂}.\gamma({\bf C})=\{\gamma(G)\mid G\in{\bf C}\}.

Two examples of transformations are +\cdot^{+} and \cdot^{-}: Given a graph G=(V,E)G=(V,E), we can build the symmetric supergraph G+=(V,E+)G^{+}=(V,E^{+}) resp. symmetric subgraph G=(V,E)G^{-}=(V,E^{-}), defined by:

x,y(E+(x,y)(E(x,y)E(y,x)))x,y(E(x,y)(E(x,y)E(y,x))).\begin{array}[]{l}\forall x,y~{}(E^{+}(x,y)\leftrightarrow(E(x,y)\lor E(y,x)))\\ \forall x,y~{}(E^{-}(x,y)\leftrightarrow(E(x,y)\land E(y,x))).\end{array}

We can thus define the classes 𝐂+={G+G𝐂}{\bf C}^{+}=\{G^{+}\mid G\in{\bf C}\} and 𝐂={GG𝐂}{\bf C}^{-}=\{G^{-}\mid G\in{\bf C}\}.

The class of quasi unit disk graphs [7, 35] can, for instance, be described as

𝐐𝐔𝐃𝐆(r)=(𝐌𝐢𝐧𝐃𝐆(r)𝐌𝐚𝐱𝐃𝐆(1)).{\bf QUDG}(r)=({\bf MinDG}(r)\cap{\bf MaxDG}(1))^{-}.

We might want to obtain an axiomatization for 𝐐𝐔𝐃𝐆(r){\bf QUDG}(r) that depends only on the predicates πi(x,y,r),πe(x,y,1)\pi^{i}(x,y,r),\pi^{e}(x,y,1) or test whether the class is the same as the class described by (𝐌𝐢𝐧𝐃𝐆(r)𝐌𝐚𝐱𝐃𝐆(1))+({\bf MinDG}(r)\cap{\bf MaxDG}(1))^{+}.

To find an axiomatization of a graph class γ(𝐂)\gamma({\bf C}), where γ\gamma is a transformation, we need to find a first-order formula equivalent to E(𝖭E𝖳𝗋(E,E)),\exists E^{\prime}({\sf N}_{E^{\prime}}\cap{\sf Tr}(E^{\prime},E)), where 𝖭E{\sf N}_{E^{\prime}} is a class of clauses describing class 𝐂{\bf C} and 𝖳𝗋{\sf Tr} is a formula describing the way the edges of the graph (V,E)=γ(V,E)(V,E)=\gamma(V,E^{\prime}) can be obtained from the description of the graph (V,E)(V,E^{\prime}). 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 Π=(S,Σ,𝖯𝗋𝖾𝖽)\Pi=(S,\Sigma,{\sf Pred}), where SS is a set of sorts, Σ\Sigma is a family of function symbols and 𝖯𝗋𝖾𝖽{\sf Pred} a family of predicate symbols, such that for every function symbol ff (resp. predicate symbol pp) their arity a(f)=s1snsa(f)=s_{1}\dots s_{n}\rightarrow s (resp. a(p)=s1sma(p)=s_{1}\dots s_{m}), where s1,,sn,sSs_{1},\dots,s_{n},s\in S, is specified. If CC is a fixed countable set of fresh constants, we denote by ΠC\Pi^{C} the extension of Π\Pi with constants in CC. We assume known standard definitions from first-order logic such as Π\Pi-structure, model, satisfiability, unsatisfiability. A Π\Pi-structure is a tuple

𝒜=({As}sS,{f𝒜}fΣ,{p𝒜}p𝖯𝗋𝖾𝖽),{\mathcal{A}}=(\{A_{s}\}_{s\in S},\{f_{\mathcal{A}}\}_{f\in\Sigma},\{p_{\mathcal{A}}\}_{p\in{\sf Pred}}),

where, for every sSs\in S, AsA_{s} is a non-empty set (the universe of sort ss of the structure), for every fΣf\in\Sigma with arity s1snss_{1}\dots s_{n}\rightarrow s, f𝒜:As1××AsnAsf_{\mathcal{A}}:A_{s_{1}}\times\dots\times A_{s_{n}}\rightarrow A_{s}, and for every p𝖯𝗋𝖾𝖽p\in{\sf Pred} with arity s1sms_{1}\dots s_{m}, p𝒜As1××Asmp_{\mathcal{A}}\subseteq A_{s_{1}}\times\dots\times A_{s_{m}}.

If 𝒜\mathcal{A} is a Π\Pi-structure, we will denote by 𝒜A\mathcal{A}^{A} the extension of 𝒜\mathcal{A}, where we have an additional constant (of sort ss) for each element aa of sort ss of 𝒜\mathcal{A} (which we denote with the same symbol) with the natural interpretation mapping the constant aa to the element aa of 𝒜\mathcal{A}.

If ΠΠ\Pi\subseteq\Pi^{\prime} and 𝒜\mathcal{A} is a Π\Pi^{\prime}-structure, we denote its reduct to Π\Pi by 𝒜|Π\mathcal{A}_{|\Pi}.

Notation. We will denote with (indexed versions of) x,y,zx,y,z variables and with (indexed versions of) a,b,c,da,b,c,d constants; x¯{\overline{x}} will stand for a sequence of variables x1,,xnx_{1},\dots,x_{n}, and c¯{\overline{c}} for a sequence of constants c1,,cnc_{1},\dots,c_{n}.

Theories. Theories can be defined by specifying a set of axioms, or by specifying a class of structures (the models of the theory). If FF and GG are formulae we write FGF\models G (resp. F𝒯GF\models_{\cal T}G – also written as 𝒯FG{\cal T}\cup F\models G) to express the fact that every model of FF (resp. every model of FF which is also a model of 𝒯{\mathcal{T}}) is a model of GG. We denote “falsum” with \perp. FF\models\perp means that FF is unsatisfiable; F𝒯F\models_{{\mathcal{T}}}\perp means that there is no model of 𝒯{\mathcal{T}} in which FF is true.

A theory 𝒯{\mathcal{T}} over a signature Π\Pi allows quantifier elimination (QE) if for every formula ϕ\phi over Π\Pi there exists a quantifier-free formula ϕ\phi^{*} over Π\Pi which is equivalent to ϕ\phi modulo 𝒯{\mathcal{T}}. Examples of theories which allow quantifier elimination are rational and real linear arithmetic (𝖫𝖨(){\sf LI}({\mathbb{Q}}), 𝖫𝖨(){\sf LI}({\mathbb{R}})), 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 Π0=(Σ0,𝖯𝗋𝖾𝖽)\Pi_{0}{=}(\Sigma_{0},{\sf Pred}) be a signature, and 𝒯0{\mathcal{T}}_{0} be a “base” theory with signature Π0\Pi_{0}. We consider extensions 𝒯:=𝒯0𝒦{\mathcal{T}}:={\mathcal{T}}_{0}\cup{\mathcal{K}} of 𝒯0{\mathcal{T}}_{0} with new function symbols Σ\Sigma (extension functions) whose properties are axiomatized using a set 𝒦{\mathcal{K}} of (universally closed) clauses in the extended signature Π=(Σ0Σ,𝖯𝗋𝖾𝖽)\Pi=(\Sigma_{0}\cup\Sigma,{\sf Pred}), such that each clause in 𝒦{\mathcal{K}} contains function symbols in Σ\Sigma. Especially well-behaved are the Ψ\Psi-local theory extensions, i.e. theory extensions 𝒯0𝒯0𝒦{\mathcal{T}}_{0}\subseteq{\mathcal{T}}_{0}\cup{\mathcal{K}} as defined above, in which checking ground satisfiability can be done using a finite instantiation scheme described by a suitable closure operator Ψ\Psi, without loss of completeness. We express this with the following condition:

(𝖫𝗈𝖼fΨ){\sf(Loc}^{\Psi}_{f}) For every finite set GG of ground ΠC\Pi^{C}-clauses (for an additional
set CC of constants) it holds that 𝒯0𝒦G{\mathcal{T}}_{0}\cup{\mathcal{K}}\cup G\models\bot if and only if
𝒯0𝒦[Ψ𝒦(G)]G{\mathcal{T}}_{0}\cup{\mathcal{K}}[\Psi_{\mathcal{K}}(G)]\cup G is unsatisfiable.

where, for every set GG of ground ΠC\Pi^{C}-clauses, 𝒦[Ψ𝒦(G)]{\mathcal{K}}[\Psi_{\mathcal{K}}(G)] is the set of instances of 𝒦{\mathcal{K}} in which the terms starting with a function symbol in Σ\Sigma are in Ψ𝒦(G)=Ψ(𝖾𝗌𝗍(𝒦,G))\Psi_{{\mathcal{K}}}(G)=\Psi({\sf est}({\mathcal{K}},G)), where 𝖾𝗌𝗍(𝒦,G){\sf est}({\mathcal{K}},G) is the set of ground terms starting with a function in Σ\Sigma occurring in GG or 𝒦{\mathcal{K}}.

If 𝒯0{\mathcal{T}}_{0} is the pure theory of equality, we obtain the notion of locality [21, 20].

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 Ψ\Psi-local theory extensions and generalizations thereof. We introduce the main definitions here, following mainly the presentation from [30] and [42].

Let Π=(Σ,𝖯𝗋𝖾𝖽)\Pi=(\Sigma,{\sf Pred}) be a first-order signature with set of function symbols Σ\Sigma and set of predicate symbols 𝖯𝗋𝖾𝖽{\sf Pred}. A partial Π\Pi-structure is a structure 𝒜=(A,{f𝒜}fΣ,{p𝒜}p𝖯𝗋𝖾𝖽)\mathcal{A}=(A,\{f_{\mathcal{A}}\}_{f\in\Sigma},\{p_{\mathcal{A}}\}_{p\in{\sf Pred}}), where AA is a non-empty set, for every nn-ary fΣf\in\Sigma, f𝒜f_{\mathcal{A}} is a partial function from AnA^{n} to AA, and for every nn-ary p𝖯𝗋𝖾𝖽p\in{\sf Pred}, p𝒜Anp_{\mathcal{A}}\subseteq A^{n}. We consider constants (0-ary functions) to be always defined. 𝒜\mathcal{A} is called a total structure if the functions f𝒜f_{\mathcal{A}} are all total. Given a (total or partial) Π\Pi-structure 𝒜\mathcal{A} and Π0Π\Pi_{0}\subseteq\Pi we denote the reduct of 𝒜\mathcal{A} to Π0\Pi_{0} by 𝒜|Π0\mathcal{A}{|_{\Pi_{0}}}.

The notion of evaluating a term tt with variables XX w.r.t. an assignment β:XA\beta:X\rightarrow A for its variables in a partial structure 𝒜\mathcal{A} is the same as for total algebras, except that the evaluation is undefined if t=f(t1,,tn)t=f(t_{1},\ldots,t_{n}) and at least one of β(ti)\beta(t_{i}) is undefined, or else (β(t1),,β(tn))(\beta(t_{1}),\ldots,\beta(t_{n})) is not in the domain of f𝒜f_{\mathcal{A}}.

Definition 1

A weak Π\Pi-embedding between two partial Π\Pi-structures 𝒜\mathcal{A} and \mathcal{B}, where 𝒜=(A,{f𝒜}fΣ,{p𝒜}p𝖯𝗋𝖾𝖽)\mathcal{A}=(A,\{f_{\mathcal{A}}\}_{f\in\Sigma},\{p_{\mathcal{A}}\}_{p\in{\sf Pred}}) and =(B,{f}fΣ,{p}p𝖯𝗋𝖾𝖽)\mathcal{B}=(B,\{f_{\mathcal{B}}\}_{f\in\Sigma},\{p_{\mathcal{B}}\}_{p\in{\sf Pred}}) is a total map φ:AB\varphi:A\rightarrow B such that

  1. (i)

    φ\varphi is an embedding w.r.t. 𝖯𝗋𝖾𝖽{=}{\sf Pred}\cup\{=\}, i.e. for every p𝖯𝗋𝖾𝖽p\in{\sf Pred} with arity nn and every a1,,an𝒜a_{1},\dots,a_{n}\in\mathcal{A}, (a1,,an)p𝒜(a_{1},\dots,a_{n})\,{\in}\,p_{\mathcal{A}} if and only if (φ(a1),,φ(an))p(\varphi(a_{1}),\dots,\varphi(a_{n}))\,{\in}\,p_{\mathcal{B}}.

  2. (ii)

    whenever f𝒜(a1,,an)f_{\mathcal{A}}(a_{1},\dots,a_{n}) is defined (in 𝒜\mathcal{A}), then f(φ(a1),,φ(an))f_{\mathcal{B}}(\varphi(a_{1}),\dots,\varphi(a_{n})) is defined (in \mathcal{B}) and φ(f𝒜(a1,,an))=f(φ(a1),,φ(an))\varphi(f_{\mathcal{A}}(a_{1},\dots,a_{n}))=f_{\mathcal{B}}(\varphi(a_{1}),\dots,\varphi(a_{n})), for all fΣf\in\Sigma.

Definition 2 (Weak validity)

Let 𝒜\mathcal{A} be a partial Π\Pi-algebra and β:XA\beta:X{\rightarrow}A a valuation for its variables. (𝒜,β)(\mathcal{A},\beta) weakly satisfies a clause CC (notation: (𝒜,β)wC(\mathcal{A},\beta)\models_{w}C) if either some of the literals in β(C)\beta(C) are not defined or otherwise all literals are defined and for at least one literal LL in CC, LL is true in 𝒜\mathcal{A} w.r.t. β\beta. 𝒜\mathcal{A} is a weak partial model of a set of clauses 𝒦{\mathcal{K}} if (𝒜,β)wC(\mathcal{A},\beta)\models_{w}C for every valuation β\beta and every clause CC in 𝒦{\mathcal{K}}.

Recognizing Ψ\Psi-local theory extensions. In [38] we proved that if every weak partial model of an extension 𝒯0𝒦{\mathcal{T}}_{0}\cup{\mathcal{K}} of a base theory 𝒯0{\mathcal{T}}_{0} 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 Ψ\Psi-locality.

Let 𝒜=(A,{f𝒜}fΣ0ΣC,{p𝒜}p𝖯𝗋𝖾𝖽)\mathcal{A}=(A,\{f_{\mathcal{A}}\}_{f\in\Sigma_{0}\cup\Sigma}\cup C,\{p_{\mathcal{A}}\}_{p\in{\sf Pred}}) be a partial ΠC\Pi^{C}-structure with total Σ0\Sigma_{0}-functions. Let ΠA\Pi^{A} be the extension of the signature Π\Pi with constants from AA. We denote by T(𝒜)T(\mathcal{A}) the following set of ground ΠA\Pi^{A}-terms:

T(𝒜):={f(a1,,an)|fΣ,aiA,i=1,,n,f𝒜(a1,,an) is defined }.T(\mathcal{A}):=\{f(a_{1},...,a_{n})\,|\;f\in\Sigma,a_{i}\in A,i=1,\dots,n,f_{\mathcal{A}}(a_{1},...,a_{n})\text{ is defined }\}.

Let 𝖯𝖬𝗈𝖽w,fΨ(Σ,𝒯){\sf PMod}_{w,f}^{\Psi}({\Sigma},{\mathcal{T}}) be the class of all weak partial models 𝒜\mathcal{A} of 𝒯0𝒦{\mathcal{T}}_{0}\cup{\mathcal{K}}, such that 𝒜|Π0\mathcal{A}{|_{\Pi_{0}}} is a total model of 𝒯0{\mathcal{T}}_{0}, the Σ\Sigma-functions are possibly partial, T(𝒜)T(\mathcal{A}) is finite and all terms in Ψ(𝖾𝗌𝗍(𝒦,T(𝒜)))\Psi({\sf est}({\mathcal{K}},T(\mathcal{A}))) are defined (in the extension 𝒜A\mathcal{A}^{A} with constants from AA). We consider the following embeddability property of partial algebras:

(𝖤𝗆𝖻w,fΨ)({\sf Emb}_{w,f}^{\Psi}) Every 𝒜𝖯𝖬𝗈𝖽w,fΨ(Σ,𝒯)\mathcal{A}\in{\sf PMod}_{w,f}^{\Psi}({\Sigma},{\mathcal{T}}) weakly embeds into a total model of 𝒯{\mathcal{T}}.

We also consider the property (𝖤𝖤𝗆𝖻w,fΨ)({\sf EEmb}_{w,f}^{\Psi}), which additionally requires the embedding to be elementary, and the property (𝖢𝗈𝗆𝗉fΨ)({\sf Comp}^{\Psi}_{f}), which requires that every structure 𝒜𝖯𝖬𝗈𝖽w,fΨ(Σ,𝒯)\mathcal{A}\in{\sf PMod}_{w,f}^{\Psi}({\Sigma},{\mathcal{T}}) embeds into a total model of 𝒯{\mathcal{T}} with the same support. If Ψ\Psi is the identity, we refer to these properties as (𝖤𝗆𝖻w,f)({\sf Emb}_{w,f}), (𝖤𝖤𝗆𝖻w,f)({\sf EEmb}_{w,f}) and 𝖢𝗈𝗆𝗉f{\sf Comp}_{f}.

When establishing links between locality and embeddability we require that the clauses in 𝒦{\mathcal{K}} are flat and linear w.r.t. Σ\Sigma-functions. When defining these notions we distinguish between ground and non-ground clauses.

Definition 3

An extension clause DD is flat (resp. quasi-flat) when all symbols below a Σ\Sigma-function symbol in DD are variables (resp. variables or ground Π0\Pi_{0}-terms). DD is linear if whenever a variable occurs in two terms of DD starting with Σ\Sigma-functions, the terms are equal, and no term contains two occurrences of a variable.

A ground clause DD is flat if all symbols below a Σ\Sigma-function in DD are constants. A ground clause DD is linear if whenever a constant occurs in two terms in DD whose root symbol is in Σ\Sigma, the two terms are identical, and no term which starts with a Σ\Sigma-function contains two occurrences of the same constant.

Definition 4 ([30])

With the above notations, let Ψ\Psi be a map associating with 𝒦{\mathcal{K}} and a set of ΠC\Pi^{C}-ground terms TT a set Ψ𝒦(T)\Psi_{{\mathcal{K}}}(T) of ΠC\Pi^{C}-ground terms. We call Ψ𝒦\Psi_{{\mathcal{K}}} a term closure operator if the following holds for all sets of ground terms T,TT,T^{\prime}:

  1. (1)

    est(𝒦,T)Ψ𝒦(T)\mathrm{est}({\mathcal{K}},T)\subseteq\Psi_{{\mathcal{K}}}(T),

  2. (2)

    TTΨ𝒦(T)Ψ𝒦(T)T\subseteq T^{\prime}\Rightarrow\Psi_{{\mathcal{K}}}(T)\subseteq\Psi_{{\mathcal{K}}}(T^{\prime}),

  3. (3)

    Ψ𝒦(Ψ𝒦(T))Ψ𝒦(T)\Psi_{{\mathcal{K}}}(\Psi_{{\mathcal{K}}}(T))\subseteq\Psi_{{\mathcal{K}}}(T),

  4. (4)

    for any map h:CCh:C\rightarrow C, h¯(Ψ𝒦(T))=Ψh¯𝒦(h¯(T))\bar{h}(\Psi_{{\mathcal{K}}}(T))=\Psi_{\bar{h}{\mathcal{K}}}(\bar{h}(T)), where h¯\bar{h} is the canonical extension of hh to extension ground terms.

Theorem 1 ([28, 30])

Let 𝒯0{\mathcal{T}}_{0} be a first-order theory and 𝒦{\mathcal{K}} a set of universally closed flat clauses in the signature Π\Pi. The following hold:

  1. (1)

    If all clauses in 𝒦{\mathcal{K}} are linear and Ψ\Psi is a term closure operator with the property that for every flat set of ground terms TT, Ψ(T)\Psi(T) is flat then either of the conditions (𝖤𝗆𝖻w,fΨ)({\sf Emb}_{w,f}^{\Psi}) and (𝖤𝖤𝗆𝖻w,fΨ)({\sf EEmb}_{w,f}^{\Psi}) implies (𝖫𝗈𝖼fΨ)({\sf Loc}_{f}^{\Psi}).

  2. (2)

    If the extension 𝒯0𝒯=𝒯0𝒦{\mathcal{T}}_{0}\subseteq{\mathcal{T}}{=}{\mathcal{T}}_{0}{\cup}{\mathcal{K}} satisfies (𝖫𝗈𝖼fΨ)({\sf Loc}_{f}^{\Psi}) then (𝖤𝗆𝖻w,fΨ)({\sf Emb}_{w,f}^{\Psi}) holds.

The linearity assumption needed to prove that (𝖤𝗆𝖻w,fΨ)({\sf Emb}_{w,f}^{\Psi}) implies (𝖫𝗈𝖼fΨ)({\sf Loc}_{f}^{\Psi}) can be relaxed if the closure operator Ψ\Psi has additional properties.

Theorem 2

Let 𝒦{\mathcal{K}} be a set of Σ\Sigma-flat clauses, with the property that every variable occurs only once in every term. Let Ψ\Psi be a term closure operator with the property that for every flat set of ground terms TT, Ψ(T)\Psi(T) is flat.

Assume that 𝒦{\mathcal{K}} and Ψ\Psi have the property that for every flat set of ground terms TT and for every clause C𝒦C\in{\mathcal{K}}, if CC contains terms f(x1,,x,,xn)f(x_{1},\dots,x,\dots,x_{n}) and g(y1,,x,,ym)g(y_{1},\dots,x,\dots,y_{m}) (where f,gΣf,g\in\Sigma are extension functions and ff and gg are not necessarily different), if f(t1,,t,,tn),g(s1,,s,,sm)Ψ𝒦(T)f(t_{1},\dots,t,\dots,t_{n}),g(s_{1},\dots,s,\dots,s_{m})\in\Psi_{{\mathcal{K}}}(T) then f(t1,,s,,tn),g(s1,,t,,sm)Ψ𝒦(T)f(t_{1},\dots,s,\dots,t_{n}),g(s_{1},\dots,t,\dots,s_{m})\in\Psi_{{\mathcal{K}}}(T). Then (𝖤𝗆𝖻w,fΨ)({\sf Emb}_{w,f}^{\Psi}) implies (𝖫𝗈𝖼fΨ)({\sf Loc}_{f}^{\Psi}).

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 Ψ𝒦\Psi_{{\mathcal{K}}} has the property that if f(x1,,x,,x,xn)𝒦f(x_{1},\dots,x,\dots,x,\dots x_{n})\in{\mathcal{K}} and f(t1,,s,,t,,tn)Ψ𝒦(T)f(t_{1},\dots,s,\dots,t,\dots,t_{n})\in\Psi_{{\mathcal{K}}}(T) then f(t1,,t,,t,,tn)Ψ𝒦(T)f(t_{1},\dots,t,\dots,t,\dots,t_{n})\in\Psi_{{\mathcal{K}}}(T) and f(t1,,s,,s,,tn)Ψ𝒦(T)f(t_{1},\dots,s,\dots,s,\dots,t_{n})\in\Psi_{{\mathcal{K}}}(T). \Box

Theorem 3 ([39, 28])

The following theory extensions have property (𝖢𝗈𝗆𝗉f)({\sf Comp}_{f}), hence are local:

  • (i)

    The extension of a theory 𝒯0{\mathcal{T}}_{0} with uninterpreted function symbols.

  • (ii)

    The extension of a theory 𝒯0{\mathcal{T}}_{0} containing a predicate \leq which is reflexive with a function ff satisfying the axioms 𝒦={x¯ϕi(x¯)Li(x¯)i=1,,n},{\mathcal{K}}=\{\forall{\overline{x}}~{}\phi_{i}({\overline{x}}){\rightarrow}L_{i}({\overline{x}})\mid i=1,\dots,n\}, where:

    • ϕi\phi_{i} are 𝒯0{\mathcal{T}}_{0}-formulae with ϕi(x¯)ϕj(x¯)\phi_{i}({\overline{x}}){\wedge}\phi_{j}({\overline{x}}){\models}{\perp} if iji{\neq}j
      (nn can be 1 and ϕ1\phi_{1} can be \top),

    • Li(x¯)L_{i}({\overline{x}}) has the form  (1) sif(x¯)s_{i}\leq f({\overline{x}}) or  (2) f(x¯)tif({\overline{x}})\leq t_{i} or  (3) sif(x¯)tis_{i}\leq f({\overline{x}})\leq t_{i},   where si,tis_{i},t_{i} are Π0\Pi_{0}-terms and in case (3) ϕi𝒯0siti\phi_{i}\models_{{\mathcal{T}}_{0}}s_{i}\leq t_{i}.

Hierarchical reasoning. Consider a Ψ\Psi-local theory extension 𝒯0𝒯0𝒦{\mathcal{T}}_{0}\subseteq{\mathcal{T}}_{0}\cup{\mathcal{K}}. Condition (𝖫𝗈𝖼fΨ)({\sf Loc}_{f}^{\Psi}) requires that for every finite set GG of ground ΠC\Pi^{C}-clauses, 𝒯0𝒦G{\mathcal{T}}_{0}\cup{\cal K}\cup G\models\perp iff 𝒯0𝒦[Ψ𝒦(G)]G{\mathcal{T}}_{0}\cup{\mathcal{K}}[\Psi_{\cal K}(G)]\cup G\models\perp. In all clauses in 𝒦[Ψ𝒦(G)]G{\mathcal{K}}[\Psi_{\cal K}(G)]\cup G the function symbols in Σ\Sigma only have ground terms as arguments, so 𝒦[Ψ𝒦(G)]G{\mathcal{K}}[\Psi_{\cal K}(G)]{\cup}G can be flattened and purified. We thus obtain a set of clauses 𝒦0G0𝖣𝖾𝖿{\mathcal{K}}_{0}\cup G_{0}\cup{\sf Def}, where 𝒦0{\mathcal{K}}_{0} and G0G_{0} do not contain Σ\Sigma-function symbols and 𝖣𝖾𝖿{\sf Def} contains clauses of the form c=f(c1,,cn)c=f(c_{1},\dots,c_{n}), where fΣf\in\Sigma, and c,c1,,cnc,c_{1},\dots,c_{n} are constants. This transformation allows us to reduce testing satisfiability w.r.t. 𝒯0𝒦{\mathcal{T}}_{0}\cup{\mathcal{K}} to testing satisfiability w.r.t. 𝒯0{\mathcal{T}}_{0}.

Theorem 4 ([38])

Let 𝒦{\mathcal{K}} be a set of clauses. Assume that 𝒯0𝒯1=𝒯0𝒦{\mathcal{T}}_{0}\subseteq{\cal T}_{1}={\mathcal{T}}_{0}\cup{\mathcal{K}} is a Ψ\Psi-local theory extension. For any finite set GG of ground ΠC\Pi^{C}-clauses, let 𝒦0G0𝖣𝖾𝖿{\mathcal{K}}_{0}\cup G_{0}\cup{\sf Def} be obtained from 𝒦[Ψ𝒦(G)]G{\mathcal{K}}[\Psi_{\cal K}(G)]\cup G by introducing, in a bottom-up manner, new constants ctCc_{t}\in C for subterms t=f(c1,,cn)t{=}f(c_{1},\dots,c_{n}) where fΣf{\in}\Sigma and cic_{i} are constants, together with definitions ct=f(c1,,cn)c_{t}{=}f(c_{1},\dots,c_{n}) (included in 𝖣𝖾𝖿{\sf Def}) and replacing the corresponding terms tt with the constants ctc_{t} in 𝒦{\mathcal{K}} and GG. Then 𝒯1G{\cal T}_{1}\cup G\models\perp if and only if 𝒯0𝒦0G0𝖢𝗈𝗇0,{\mathcal{T}}_{0}\cup{\mathcal{K}}_{0}\cup G_{0}\cup{\sf Con}_{0}\models\perp, where 𝖢𝗈𝗇0={i=1ncidicdf(c1,,cn)c𝖣𝖾𝖿f(d1,,dn)d𝖣𝖾𝖿}.\displaystyle{{\footnotesize{\sf Con}_{0}{=}\{\bigwedge_{i=1}^{n}c_{i}{\approx}d_{i}\rightarrow c{\approx}d\,{\mid}\begin{array}[]{l}f(c_{1},\dots,c_{n}){\approx}c{\in}{\sf Def}\\ f(d_{1},\dots,d_{n}){\approx}d{\in}{\sf Def}\end{array}\}}}.

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 (X,d)(X,d), i.e. sets endowed with a distance function dd 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 𝒯0{\mathcal{T}}_{0} be the disjoint two-sorted combination of {\cal E}, the pure theory of equality (no function symbols), sort 𝗉{\sf p}, and LI()LI({\mathbb{R}}) (linear real arithmetic), sort 𝗇𝗎𝗆{\sf num}. Let 𝒯dm{\mathcal{T}}^{m}_{d} be the extension of 𝒯0{\mathcal{T}}_{0} with a function dd with arity a(d)=𝗉,𝗉𝗇𝗎𝗆a(d)={\sf p},{\sf p}\rightarrow{\sf num} satisfying the following set 𝒦d{\cal K}_{d} of axioms:

(d1)x,yd(x,y)0(d2)x,y,zd(x,y)d(x,z)+d(z,y)(d3)x,yd(x,y)=d(y,x)(d4)x,yx=yd(x,y)=0(d5)x,yd(x,y)=0x=y\begin{array}[]{lrl}(d_{1})&\forall x,y&d(x,y)\geq 0\\ (d_{2})&\forall x,y,z&d(x,y)\leq d(x,z)+d(z,y)\\ (d_{3})&\forall x,y&d(x,y)=d(y,x)\\ (d_{4})&\forall x,y&x=y\rightarrow d(x,y)=0\\ (d_{5})&\forall x,y&d(x,y)=0\rightarrow x=y\end{array}

Let Ψm\Psi_{m} be defined for every set TT of ground terms by

Ψm(T)={d(a,b)a,b are constants of sort 𝗉 occurring in T}.\Psi_{m}(T)=\{d(a,b)\mid a,b\text{ are constants of sort }{\sf p}\text{ occurring in }T\}.

Then the following hold:

  • (1)

    Ψm\Psi_{m} is a closure operator on ground terms.

  • (2)

    For every finite set TT of ground terms, Ψm(T)\Psi_{m}(T) is finite.

  • (3)

    𝒯dm{\mathcal{T}}^{m}_{d} is a Ψm\Psi_{m}-local extension of 𝒯0{\mathcal{T}}_{0} satisfying condition (𝖢𝗈𝗆𝗉fΨ)({\sf Comp}^{\Psi}_{f}).

Proof: (1) Clearly, for every set TT of ground terms, TT and Ψm(T)\Psi_{m}(T) contain the same constants of sort 𝗉{\sf p}, so Ψm(Ψm(T))=Ψm(T)\Psi_{m}(\Psi_{m}(T))=\Psi_{m}(T). Since the only extension function symbol is dd, 𝖾𝗌𝗍(𝒦,T)Ψm(T){\sf est}({\mathcal{K}},T)\subseteq\Psi_{m}(T) for every set TT of ground terms. The fact that if T1T2T_{1}\subseteq T_{2} we have Ψm(T1)Ψm(T2)\Psi_{m}(T_{1})\subseteq\Psi_{m}(T_{2}) follows from the definition. It is also easy to check that for every map h:CCh:C\rightarrow C, h¯(Ψm(T))=Ψm(h¯(T)){\overline{h}}(\Psi_{m}(T))=\Psi_{m}({\overline{h}}(T)), i.e. Ψm\Psi_{m} is stable under renaming of constants.

(2) If TT is finite, then it contains finitely many constants (say nn). Ψm(T)\Psi_{m}(T) has then n2n^{2} elements.

(3) To prove that 𝒯dm{\mathcal{T}}^{m}_{d} is a Ψm\Psi_{m}-local extension of T0T_{0}, we prove that it satisfies the embeddability condition (𝖢𝗈𝗆𝗉𝗐,𝖿Ψ{\sf Comp^{\Psi}_{w,f}}), i.e. that for every partial model 𝒫=(P,,dP){\cal P}=(P,{\mathbb{R}},d_{P}) of 𝒯d=𝒯0𝒦d{\mathcal{T}}_{d}={\mathcal{T}}_{0}\cup{\mathcal{K}}_{d} with the properties:

  • (i)

    All function symbols in Σ0\Sigma_{0} are everywhere defined; dd is partially defined.

  • (ii)

    The set T(𝒫)={d(a1,a2)aiAp,dP(a1,a2) is defined}T({\cal P})=\{d(a_{1},a_{2})\mid\text{a}_{i}\in A_{p},d_{P}(a_{1},a_{2})\text{ is defined}\} is finite, and closed under Ψm\Psi_{m}.

dPd_{P} can be extended to a total function on PP that satisfies the axioms 𝒦d{\mathcal{K}}_{d}.

Let 𝒫=(P,,dP){\cal P}=(P,{\mathbb{R}},d_{P}) be a partial model of 𝒯dm=𝒯0𝒦m{\mathcal{T}}^{m}_{d}={\mathcal{T}}_{0}\cup{\mathcal{K}}_{m} (where PP is the support of sort p, {\mathbb{R}} the support of sort num, and dPd_{P} a partial function from P×PP\times P to {\mathbb{R}}) satisfying the conditions above. Then:

  • whenever dP(p1,p2)d_{P}(p_{1},p_{2}) defined, dP(p1,p2)0d_{P}(p_{1},p_{2})\geq 0, and if p1=p2p_{1}=p_{2}, dP(p1,p2)=0d_{P}(p_{1},p_{2})=0;

  • dP(p,p)=0d_{P}(p,p)=0 whenever it is defined;

  • if dP(p1,p2)d_{P}(p_{1},p_{2}) and dP(p2,p1)d_{P}(p_{2},p_{1}) are defined then dP(p1,p2)=dP(p2,p1)d_{P}(p_{1},p_{2})=d_{P}(p_{2},p_{1}); and

  • if dP(p1,p2),dP(p2,p3),dP(p1,p3)d_{P}(p_{1},p_{2}),d_{P}(p_{2},p_{3}),d_{P}(p_{1},p_{3}) are defined then dP(p1,p2)dP(p2,p3)+dP(p1,p3)d_{P}(p_{1},p_{2})\leq d_{P}(p_{2},p_{3})+d_{P}(p_{1},p_{3}).

Let E={(p1,p2)dP(p1,p2) is defined}E=\{(p_{1},p_{2})\mid d_{P}(p_{1},p_{2})\text{ is defined}\}.

Let P1={pPqP:dP(p,q) defined or dP(q,p) defined }P_{1}=\{p\in P\mid\exists q\in P:d_{P}(p,q)\text{ defined or }d_{P}(q,p)\text{ defined }\}. By the assumption that dP(p1,p2)d_{P}(p_{1},p_{2}) is defined only for finitely many tuples (p1,p2)(p_{1},p_{2}), P1P_{1} is finite and by condition (ii) above (as T(𝒫)T({\cal P}) is closed under Ψm\Psi_{m}), E=P1×P1E=P_{1}\times P_{1}. Thus, P=P1P2P=P_{1}\cup P_{2}, such that d1=dP|P1d_{1}={d_{P}}_{|P_{1}} is totally defined and dd is nowhere defined on P2P_{2} (for every two different elements p1,p2P2p_{1},p_{2}\in P_{2}, dP(p1,p2)d_{P}(p_{1},p_{2}) is undefined and for every pP2p\in P_{2} there is no qP1q\in P_{1} such that dP(p,q)d_{P}(p,q) or dP(q,p)d_{P}(q,p) is defined).

Since P1P_{1} is finite, the maximum m1=𝗆𝖺𝗑{d(p,q)p,qP1}m_{1}={\sf max}\{d(p,q)\mid p,q\in P_{1}\} exists.

Consider an arbitrary distance function d2d_{2} on P2P_{2} such that 𝗌𝗎𝗉{d2(p1,p2)p1,p2P2}{\sf sup}\{d_{2}(p_{1},p_{2})\mid p_{1},p_{2}\in P_{2}\} is finite (such a function is guaranteed to exist, since the distance axioms are consistent: We can for instance regard all points in P2P_{2} as points in the unit circle and consider the euclidian distances between these points). Thus, the distance function d2d_{2} on P2P_{2} is totally defined and bounded. Let m2m_{2} be such that d2(p,q)m2d_{2}(p,q)\leq m_{2} for all p,qP2p,q\in P_{2}.

We now show how to extend dd on P1P2P_{1}\cup P_{2}. If P1P_{1} or P2P_{2} are empty we have a total extension of dd already. Assume they are both non-empty. Let p1P1p_{1}\in P_{1} and p2P2p_{2}\in P_{2}. We construct a totally defined function d:(P1P2)2d:(P_{1}\cup P_{2})^{2}\rightarrow{\mathbb{R}} as follows:

d(p,q)={d1(p,q) if p,qP1d2(p,q) if p,qP2d0+d1(p,p1)+d2(p2,q) if pP1 and qP2d0+d1(q,p1)+d2(p2,p) if pP2 and qP1d(p,q)=\left\{\begin{array}[]{ll}d_{1}(p,q)&\text{ if }p,q\in P_{1}\\ d_{2}(p,q)&\text{ if }p,q\in P_{2}\\ d_{0}+d_{1}(p,p_{1})+d_{2}(p_{2},q)&\text{ if }p\in P_{1}\text{ and }q\in P_{2}\\ d_{0}+d_{1}(q,p_{1})+d_{2}(p_{2},p)&\text{ if }p\in P_{2}\text{ and }q\in P_{1}\end{array}\right.

where d0d_{0}\in{\mathbb{R}}, is such that d0=𝗆+1d_{0}={\sf m}+1, where 𝗆=𝗆𝖺𝗑(m1,m2){\sf m}={\sf max}(m_{1},m_{2}).

We show that dd is a total function that satisfies all the axioms 𝒦d{\mathcal{K}}_{d}:

  • It is clear that dd is a total function and that for all x,yP1P2,d(x,y)0x,y\in P_{1}\cup P_{2},d(x,y)\geq 0, i.e. it satisfies axiom (d1)(d_{1}).

  • Let pP1P2p\in P_{1}\cup P_{2}. Then pPip\in P_{i}, with i=1i=1 or 22, and since did_{i} satisfies axiom (d4)(d_{4}), d(p,p)=di(p,p)=0d(p,p)=d_{i}(p,p)=0. Thus dd satisfies axiom (d4)(d_{4}) too.

  • Let p,qP1P2p,q\in P_{1}\cup P_{2}. If p,qPip,q\in P_{i} for i=1i=1 or 22, then d(p,q)=di(p,q)=di(q,p)=d(q,p)d(p,q)=d_{i}(p,q)=d_{i}(q,p)=d(q,p) – since did_{i} satisfies axiom (d3)(d_{3}). If pP1,qP2p\in P_{1},q\in P_{2} then d(p,q)=d0+d1(p,p1)+d2(p2,q)=d0+d1(p1,p)+d2(q,p2)=d(q,p)d(p,q)=d_{0}+d_{1}(p,p_{1})+d_{2}(p_{2},q)=d_{0}+d_{1}(p_{1},p)+d_{2}(q,p_{2})=d(q,p); the case when pP2,qP1p\in P_{2},q\in P_{1} is similar. Thus dd satisfies axiom (d3)(d_{3}) too.

  • Let p,qP1P2p,q\in P_{1}\cup P_{2}. If p,qPip,q\in P_{i}, with i=1i=1 or 22, and d(p,q)=0d(p,q)=0 then di(p,q)=0d_{i}(p,q)=0, so as did_{i} satisfies axiom (d5)(d_{5}), p=qp=q. If pP1p\in P_{1} and qP2q\in P_{2} or pP2p\in P_{2} and qP1q\in P_{1} then by definition d(p,q)d0>0d(p,q)\geq d_{0}>0, so we cannot have d(p,q)=0d(p,q)=0. Thus dd satisfies axiom (d5)(d_{5}) too.

  • We show that dd satisfies the triangle inequality (axiom (d2)(d_{2})). Let p,q,rP1P2p,q,r\in P_{1}\cup P_{2}. We show that d(p,q)d(p,r)+d(r,q)d(p,q)\leq d(p,r)+d(r,q). We distinguish the following cases:

    Case 1: pP1,qP2p\in P_{1},q\in P_{2}.

    Then d(p,q)=d0+d1(p,p1)+d2(p2,q)d(p,q)=d_{0}+d_{1}(p,p_{1})+d_{2}(p_{2},q).

    Subcase 1.a: rP1r\in P_{1}.

    Then d(p,r)+d(r,q)=d1(p,r)+d0+d1(r,p1)+d2(p2,q)d0+d1(p,p1)+d2(p2,q)=d(p,q)d(p,r)+d(r,q)=d_{1}(p,r)+d_{0}+d_{1}(r,p_{1})+d_{2}(p_{2},q)\geq d_{0}+d_{1}(p,p_{1})+d_{2}(p_{2},q)=d(p,q).

    Subcase 1.b: rP2r\in P_{2}.

    Then d(p,r)+d(r,q)=d0+d1(p,p1)+d2(p2,r)+d2(r,q)d0+d1(p,p1)+d2(p2,q)=d(p,q)d(p,r)+d(r,q)=d_{0}+d_{1}(p,p_{1})+d_{2}(p_{2},r)+d_{2}(r,q)\geq d_{0}+d_{1}(p,p_{1})+d_{2}(p_{2},q)=d(p,q).

    Case 2: pP2,qP1p\in P_{2},q\in P_{1}.

    Then d(p,q)=d0+d1(q,p1)+d2(p2,p)d(p,q)=d_{0}+d_{1}(q,p_{1})+d_{2}(p_{2},p).

    Subcase 2.a: rP2r\in P_{2}.

    Then d(p,r)+d(r,q)=d2(p,r)+d0+d1(r,p2)+d2(p1,q)=d2(r,p)+d0+d1(q,p1)+d2(p2,r)d0+d1(q,p1)+d2(p2,p)=d(p,q)d(p,r)+d(r,q)=d_{2}(p,r)+d_{0}+d_{1}(r,p_{2})+d_{2}(p_{1},q)=d_{2}(r,p)+d_{0}+d_{1}(q,p_{1})+d_{2}(p_{2},r)\geq d_{0}+d_{1}(q,p_{1})+d_{2}(p_{2},p)=d(p,q).

    Subcase 2.b: rP1r\in P_{1}.

    Then d(p,r)+d(r,q)=d0+d2(p,p2)+d2(p1,r)+d1(r,q)d0+d1(p1,q)+d2(p,p2)=d0+d1(q,p1)+d2(p2,p)=d(p,q)d(p,r)+d(r,q)=d_{0}+d_{2}(p,p_{2})+d_{2}(p_{1},r)+d_{1}(r,q)\geq d_{0}+d_{1}(p_{1},q)+d_{2}(p,p_{2})=d_{0}+d_{1}(q,p_{1})+d_{2}(p_{2},p)=d(p,q).

    Case 3: p,qP1p,q\in P_{1}.

    Then d(p,q)=d1(p,q)d(p,q)=d_{1}(p,q).

    Subcase 3.a: rP1r\in P_{1}.

    Then d(p,q)=d1(p,q)d1(p,r)+d1(r,q)=d(p,r)+d(r,q)d(p,q)=d_{1}(p,q)\leq d_{1}(p,r)+d_{1}(r,q)=d(p,r)+d(r,q), since d1d_{1} satisfies axiom (d2)(d_{2}).

    Subcase 3.b: rP2r\in P_{2}.

    Then d(p,q)=d1(p,q)𝗆<d0d(p,r)+d(r,q)d(p,q){=}d_{1}(p,q){\leq}{\sf m}{<}d_{0}{\leq}d(p,r){+}d(r,q).

    Case 4: p,qP2p,q\in P_{2}.

    Then d(p,q)=d2(p,q)d(p,q)=d_{2}(p,q).

    Subcase 4.a: rP2r\in P_{2}.

    Then d(p,q)=d2(p,q)d2(p,r)+d2(r,q)=d(p,r)+d(r,q)d(p,q)=d_{2}(p,q)\leq d_{2}(p,r)+d_{2}(r,q)=d(p,r)+d(r,q), since d2d_{2} satisfies axiom (d2)(d_{2}).

    Subcase 4.b: rP1r\in P_{1}.

    Then d(p,q)=d2(p,q)𝗆<d0d(p,r)+d(r,q)d(p,q){=}d_{2}(p,q){\leq}{\sf m}{<}d_{0}{\leq}d(p,r){+}d(r,q).

In [30] it was proved that condition (𝖢𝗈𝗆𝗉fΨ)({\sf Comp}^{\Psi}_{f}) for 𝒯0𝒯0𝒦{\mathcal{T}}_{0}\subseteq{\mathcal{T}}_{0}\cup{\mathcal{K}} implies Ψ\Psi-locality of the extension if the clauses in 𝒦{\mathcal{K}} are flat and linear. The clauses in 𝒦m{\mathcal{K}}_{m} 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 \mathcal{B} of 𝒯0𝒦[Ψ(G)]G{\mathcal{T}}_{0}\cup{\mathcal{K}}[\Psi(G)]\cup G we can define a partial model 𝒜\mathcal{A} of 𝒯0𝒦G{\mathcal{T}}_{0}\cup{\mathcal{K}}\cup G and argue that (by (𝖢𝗈𝗆𝗉fΨ)({\sf Comp}^{\Psi}_{f})) this model embeds into a total model of 𝒯0𝒦G{\mathcal{T}}_{0}\cup{\mathcal{K}}\cup G. We construct 𝒜\mathcal{A} as follows: Its universe(s) are the same as for \mathcal{B}, and f(a1,,an)f(a_{1},\dots,a_{n}) is defined in 𝒜\mathcal{A} if there exists constants c1,,cnc_{1},\dots,c_{n} which interpret in 𝒜\mathcal{A} as a1,,ana_{1},\dots,a_{n} and f(c1,,cn)f(c_{1},\dots,c_{n}) occurs in Ψ(G)\Psi(G). This definition is used to associate with every valuation in 𝒜\mathcal{A} in which all terms in a clause CC are defined a substitution σ\sigma such that Cσ𝒦[Ψ(G)]C\sigma\in{\mathcal{K}}[\Psi(G)].

If the clause CC is linear the substitution can be defined without problems. If CC contains a variable in different terms, it might be difficult to define Σ\Sigma because for different occurrences of xx we might find different suitable terms.

This problem does not occur here because of the fact that Ψm\Psi_{m} adds all necessary instances that allow to define σ\sigma 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. \Box

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 dd in which all the axioms of a metric except for the triangle inequality hold.

Theorem 6

Let 𝒯0{\mathcal{T}}_{0} be the disjoint two-sorted combination of the theory \cal{E} of pure equality (no function symbols), sort 𝗉{\sf p}, and LI()LI({\mathbb{R}}) (linear real arithmetic), sort 𝗇𝗎𝗆{\sf num}. Let 𝒯dn{\mathcal{T}}^{n}_{d} be the extension of 𝒯0{\mathcal{T}}_{0} with a function dd with arity a(d)=𝗉,𝗉𝗇𝗎𝗆a(d)={\sf p},{\sf p}\rightarrow{\sf num} satisfying the following set 𝒦n{\cal K}_{n} of axioms:

(d1)x,yd(x,y)0(d3)x,yd(x,y)=d(y,x)(d4)x,yx=yd(x,y)=0(d5)x,yd(x,y)=0x=y\begin{array}[]{lrl}(d_{1})&\forall x,y&d(x,y)\geq 0\\ (d_{3})&\forall x,y&d(x,y)=d(y,x)\\ (d_{4})&\forall x,y&x=y\rightarrow d(x,y)=0\\ (d_{5})&\forall x,y&d(x,y)=0\rightarrow x=y\end{array}

Let Ψn\Psi_{n} be defined for every set TT of ground terms by

Ψn(T)=T{d(t2,t1)d(t1,t2)T}{d(a,a)a is a constant of sort p occurring in T}\begin{array}[]{ll}\Psi_{n}(T)=T&\cup\{d(t_{2},t_{1})\mid d(t_{1},t_{2})\in T\}\\ &\cup\{d(a,a)\mid a\text{ is a constant of sort {\sf p} occurring in }T\}\end{array}

Then 𝒯dn{\mathcal{T}}^{n}_{d} is a Ψn\Psi_{n}-local extension of 𝒯0{\mathcal{T}}_{0}.

Proof: To prove locality we have to show that every partial model of 𝒯dn=𝒯0𝒦n{\mathcal{T}}^{n}_{d}={\mathcal{T}}_{0}\cap{\cal K}_{n} which is closed under Ψn\Psi_{n} can be extended to a total model. Let 𝒫=(P,,dP){\cal P}=(P,{\mathbb{R}},d_{P}) be a partial model of 𝒯d=𝒯0𝒦d{\mathcal{T}}_{d}={\mathcal{T}}_{0}\cup{\mathcal{K}}_{d} (where PP is the support of sort p, {\mathbb{R}} the support of sort num, and dPd_{P} a partial function from P×PP\times P to {\mathbb{R}}) satisfying the conditions above. We construct a total function d:P×Pd:P\times P\rightarrow{\mathbb{R}} as follows:

d(p,q)={dP(p,q) if dP(p,q) is defined0 if dP(p,q) is not defined and p=q1 if dP(p,q) is not defined and pqd(p,q)=\left\{\begin{array}[]{ll}d_{P}(p,q)&\text{ if }d_{P}(p,q)\text{ is defined}\\ 0&\text{ if }d_{P}(p,q)\text{ is not defined and }p=q\\ 1&\text{ if }d_{P}(p,q)\text{ is not defined and }p\neq q\\ \end{array}\right.

It is easy to check that dd satisfies all the axioms in 𝒦n{\cal K}_{n}. 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. \Box

Theorem 7

Let 𝒯0{\mathcal{T}}_{0} be the disjoint combination of the theory of pure equality (sort 𝗉{\sf p}) and linear real arithmetic (sort 𝗇𝗎𝗆{\sf num}). The following extensions of 𝒯0{\mathcal{T}}_{0} with a function dd (sort 𝗉×𝗉𝗇𝗎𝗆{\sf p}{\times}{\sf p}{\rightarrow}{\sf num}) are Ψ\Psi-local, with Ψ\Psi being the identity function.

  • (i)

    𝒯du{\mathcal{T}}^{u}_{d}, the extension of 𝒯0{\mathcal{T}}_{0} with an uninterpreted function dd.

  • (ii)

    𝒯dp=𝒯0𝒦p{\mathcal{T}}^{p}_{d}={\mathcal{T}}_{0}\cup{\mathcal{K}}_{p}, where 𝒦p=x,yd(x,y)0{\mathcal{K}}_{p}=\forall x,y~{}d(x,y)\geq 0.

The extension 𝒯ds=𝒯0𝒦s{\mathcal{T}}^{s}_{d}={\mathcal{T}}_{0}\cup{\mathcal{K}}_{s}, where 𝒦s=x,yd(x,y)=d(y,x){\mathcal{K}}_{s}=\forall x,y~{}d(x,y)=d(y,x) is Ψs\Psi_{s}-local, where Ψs(T)=T{d(a,b)d(b,a)T}\Psi_{s}(T)=T\cup\{d(a,b)\mid d(b,a)\in T\}.

Proof. (i) and (ii) are a direct consequence of Theorem 3; the locality proof for 𝒯ds{\mathcal{T}}^{s}_{d} is similar to the one for 𝒯dn{\mathcal{T}}^{n}_{d}. \Box

We present all the results together in the following theorem:

Theorem 8

Let 𝒯0{\mathcal{T}}_{0} be the disjoint combination of the theory {\cal E} of pure equality (sort 𝗉{\sf p}) and linear real arithmetic (sort 𝗇𝗎𝗆{\sf num}). The following extensions of 𝒯0{\mathcal{T}}_{0} with a function dd (sort 𝗉×𝗉𝗇𝗎𝗆{\sf p}{\times}{\sf p}{\rightarrow}{\sf num}) are Ψ\Psi-local for a suitable closure operator Ψ\Psi:

  • (1)

    𝒯dm=𝒯0𝒦m{\mathcal{T}}^{m}_{d}={\mathcal{T}}_{0}\cup{\mathcal{K}}_{m}, where 𝒦m{\mathcal{K}}_{m} are axioms of a metric, is Ψm\Psi_{m}-local, where Ψm(T)={d(a,b)a,b constants of sort 𝗉 occurring in T}\Psi_{m}(T)=\{d(a,b)\mid a,b\text{ constants of sort }{\sf p}\text{ occurring in }T\}.

  • (2)

    𝒯dn=𝒯0𝒦n{\mathcal{T}}^{n}_{d}={\mathcal{T}}_{0}\cup{\mathcal{K}}_{n}, where 𝒦n{\mathcal{K}}_{n} contains all axioms of a metric except for the triangle inequality, is Ψn\Psi_{n}-local, where Ψn(T)=T{d(b,a)d(a,b)T}{d(a,a)a constant of sort 𝗉 occurring in T}\Psi_{n}(T)=T\cup\{d(b,a)\mid d(a,b)\in T\}\cup\{d(a,a)\mid a\text{ constant of sort }{\sf p}\text{ occurring in }T\}.

  • (3)

    𝒯du{\mathcal{T}}^{u}_{d}, the extension of 𝒯0{\mathcal{T}}_{0} with an uninterpreted function dd, and 𝒯dp=𝒯0𝒦p{\mathcal{T}}^{p}_{d}={\mathcal{T}}_{0}\cup{\mathcal{K}}_{p}, where 𝒦p=x,yd(x,y)0{\mathcal{K}}_{p}=\forall x,y~{}d(x,y)\geq 0, are Ψ\Psi-local, where Ψ(T)=T\Psi(T)=T.

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.

Algorithm 1 Symbol elimination in theory extensions [40, 41]
Input: Theory extension 𝒯0𝒦{\mathcal{T}}_{0}\cup{\mathcal{K}} with signature Π=Π0(ΣΣ𝗉𝖺𝗋)\Pi=\Pi_{0}\cup(\Sigma\cup\Sigma_{\sf par})
where Σ𝗉𝖺𝗋\Sigma_{\sf par} is a set of parameters
Set TT of ground ΠC\Pi^{C}-terms
Output: y¯ΓT(y¯)\forall{\overline{y}}\Gamma_{T}({\overline{y}}) (universal Π0Σ𝗉𝖺𝗋\Pi_{0}\cup\Sigma_{\sf par}-formula)
Step 1

Purify 𝒦[T]G{\mathcal{K}}[T]\cup G as described in Theorem 4 (with set of extension symbols Σ1\Sigma_{1}). Let 𝒦0G0𝖢𝗈𝗇0{\mathcal{K}}_{0}\cup G_{0}\cup{\sf Con}_{0} be the set of Π0C\Pi_{0}^{C}-clauses obtained this way.

Step 2

Let G1=𝒦0G0𝖢𝗈𝗇0G_{1}={\mathcal{K}}_{0}\cup G_{0}\cup{\sf Con}_{0}. Among the constants in G1G_{1}, we identify

  1. (i)

    the constants cfc_{f}, fΣ𝗉𝖺𝗋f\in\Sigma_{\sf par}, where cfc_{f} is a constant parameter or cfc_{f} is introduced by a definition cff(c1,,ck)c_{f}\approx f(c_{1},\dots,c_{k}) in the hierarchical reasoning method,

  2. (ii)

    all constants c¯p{\overline{c}_{p}} occurring as arguments of functions in Σ𝗉𝖺𝗋\Sigma_{\sf par} in such definitions.

Replace all the other constants c¯{\overline{c}} with existentially quantified variables x¯{\overline{x}} (i.e. replace G1(c¯p,c¯f,c¯)G_{1}({\overline{c}_{p}},{\overline{c}_{f}},{\overline{c}}) with x¯G1(c¯p,c¯f,x¯)\exists{\overline{x}}G_{1}({\overline{c}_{p}},{\overline{c}_{f}},{\overline{x}})).

Step 3

Construct a formula Γ1(c¯p,c¯f)\Gamma_{1}({\overline{c}_{p}},{\overline{c}_{f}}) equivalent to x¯G1(c¯p,c¯f,x¯)\exists{\overline{x}}G_{1}({\overline{c}_{p}},{\overline{c}_{f}},{\overline{x}}) w.r.t. 𝒯0{\mathcal{T}}_{0} using a method for quantifier elimination in 𝒯0{\mathcal{T}}_{0}.

Step 4

Replace each constant cfc_{f} introduced by definition cf=f(c1,,ck)c_{f}=f(c_{1},\dots,c_{k}) with the term f(c1,,ck)f(c_{1},\dots,c_{k}) in Γ1(c¯p,c¯f)\Gamma_{1}({\overline{c}_{p}},{\overline{c}_{f}}). Let Γ2(c¯p)\Gamma_{2}({\overline{c}_{p}}) be the formula obtained this way. Replace c¯p{\overline{c}_{p}} with existentially quantified variables y¯{\overline{y}}.

Step 5

Let y¯ΓT(y¯)\forall{\overline{y}}\Gamma_{T}({\overline{y}}) be y¯¬Γ2(y¯)\forall{\overline{y}}\neg\Gamma_{2}({\overline{y}}).

Theorem 9 ([40, 41])

Let 𝒯0{\cal T}_{0} be a Π0\Pi_{0}-theory allowing quantifier elimination222If 𝒯0{\mathcal{T}}_{0} does not allow QE but has a model completion 𝒯0{\mathcal{T}}_{0}^{*} which does, and if we use QE in 𝒯0{\mathcal{T}}_{0}^{*} in Algorithm 1, 𝒯0x¯ΓT(x¯)G{\mathcal{T}}_{0}\wedge\forall{\overline{x}}\Gamma_{T}({\overline{x}})\cup G\models\bot, but x¯ΓT(x¯)\forall{\overline{x}}\Gamma_{T}({\overline{x}}) might not be the weakest universal formula Γ\Gamma with the property that 𝒯0Γ𝒦{\mathcal{T}}_{0}\cup\Gamma\cup{\mathcal{K}}\models\bot. Σ𝗉𝖺𝗋\Sigma_{\sf par} be a set of parameters (function and constant symbols) and Π=(S,Σ,𝖯𝗋𝖾𝖽)\Pi=(S,\Sigma,{\sf Pred}) be such that Σ(Σ0Σ𝗉𝖺𝗋)=\Sigma\cap(\Sigma_{0}\cup\Sigma_{\sf par})=\emptyset. Let 𝒦{\cal K} be a set of clauses in the signature Π0Σ𝗉𝖺𝗋Σ\Pi_{0}{\cup}\Sigma_{\sf par}{\cup}\Sigma in which all variables occur also below functions in Σ1=Σ𝗉𝖺𝗋Σ\Sigma_{1}=\Sigma_{\sf par}\cup\Sigma. Assume 𝒯𝒯0𝒦{\mathcal{T}}\subseteq{\mathcal{T}}_{0}\cup{\mathcal{K}} satisfies condition (𝖢𝗈𝗆𝗉fΨ)({\sf Comp}^{\Psi}_{f}) for a suitable closure operator Ψ\Psi with 𝖾𝗌𝗍(G)Ψ𝒦(G){\sf est}(G)\subseteq\Psi_{{\mathcal{K}}}(G) for every set GG of ground ΠC\Pi^{C}-clauses. Then, for T=Ψ𝒦(G)T=\Psi_{{\mathcal{K}}}(G), Algorithm 1 yields a universal Π0Σ𝗉𝖺𝗋\Pi_{0}\cup\Sigma_{\sf par}-formula x¯ΓT(x¯)\forall{\overline{x}}\Gamma_{T}({\overline{x}}) such that 𝒯0x¯ΓT(x¯)𝒦G{\cal T}_{0}\cup\forall{\overline{x}}\Gamma_{T}({\overline{x}})\cup{\cal K}\cup G\models\perp which is entailed by every universal formula Γ\Gamma with 𝒯0Γ𝒦G{\cal T}_{0}\cup\Gamma\cup{\cal K}\cup G\models\perp.

Proof: The fact that 𝒯0𝒦xΓT(x){\mathcal{T}}_{0}\cup{\mathcal{K}}\cup\forall x\Gamma_{T}(x)\models\perp was proved in [41]. We show that if T=Ψ𝒦(G)T=\Psi_{{\mathcal{K}}}(G) then for every set Γ\Gamma of universal constraints on the parameters, if 𝒯0Γ𝒦G{\mathcal{T}}_{0}\cup\Gamma\cup{\mathcal{K}}\cup G is unsatisfiable then every model of 𝒯0Γ{\mathcal{T}}_{0}\cup\Gamma is a model of 𝒯0yΓT(y){\mathcal{T}}_{0}\cup\forall y\Gamma_{T}(y).

In [41] it is shown that if the extension 𝒯0𝒯0𝒦{\mathcal{T}}_{0}\subseteq{\mathcal{T}}_{0}\cup{\mathcal{K}} satisfies condition (𝖢𝗈𝗆𝗉fΨ)({\sf Comp}^{\Psi}_{f}) then also the extension 𝒯0Γ𝒯0Γ𝒦{\mathcal{T}}_{0}\cup\Gamma\subseteq{\mathcal{T}}_{0}\cup\Gamma\cup{\mathcal{K}} satisfies condition (𝖢𝗈𝗆𝗉fΨ)({\sf Comp}^{\Psi}_{f}). If 𝒦{\mathcal{K}} is flat and linear then the extension is Ψ\Psi-local. Let T=Ψ𝒦(G)=Ψ(𝖾𝗌𝗍(𝒦,G))T=\Psi_{{\mathcal{K}}}(G)=\Psi({\sf est}({\mathcal{K}},G)). By Ψ\Psi-locality, 𝒯0Γ𝒦G{\mathcal{T}}_{0}\cup\Gamma\cup{\mathcal{K}}\cup G is unsatisfiable if and only if 𝒯0Γ𝒦[T]G{\mathcal{T}}_{0}\cup\Gamma\cup{\mathcal{K}}[T]\cup G is unsatisfiable, if and only if (with the notations in Steps 1–5 of Algorithm 1) 𝒯0Γ𝒦0G0𝖢𝗈𝗇0𝖣𝖾𝖿{\mathcal{T}}_{0}\cup\Gamma\cup{\mathcal{K}}_{0}\cup G_{0}\cup{\sf Con}_{0}\cup{\sf Def} is unsatisfiable. Let 𝒜{\mathcal{A}} be a model of 𝒯0Γ{\mathcal{T}}_{0}\cup\Gamma. Then in 𝒜{\mathcal{A}} there are no possible values for the constants G1(c¯p,c¯f,c¯)=𝒦0G0𝖢𝗈𝗇0𝖣𝖾𝖿G_{1}({\overline{c}_{p}},{\overline{c}_{f}},{\overline{c}})={\mathcal{K}}_{0}\cup G_{0}\cup{\sf Con}_{0}\cup{\sf Def}, for which G1(c¯p,c¯f,c¯)G_{1}({\overline{c}_{p}},{\overline{c}_{f}},{\overline{c}}) is true in 𝒜{\mathcal{A}}. Hence, 𝒜⊧̸x¯G1(c¯p,c¯f,x¯){\mathcal{A}}\not\models\exists{\overline{x}}G_{1}({\overline{c}_{p}},{\overline{c}_{f}},{\overline{x}}), so (with the notation used when describing Steps 1–5) 𝒜⊧̸y¯Γ2(y¯){\mathcal{A}}\not\models\exists{\overline{y}}\Gamma_{2}({\overline{y}}). It follows that 𝒜y¯ΓT(y¯){\mathcal{A}}\models\forall{\overline{y}}\Gamma_{T}({\overline{y}}). \Box

This reduction method was implemented in sehpilot (for details cf.  Section 7).

5 Second-order quantifier elimination

Let 𝒯{\mathcal{T}} be a theory with signature Π=(S,Σ,𝖯𝗋𝖾𝖽)\Pi=(S,\Sigma,{\sf Pred}) and P1,,Pn,Q1,,QmP_{1},\dots,P_{n},Q_{1},\dots,Q_{m} be predicate symbols which are not in 𝖯𝗋𝖾𝖽{\sf Pred}. Let Π=(S,Σ,𝖯𝗋𝖾𝖽{P1,,Pn})\Pi^{\prime}=(S,\Sigma,{\sf Pred}{\cup}\{P_{1},\dots,P_{n}\}) and Π′′=(S,Σ,𝖯𝗋𝖾𝖽{Q1,,Qm})\Pi^{\prime\prime}=(S,\Sigma,{\sf Pred}{\cup}\{Q_{1},\dots,Q_{m}\}); FF be a Π\Pi^{\prime}-formula and GG a Π′′\Pi^{\prime\prime}-formula.

A Π\Pi-structure 𝒜\mathcal{A} is a model of P1PnF\exists P_{1}\dots P_{n}~{}F (notation: 𝒜P1PnF\mathcal{A}\models\exists P_{1}\dots P_{n}~{}F) if there exists a Π\Pi^{\prime}-structure {\cal B} such that F{\cal B}\models F and |Π=𝒜{\cal B}_{|_{\Pi}}=\mathcal{A}.

We say that P1PnF\exists P_{1}\dots P_{n}~{}F entails Q1QmG\exists Q_{1}\dots Q_{m}~{}G w.r.t. 𝒯{\mathcal{T}} (and use the notation: P1PnF𝒯Q1QmG\exists P_{1}\dots P_{n}~{}F\models_{{\mathcal{T}}}\exists Q_{1}\dots Q_{m}~{}G) iff for every Π\Pi-structure 𝒜{\cal A} which is a model of 𝒯{\mathcal{T}}, if 𝒜P1PnF\mathcal{A}\models\exists P_{1}\dots P_{n}~{}F then 𝒜Q1QmG\mathcal{A}\models\exists Q_{1}\dots Q_{m}~{}G.

If there exists a first-order formula F0F_{0} over the signature Π\Pi such that for every model 𝒜{\cal A} of 𝒯{\mathcal{T}}, 𝒜F0{\cal A}\models F_{0} iff 𝒜P1PnF{\cal A}\models\exists P_{1}\dots P_{n}~{}F, we say that F0F_{0} and P1PnF\exists P_{1}\dots P_{n}~{}F are equivalent w.r.t. 𝒯{\mathcal{T}} (and write F0𝒯P1PnFF_{0}\equiv_{{\mathcal{T}}}\exists P_{1}\dots P_{n}~{}F).

We consider here only the elimination of one predicate; for formulae of the form P1PnF\exists P_{1}\dots P_{n}~{}F the process can be iterated. Let 𝒯{\mathcal{T}} be a theory with signature Π=(S,Σ,𝖯𝗋𝖾𝖽)\Pi=(S,\Sigma,{\sf Pred}) and let Π=(S,Σ,𝖯𝗋𝖾𝖽{P})\Pi^{\prime}=(S,\Sigma,{\sf Pred}\cup\{P\}), where P𝖯𝗋𝖾𝖽P\not\in{\sf Pred}.

Let FF be a universal first-order Π\Pi^{\prime}-formula. Our goal is to compute, if possible, a first-order Π\Pi-formula GG such that G𝒯PFG\equiv_{{\mathcal{T}}}\exists P~{}F. We adapt the hierarchical superposition calculus proposed in [8, 9] to this case.

We consider theories 𝒯{\mathcal{T}} over many-sorted signatures Π=(S,Σ,𝖯𝗋𝖾𝖽)\Pi=(S,\Sigma,{\sf Pred}), where the set of sorts S=SiSuS=S_{i}\cup S_{u} consists of a set SiS_{i} of interpreted sorts and a set SuS_{u} of uninterpreted sorts. The models of the theories are Π\Pi-structures 𝒜=({As}sS,{f𝒜}fΣ,{pA}p𝖯𝗋𝖾𝖽)\mathcal{A}=(\{A_{s}\}_{s\in S},\{f_{\mathcal{A}}\}_{f\in\Sigma},\{p_{A}\}_{p\in{\sf Pred}}), 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 sSis\in S_{i} as domain elements of sort ss.

Let FF be a universal first-order formula over signature Π=(S,Σ,𝖯𝗋𝖾𝖽{P})\Pi^{\prime}=(S,\Sigma,{\sf Pred}\cup\{P\}). We can assume, without loss of generality, that FF is a set of clauses of the form x¯D(x¯)C(x¯)\forall{\overline{x}}~{}D({\overline{x}})\vee C({\overline{x}}), where D(x¯)D({\overline{x}}) is a clause over the signature Π\Pi and C(x¯)C({\overline{x}}) is a clause containing literals of the form (¬)P(x1,,xn)(\neg)P(x_{1},\dots,x_{n}), where x1,,xnx_{1},\dots,x_{n} are variables333We can bring the clauses to this form using variable abstraction.. Such clauses can also be represented as constrained clauses in the form x¯ϕ(x¯)||C(x¯), where ϕ(x¯):=¬D(x¯).\forall{\overline{x}}~{}\phi({\overline{x}})~{}||~{}C({\overline{x}}),\text{ where }\phi({\overline{x}}):=\neg D({\overline{x}}). We will refer to clauses of this form as constrained PP-clauses.

Let \succ be a strict, well-founded ordering on terms that is compatible with contexts and stable under substitutions. As in [9] we assume that \succ has the following properties:444These conditions are satisfied by an LPO with an operator precedence in which the predicate symbol PP (which can be regarded as function symbol with output sort 𝖻𝗈𝗈𝗅{\sf bool}) is larger than the other operators and domain elements are minimal w.r.t. \succ which is supposed to be well-founded on the domain elements.

  • (i)

    \succ is total on ground terms,

  • (ii)

    tdt\succ d for every domain element dd of interpreted sort ss and every ground term tt that is not a domain element.

Let 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} be the calculus containing the following ordered resolution and factorization rules for constrained PP-clauses:

ϕ1||P(x¯)Cϕ2||¬P(y¯)D(ϕ1ϕ2)σ||(CD)σϕ||P(x¯)P(y¯)Cϕσ||(P(x¯)C)σ\begin{array}[]{ll}\displaystyle{{\phi_{1}~{}||~{}P({\overline{x}})\vee C\quad\quad\phi_{2}~{}||~{}\neg P({\overline{y}})\vee D}\over{(\phi_{1}\wedge\phi_{2})\sigma~{}||~{}(C\vee D)\sigma}}\quad\quad\quad\quad\quad\quad\displaystyle{{\phi~{}||~{}P({\overline{x}})\vee P({\overline{y}})\vee C}\over{\phi\sigma~{}||~{}(P({\overline{x}})\vee C)\sigma}}\end{array}

where (i) σ=𝗆𝗀𝗎(P(x¯),P(y¯))\sigma={\sf mgu}(P({\overline{x}}),P({\overline{y}})) (i) σ=𝗆𝗀𝗎(P(x¯),P(y¯))\sigma={\sf mgu}(P({\overline{x}}),P({\overline{y}}))
(ii) P(x¯)σP({\overline{x}})\sigma is strictly maximal in (P(x¯)C)σ(P({\overline{x}})\vee C)\sigma (ii) P(x¯)σP({\overline{x}})\sigma is maximal in
(iii) ¬P(y¯)σ\neg P({\overline{y}})\sigma is maximal in (¬P(y¯)D)σ.(\neg P({\overline{y}})\vee D)\sigma. (P(x¯)C)σ(P({\overline{x}})\vee C)\sigma

Redundancy. The inference rules are supplemented by a redundancy criterion =(c,i){\cal R}=({\cal R}_{c},{\cal R}_{i}) meant to specify:

  • a set c{\cal R}_{c} of redundant clauses (which can be removed), and

  • a set i{\cal R}_{i} of redundant inferences (which do not need to be computed).

We say that a set of clauses NN^{*} is saturated up to {\cal R}-redundancy w.r.t. 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} if every 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} inference with premises in NN^{*} is redundant (i.e. in i{\cal R}_{i}).

The following notion of redundancy c0{\cal R}^{0}_{c} for clauses is often used: A (constrained) clause is redundant w.r.t. a set NN of clauses if all its ground instances are entailed w.r.t. 𝒯{\mathcal{T}} by ground instances of clauses in NN which are strictly smaller w.r.t. \succ. We will use the following notion of redundancy for inferences: If c{\cal R}_{c} is a redundancy criterion for clauses, we say that an inference ι\iota on ground clauses is redundant w.r.t. NN if either one of its premises is redundant w.r.t. NN and c{\cal R}_{c} or, if C0C_{0} is the conclusion of ι\iota then there exist clauses C1,,CnNC_{1},\dots,C_{n}\in N that are smaller w.r.t. \succ than the maximal premise of ι\iota and C1,,CnC0C_{1},\dots,C_{n}\models C_{0}.

A non-ground inference is redundant if all its ground instances are redundant.

Example 1 (Semantic 𝒯{\mathcal{T}}-entailment; redundancy criterion 𝒯{\cal R}_{{\mathcal{T}}})

We say that a constrained PP-clause x¯(ϕ(x¯)||C(x¯))\forall{\overline{x}}~{}(\phi({\overline{x}})~{}||~{}C({\overline{x}})) is 𝒯{\mathcal{T}}-semantically entailed by x¯(ψ(y¯)||D(y¯))\forall{\overline{x}}~{}(\psi({\overline{y}})~{}||~{}D({\overline{y}})) if the following conditions hold:

  • (i)

    C=DC=D,

  • (ii)

    𝒯x¯ϕ(x¯)ψ(x¯){\mathcal{T}}\models\forall{\overline{x}}~{}\phi({\overline{x}})\rightarrow\psi({\overline{x}}) and

  • (iii)

    ¬ϕ(x¯)σ¬ψ(y¯)σ\neg\phi({\overline{x}})\sigma\succ\neg\psi({\overline{y}})\sigma for every ground substitution σ\sigma.

We say that a clause CC is 𝒯{\cal R}_{{\mathcal{T}}}-redundant w.r.t. a set NN of clauses if it is 𝒯{\mathcal{T}}-semantically entailed by a clause in NN.

Note that if C1=(ϕ(x¯)||C(x¯))C_{1}{=}(\phi({\overline{x}})||C({\overline{x}})) is 𝒯{\mathcal{T}}-semantically entailed by C2=(ψ(y¯)||D(y¯))C_{2}{=}(\psi({\overline{y}})||D({\overline{y}})) then C1σC2σC_{1}\sigma\succ C_{2}\sigma and C2σ𝒯C1σC_{2}\sigma\models_{{\mathcal{T}}}C_{1}\sigma for every ground substitution σ\sigma, so 𝒯{\cal R}_{{\mathcal{T}}}-redundant clauses are c0{\cal R}^{0}_{c}-redundant.

We call the notion of redundancy induced on inferences also 𝒯{\cal R}_{{\mathcal{T}}}-redundancy. \blacksquare

Let =(c,i){\cal R}=({\cal R}_{c},{\cal R}_{i}) be a redundancy criterion with cc0{\cal R}_{c}\subseteq{\cal R}^{0}_{c}. We want to prove that if NN is a set of constrained PP-clauses over background theory 𝒯{\mathcal{T}}, NN^{*} its saturation (up to {\cal R}-redundancy) under 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ}, and N0N^{*}_{0} the set of clauses in NN^{*} not containing PP, then for every model 𝒜\mathcal{A} of 𝒯{\mathcal{T}}, 𝒜\mathcal{A} is a model of N0N^{*}_{0} if and only if there exists a Π\Pi^{\prime}-structure {\cal B} with N\mathcal{B}\models N and |Π=𝒜{\cal B}_{|_{\Pi}}={\cal A}. 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 Π=(S,Σ,𝖯𝗋𝖾𝖽)\Pi=(S,\Sigma,{\sf Pred}), 𝒯{\mathcal{T}} be a theory with signature Π\Pi and let 𝒜=({As}sS,{f𝒜}fΣ,{p𝒜}p𝖯𝗋𝖾𝖽)\mathcal{A}=(\{A_{s}\}_{s\in S},\{f_{\mathcal{A}}\}_{f\in\Sigma},\{p_{\mathcal{A}}\}_{p\in{\sf Pred}}) be a Π\Pi-structure which is a model of 𝒯{\mathcal{T}}. For every element aAsa\in A_{s} we add a new constant of sort ss (which we denote aa). Let CA=sSAsC_{A}{=}\bigcup_{s\in S}A_{s} be the set of all constants introduced this way, and 𝒜A{\cal A}^{A} be the extension of 𝒜{\cal A} with constants from CAC_{A} which are interpreted in the usual way.

Let NN be a set of clauses over signature Π\Pi. Then the following are equivalent:

  • (1)

    𝒜{\cal A} is a model of NN.

  • (2)

    𝒜A{\cal A}^{A} is a model of the set NAN_{A} of all ground instances of NN in which the variables are replaced with constants in CAC_{A}.

Proof: (1) \Rightarrow (2): Assume that 𝒜{\cal A} is a model of NN. Let CC be a clause in NAN_{A}. Then CC is obtained from a clause CNC^{\prime}\in N by replacing every variable xx with a constant axCAa_{x}\in C_{A} (such that if the variable xx has sort ss then axAsa_{x}\in A_{s}). Let β:X𝒜\beta:X\rightarrow{\cal A} be defined by β(x)=ax\beta(x)=a_{x} for every xXx\in X occurring in CC^{\prime} and defined arbitrarily for all the other variables. Since 𝒜{\cal A} is a model of NN, the clause CC^{\prime} is true in 𝒜{\cal A} in the valuation β\beta. But 𝒜(β(C)){\cal A}(\beta(C^{\prime})) is obtained by evaluating the function and predicate symbols as in 𝒜{\cal A} and every variable xx occurring in CC^{\prime} as axa_{x}. This is exactly the value of CC^{\prime} in 𝒜A{\cal A}^{A}, thus 𝒜A{\cal A}^{A} is a model of CC.

(2) \Rightarrow (1): Assume that 𝒜A{\cal A}^{A} is a model of NAN_{A}. Let CNC\in N and let β:X𝒜\beta:X\rightarrow{\cal A} be a valuation. For every xXx\in X, let ax:=β(x)a_{x}:=\beta(x). As discussed before, the value of CC in 𝒜{\cal A} w.r.t. β\beta is the same as the value of C=CσC^{\prime}=C\sigma in 𝒜A{\cal A}^{A}, where σ\sigma is the substitution that associates with every variable xx the constant axCAa_{x}\in C_{A}. Since 𝒜A{\cal A}^{A} is a model of the set NAN_{A} and CNAC^{\prime}\in N_{A}, 𝒜A{\cal A}^{A} is also a model of CC^{\prime}. It follows that CC is true in 𝒜{\cal A} w.r.t. β\beta for every valuation β\beta, i.e. that 𝒜{\cal A} is a model of NN. \Box

Theorem 11

Let NN be a set of constrained PP-clauses over background theory 𝒯{\mathcal{T}}, NN^{*} its saturation (up to {\cal R}-redundancy) under 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ}, and N0N^{*}_{0} the set of clauses in NN^{*} not containing PP. For every model 𝒜\mathcal{A} of 𝒯{\mathcal{T}} the following are equivalent:

  • (1)

    𝒜\mathcal{A} is a model of N0N^{*}_{0}.

  • (2)

    There exists a Π\Pi^{\prime}-structure {\cal B} with N\mathcal{B}\models N and |Π=𝒜{\cal B}_{|_{\Pi}}={\cal A}.

Proof: First, note that for constrained PP-clauses the hierarchical superposition calculus specializes to 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ}: With the terminology used in [5, 8, 9], the background signature is Π\Pi; the only foreground symbol is PP. Since there are no “background”-sorted terms starting with a “foreground” function symbol, sets of PP-clauses are sufficiently complete. (Even if we regard predicates as functions with values in the domain {0,1}\{0,1\}, 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) \Rightarrow (1) follows from the soundness of the hierarchical superposition calculus.

(1) \Rightarrow (2) is proved with a model construction similar to the one used for proving completeness of hierarchical superposition. Let 𝒜\mathcal{A} be a model of N0N^{*}_{0} and 𝒯{\mathcal{T}}. Consider the extension ΠA\Pi^{A} of the signature Π\Pi obtained by adding to Σ\Sigma a set C𝒜C_{\mathcal{A}} containing a constant aa of sort ss for every element aAsa\in A_{s}.

Since 𝒜\mathcal{A} is a model of N0N^{*}_{0}, by Lemma 10, 𝒜A\mathcal{A}^{A} is a model of the set N0A{N^{*}_{0}}_{A} of instances of N0N^{*}_{0} in which the variables are replaced with constants in CAC_{A}.

By Zermelo’s theorem, there exists a total well-founded strict order \succ on the set of all constants in Π\Pi, and starting with this ordering we can obtain a total well-founded strict ordering (which we denote again with \succ) on the set of all ground terms over ΠA\Pi^{A}, which can be extended in the usual way to the set of all ground clauses over the signature ΠA=(S,ΣCA,𝖯𝗋𝖾𝖽{P}){\Pi^{\prime}}^{A}=(S,\Sigma\cup C_{A},{\sf Pred}\cup\{P\}), such that the literals containing the predicate symbol PP are larger than the literals not containing PP.555This is compatible with regarding PP as a function symbol with output sort 𝖻𝗈𝗈𝗅{\sf bool} and using an ordering in which PP is the largest function symbol.

Consider the clauses in the set NAN^{*}_{A} ordered increasingly according to the clause ordering induced by the atom ordering. Since NN^{*} is saturated w.r.t. 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ}, NAN^{*}_{A} is also saturated w.r.t. 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ}. We construct a model for NAN^{*}_{A} 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 {P(a1,,ak)i{1,n},ajCA constant of suitable sort, for all j{1,,k}}\{P(a_{1},\dots,a_{k})\mid i\in\{1,\dots n\},a_{j}\in C_{A}\text{ constant of suitable sort, for all }j\in\{1,\dots,k\}\} are false. The clauses in (N0)A(N^{*}_{0})_{A} are smaller than the clauses containing the predicate symbol PP and by assumption are all true in 𝒜{\cal A}, hence also in the interpretation that we start with (and will remain true in the process of constructing \mathcal{B}). We therefore only need to consider the set NPN^{*}_{P} of all constrained PP-clauses containing the predicate symbol PP. When considering a clause CC, we assume that we already constructed a partial interpretation C{\cal B}_{\prec C} that makes true all clauses strictly smaller than CC.

  • If CC is true in the partial interpretation C{\cal B}_{\prec C} nothing needs to be done.

  • If CC is false in the partial interpretation C{\cal B}_{\prec C} we need to change C{\cal B}_{\prec C} such that CC becomes true (such that the clauses smaller than CC remain true).

We proceed as follows: If CC is false in C{\cal B}_{\prec C} and contains exactly one maximal literal which is positive (which needs to start with PP and is for instance of the form P(a¯)P({\overline{a}})), we change the interpretation of PP such that it contains the tuple a¯{\overline{a}}, i.e. such that P(a¯)P({\overline{a}}) becomes true. We denote this by setting ΔC:={P(a¯)}\Delta_{C}:=\{P({\overline{a}})\}. Otherwise we do not change the interpretation, i.e.  ΔC:=\Delta_{C}:=\emptyset.

The candidate model is the limit of all these changes, :=𝒜CN1ΔC{\cal B}:={\cal A}\cup\bigcup_{C\in N_{1}}\Delta_{C}.

We can show that the expansion A{\cal B}^{A} of {\cal B} with the constants in CAC_{A} (with the usual interpretation) is a model of (NP)A(N^{*}_{P})_{A} in the usual way: Assume that there exists a clause in (NP)A(N^{*}_{P})_{A} which is not true in A{\cal B}^{A}. Since the ordering on (NP)A(N^{*}_{P})_{A} is well-founded, we consider without loss of generality the smallest clause in (NP)A(N^{*}_{P})_{A} which is false in A\mathcal{B}^{A}. We can show in the usual way that using a resolution or a factorization step we can produce a smaller clause false in A\mathcal{B}^{A}, which is either in (NP)A(N^{*}_{P})_{A} or in (N0)A(N^{*}_{0})_{A}, so in both cases we obtain a contradiction.

Since A\mathcal{B}^{A} is a model of NAN^{*}_{A}, and s=𝒜s\mathcal{B}_{s}=\mathcal{A}_{s} for every sort ss (hence A=B\mathcal{B}^{A}=\mathcal{B}^{B}), it follows that \mathcal{B} is a model of N=N0NPN^{*}=N^{*}_{0}\cup N^{*}_{P}. \Box

Corollary 12

Let 𝒯{\mathcal{T}} be a theory, NN be a set of constrained PP-clauses and NN^{*} be a set of constrained PP-clauses obtained by saturating NN in 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} up to redundancy. Let 𝒜\mathcal{A} be a Π\Pi-structure which is a model of 𝒯{\mathcal{T}}. Then 𝒜\mathcal{A} is a model of N0N^{*}_{0} if and only if there exists a Π\Pi^{\prime}-structure {\cal B} with N\mathcal{B}\models N and |Π=𝒜{\cal B}_{|_{\Pi}}={\cal A}.

Proof: Follows from the fact that in the proof of Theorem 11 the clauses which are redundant are entailed (w.r.t. 𝒯{\mathcal{T}}) by clauses that are smaller hence cannot be minimal counterexamples and cannot influence the way model \mathcal{B} is built because every redundant clause CC is true in C\mathcal{B}_{\prec C}. \Box

5.1 Case 1: Saturation is finite

If the saturation NN^{*} of NN under 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} (up to {\cal R}-redundancy) is finite and N0N^{*}_{0} is the set of clauses in NN^{*} not containing PP then, by Theorem 11, the universal closure of the conjunction of the clauses in N0N^{*}_{0} is equivalent to PN\exists P~{}N.

Example 2

Consider a class of graphs described by the following set NN of constrained EE-clauses:

{(1)πi(u,v)||E(u,v),(2)πt(u,w,v)||E(u,v)E(u,w),(3)πe(u,v)||¬E(u,v)}\{(1)\pi^{i}(u,v)||E(u,v),~{}~{}(2)\pi^{t}(u,w,v)||E(u,v)\rightarrow E(u,w),~{}~{}(3)\pi^{e}(u,v)||\lnot E(u,v)\}

For arbitrary predicates πi,πe\pi^{i},\pi^{e} and πt\pi^{t} we can generate with 𝐻𝑅𝑒𝑠E\mathit{HRes}^{E}_{\succ} an infinite set of clauses including, e.g., all clauses of the form:

(4n)πi(u,v)πt(u,w1,v)πt(u,w2,w1)πt(u,wn,wn1)||E(u,wn)(4_{n})~{}\pi^{i}(u,v)\land\pi^{t}(u,w_{1},v)\land\pi^{t}(u,w_{2},w_{1})\land\dots\land\pi^{t}(u,w_{n},w_{n-1})~{}||~{}E(u,w_{n})

If we assume that πi,πe,πt\pi^{i},\pi^{e},\pi^{t} satisfy the additional axioms defining a theory 𝒯π{\mathcal{T}}_{\pi}:

(c1)u,v,wπi(u,v)πt(u,w,v)πi(u,w)(c2)u,v,wπe(u,w)πt(u,w,v)πe(u,v)(c3)u,v,w,xπt(u,w,v)πt(u,x,w)πt(u,x,v)\begin{array}[]{lrrll}(c1)&\forall u,v,w{}{}{}&\pi^{i}(u,v)\land\pi^{t}(u,w,v)&\rightarrow&\pi^{i}(u,w)\\ (c2)&\forall u,v,w{}{}{}&\pi^{e}(u,w)\land\pi^{t}(u,w,v)&\rightarrow&\pi^{e}(u,v)\\ (c3)&\forall u,v,w,x{}{}&\pi^{t}(u,w,v)\land\pi^{t}(u,x,w)&\rightarrow&\pi^{t}(u,x,v)\\ \end{array}

then all inferences by resolution between clauses (1) and (2), (2) and (3) are 𝒯π{\mathcal{T}}_{\pi}-redundant. The inferences between (2) and (2) are also 𝒯π{\mathcal{T}}_{\pi}-redundant: Consider a ground instance of such an inference (the maximal literals are underlined):

πt(c1,c2,c3)||E(c1,c3)¯E(c1,c2)πt(c1,c3,c4)||E(c1,c4)E(c1,c3)¯πt(c1,c2,c3),πt(c1,c3,c4)||E(c1,c4)E(c1,c2)\pi^{t}(c_{1},c_{2},c_{3})||\underline{E(c_{1},c_{3})}\rightarrow E(c_{1},c_{2})\quad\pi^{t}(c_{1},c_{3},c_{4})||E(c_{1},c_{4})\rightarrow\underline{E(c_{1},c_{3})}\over\pi^{t}(c_{1},c_{2},c_{3}),\pi^{t}(c_{1},c_{3},c_{4})||E(c_{1},c_{4})\rightarrow E(c_{1},c_{2})

The ground instance CC of (2) πt(c1,c2,c4)||E(c1,c4)E(c1,c2)\pi^{t}(c_{1},c_{2},c_{4})||E(c_{1},c_{4})\rightarrow E(c_{1},c_{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 (c3)(c3) holds then CC entails the conclusion of the inference above, which makes the inference redundant w.r.t. 𝒯π{\mathcal{T}}_{\pi}.

Thus, only the inference of clauses (1) and (3) yields a non-redundant resolvent:

(4)πi(u,v,r1)πe(u,v,r2)||(4)\quad\pi^{i}(u,v,r_{1})\land\pi^{e}(u,v,r_{2})||\bot

so N=N{(4)}N^{*}=N\cup\{(4)\} is saturated up to 𝒯π{\mathcal{T}}_{\pi}-redundancy. By Theorem 11, NN is satisfiable iff u,v(πi(u,v)πe(u,v))\forall u,v(\pi^{i}(u,v)\land\pi^{e}(u,v)\rightarrow\bot) is satisfiable w.r.t. 𝒯π{\mathcal{T}}_{\pi}. \blacksquare

When modelling concrete situations, the predicates πi,πe\pi^{i},\pi^{e} and πt\pi^{t} might not be arbitrary, but might have definitions using other symbols with given properties.

Example 3

The theory 𝒯π{\mathcal{T}}_{\pi} might be actually described in a detailed way. Let 𝐂(r1,r2){\bf C}(r_{1},r_{2}) be a graph class described by the set NN of axioms in Example 2, where πi,πe,πt\pi^{i},\pi^{e},\pi^{t} are defined by the axioms:

𝖣𝖾𝖿π(r1,r2)={u,vπi(u,v)uvd(u,v)r1(u),u,vπe(u,v)d(u,v)>r2(u),u,v,wπt(u,w,v)uwd(u,w)d(u,v)},\begin{array}[]{ll}{\sf Def}_{\pi}(r_{1},r_{2})=\{&\forall u,v~{}\pi^{i}(u,v)\leftrightarrow u{\neq}v\land d(u,v){\leq}r_{1}(u),\\ &\forall u,v~{}\pi^{e}(u,v)\leftrightarrow d(u,v){>}r_{2}(u),\\ &\forall u,v,w~{}\pi^{t}(u,w,v)\leftrightarrow u{\neq}w\land d(u,w){\leq}d(u,v)\},\end{array}

where dd is a distance or cost function. We can regard the theory extension 𝒯𝒯π=𝒯𝖥𝗋𝖾𝖾(r1,r2)𝖣𝖾𝖿π{\mathcal{T}}\subseteq{\mathcal{T}}_{\pi}={\mathcal{T}}\cup{\sf Free}(r_{1},r_{2})\cup{\sf Def}_{\pi}, where 𝒯{\mathcal{T}} is one of the theories 𝒯du{\mathcal{T}}^{u}_{d}, TdpT^{p}_{d}, 𝒯dn{\mathcal{T}}^{n}_{d} or 𝒯dm{\mathcal{T}}^{m}_{d} introduced in Theorem 8, and 𝖥𝗋𝖾𝖾(r1,r2){\sf Free}(r_{1},r_{2}) the theory in which r1,r2r_{1},r_{2} are regarded as uninterpreted unary function symbols. Therefore, 𝒯{\mathcal{T}} can be represented as a Ψ\Psi-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 (c1),(c2)(c1),(c2) and (c3)(c3) are valid w.r.t. 𝒯{\mathcal{T}}. \blacksquare

In applications we might not be interested in checking the satisfiability of NN or the satisfiability of u,v(πi(u,v)πe(u,v))\forall u,v(\pi^{i}(u,v)\land\pi^{e}(u,v)\rightarrow\bot) w.r.t. 𝒯π{\mathcal{T}}_{\pi}, but in a specific model 𝒜\mathcal{A} satisfying 𝒯π{\mathcal{T}}_{\pi} (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 𝒜\mathcal{A} be a model of a theory 𝒯{\mathcal{T}} describing properties of function symbols in a set Σ\Sigma we want to model. We assume that Σ\Sigma contains a set of “parameters” Σ𝗉𝖺𝗋\Sigma_{\sf par} (function symbols whose properties are “underspecified” in 𝒯{\mathcal{T}}). In some situations, if we are given a set NN of constrained clauses, we might be interested in obtaining (weakest) universal conditions Γ\Gamma on Σ𝗉𝖺𝗋\Sigma_{\sf par} such that for every fixed model 𝒜\mathcal{A} of 𝒯{\mathcal{T}} which also satisfies Γ\Gamma, there exists an interpretation for PP in 𝒜\mathcal{A} for which NN is satisfied, i.e. 𝒜PN\mathcal{A}\models\exists P~{}N. We present a situation in which this is possible.

Theorem 13

Let 𝒯{\mathcal{T}} be a theory with signature Π=(S,Σ,𝖯𝗋𝖾𝖽)\Pi=(S,\Sigma,{\sf Pred}), NN a set of constrained PP-clauses. Assume that the saturation NN^{*} of NN up to 𝒯{\mathcal{T}}-redundancy w.r.t. 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} is finite; let N0N^{*}_{0} be the set of clauses in NN^{*} not containing PP.

Let Σ𝗉𝖺𝗋Σ\Sigma_{\sf par}\subseteq\Sigma be a set of parameters. Assume that one of the following conditions holds:

  • (i)

    𝒯{\mathcal{T}} allows quantifier elimination or

  • (ii)

    𝒯0𝒯=𝒯0𝒦{\mathcal{T}}_{0}\subseteq{\mathcal{T}}={\mathcal{T}}_{0}\cup{\mathcal{K}} is a local theory extension satisfying condition (𝖢𝗈𝗆𝗉fΨ)({\sf Comp}^{\Psi}_{f}) for a suitable term closure operator Ψ\Psi and 𝒯0{\mathcal{T}}_{0} 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 Γ\Gamma on the parameters such that every model 𝒜\mathcal{A} of 𝒯Γ{\mathcal{T}}\cup\Gamma is a model of (the universal closure of) N0N^{*}_{0}, hence 𝒜PN\mathcal{A}\models\exists P~{}N.

Proof: By the completeness of the hierarchical superposition calculus, NN is satisfiable iff the set N0N^{*}_{0} of clauses in NN^{*} which do not contain PP is satisfiable. We denote by x¯N0(x¯)\forall{\overline{x}}N^{*}_{0}({\overline{x}}) the formula represented by the set of clauses N0N^{*}_{0}.

Let 𝒜\mathcal{A} be a model of 𝒯{\mathcal{T}}. Assume that 𝒜\mathcal{A} is not a model for x¯N0(x¯)\forall{\overline{x}}N^{*}_{0}({\overline{x}}). Then x¯¬N0(x¯)\exists{\overline{x}}\neg N^{*}_{0}({\overline{x}}) is true in 𝒜\mathcal{A}. In particular, it follows that 𝒯x¯¬N0(x¯){\mathcal{T}}\wedge\exists{\overline{x}}\neg N^{*}_{0}({\overline{x}}) is satisfiable. We can apply Algorithm 1 to construct a weakest universal formula Γ\Gamma over the signature Σ𝗉𝖺𝗋\Sigma_{\sf par} with the property that 𝒯Γx¯¬N0(x¯){\mathcal{T}}\cup\Gamma\cup\exists{\overline{x}}\neg N^{*}_{0}({\overline{x}}) is unsatisfiable, i.e. with the property that 𝒯Γx¯N0(x¯){\mathcal{T}}\cup\Gamma\models\forall{\overline{x}}N^{*}_{0}({\overline{x}}). Then every model \mathcal{B} of 𝒯{\mathcal{T}} which also satisfies the constraints in Γ\Gamma is a model of x¯N0(x¯)\forall{\overline{x}}N^{*}_{0}({\overline{x}}). \Box

Example 4

Consider again the situation described in Example 3. We show how one can use Theorem 2 and Algorithm 1 to derive constraints Γ\Gamma on the parameters r1,r2r_{1},r_{2} under which for every model 𝒜\mathcal{A} of 𝒯duΓ{\mathcal{T}}^{u}_{d}\cup\Gamma

πi(u,v)πe(u,v)=(uvd(u,v)r1(u))(d(u,v)>r2(u))\pi^{i}(u,v)\wedge\pi^{e}(u,v)=(u\neq v\land d(u,v)\leq r_{1}(u))\wedge(d(u,v)>r_{2}(u))

is unsatisfiable in 𝒜\mathcal{A} (we consider the case in which dd is an uninterpreted function; other axioms for dd can be analyzed as well).

Note that the formula above is unsatisfiable in any model 𝒜\mathcal{A} of 𝒯du{\mathcal{T}}^{u}_{d} whose support ApA_{p} of sort 𝗉{\sf p} has cardinality 1. If we only consider models 𝒜\mathcal{A} with |Ap|2|A_{p}|\geq 2 then we can proceed as follows:

Step 1: We purify the formula by introducing new constants: cd:=d(u,v),c1=r1(u),c2=r2(u)c_{d}:=d(u,v),c_{1}=r_{1}(u),c_{2}=r_{2}(u) and obtain: (uvcdc1cd>c2)(u\neq v\land c_{d}\leq c_{1}\land c_{d}>c_{2}).

Step 2: We quantify existentially all constants not denoting terms starting with – or used as arguments of – r1,r2r_{1},r_{2} and obtain: v,cd(uvcdc1cd>c2)\exists v,\exists c_{d}(u\neq v\land c_{d}\leq c_{1}\land c_{d}>c_{2}).

Step 3: After quantifier elimination in a combination of 𝖫𝖨(){\sf LI}({\mathbb{R}}) and the theory of sets with cardinality 2\geq 2 with equality [36] we obtain Γ1(c1,c2,u):c2<c1\Gamma_{1}(c_{1},c_{2},u):c_{2}<c_{1}.666We can consider only models 𝒜\mathcal{A} whose support of sort 𝗉{\sf p} is infinite. The theory that formalizes this is the model completion of the theory {\cal E} 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 c1,c2c_{1},c_{2} with the terms they denote and quantify the arguments existentially and obtain: u(r2(u)<r1(u))\exists u(r_{2}(u)<r_{1}(u)).

Step 5: We negate this condition and obtain: u(r1(u)r2(u))\forall u(r_{1}(u)\leq r_{2}(u)). \blacksquare

Example 5

We find an axiomatization for the graph class 𝐂={GG𝐂}{\bf C}^{-}=\{G^{-}\mid G\in{\bf C}\}, when class 𝐂{\bf C} is described by the set NN of constrained clauses in Example 2 and πi,πe\pi^{i},\pi^{e} and πt\pi^{t} satisfy conditions (c1),(c2),(c3)(c1),(c2),(c3). Let N=N{(4)}N^{*}=N\cup\{(4)\} be obtained by saturating NN under 𝐻𝑅𝑒𝑠E\mathit{HRes}^{E}_{\succ} up to redundancy. A graph H=(V,F)𝐂H=(V,F)\in{\bf C}^{-} iff there exists a graph G=(V,E)𝐂G=(V,E)\in{\bf C} such that H=GH=G^{-}. This condition can be described by M=N𝖳𝗋(E,F)M=N^{*}\cup{\sf Tr}(E,F), where 𝖳𝗋(E,F)={x,y(F(x,y)E(x,y)E(y,x))}{\sf Tr}(E,F)=\{\forall x,y~{}(F(x,y)\leftrightarrow E(x,y)\wedge E(y,x))\}, which can be written in the form of constrained clauses as:

𝖳𝗋(E,F)={F(x,y)||E(x,y),F(x,y)||E(y,x),¬F(x,y)||¬E(x,y)¬E(y,x)}{\sf Tr}(E,F)~{}=~{}\{F(x,y)||E(x,y),~{}F(x,y)||E(y,x),~{}\neg F(x,y)||\neg E(x,y)\lor\neg E(y,x)\}

To find an axiomatization for the class {(V,F)(V,E)𝐂 with (V,F)=(V,E)}\{(V,F)\mid\exists(V,E)\in{\bf C}\text{ with }(V,F)=(V,E)^{-}\} we need to eliminate the second-order quantifier from the formula E(N𝖳𝗋(E,F))\exists E(N^{*}\cup{\sf Tr}(E,F)).

The base theory is 𝒯𝑈𝐼𝐹F{\mathcal{T}}\cup\mathit{UIF}_{F}, the extension of 𝒯{\mathcal{T}} with the uninterpreted function symbol FF, with signature ΠF=(Σ,𝖯𝗋𝖾𝖽{F})\Pi_{F}=(\Sigma,{\sf Pred}\cup\{F\}).

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 𝐻𝑅𝑒𝑠E\mathit{HRes}^{E}_{\succ}, we used SCAN on the clause set NN^{-}:

(c1)u,v,w,xπt(u,w,v)πt(u,x,w)πt(u,x,v)(c2)u,v,wπi(u,v)πt(u,w,v)πi(u,w)(c3)u,v,wπe(u,w)πt(u,w,v)πe(u,v)(1)u,vπi(u,v)E(u,v)(2)u,vπe(u,v)¬E(u,v)(3)u,v,wπt(u,w,v)E(u,v)E(u,w)(T1)u,vF(u,v)E(u,v)(T2)u,vF(u,v)E(v,u)(T3)u,vF(u,v)E(v,u)F(u,v)\begin{array}[]{llrl}(c1){}{}{}{}&\forall u,v,w,x&\pi^{t}(u,w,v)\wedge\pi^{t}(u,x,w)&\rightarrow\pi^{t}(u,x,v)\\ (c2)&\forall u,v,w&\pi^{i}(u,v)\land\pi^{t}(u,w,v)&\rightarrow\pi^{i}(u,w)\\ (c3)&\forall u,v,w&\pi^{e}(u,w)\land\pi^{t}(u,w,v)&\rightarrow\pi^{e}(u,v)\\[8.61108pt] (1)&\forall u,v&\pi^{i}(u,v)&\rightarrow E(u,v)\\ (2)&\forall u,v&\pi^{e}(u,v)&\rightarrow\neg E(u,v)\\ (3)&\forall u,v,w&\pi^{t}(u,w,v)\land E(u,v)&\rightarrow E(u,w)\\ (T1)&\forall u,v&F(u,v)&\rightarrow E(u,v)\\ (T2)&\forall u,v&F(u,v)&\rightarrow E(v,u)\\ (T3)&\forall u,v&F(u,v)\wedge E(v,u)&\rightarrow F(u,v)\end{array}

and obtained a set of clauses representing the formula containing axioms N𝒯={(c1),(c2),(c3),(4)}N_{{\mathcal{T}}}=\{(c1),(c2),(c3),(4)\}, where

(4)u,vπi(u,v)πe(u,v)(4)~{}~{}~{}~{}\forall u,v~{}\pi^{i}(u,v)\wedge\pi^{e}(u,v)\rightarrow\perp

and axioms NF={(F1),,(F6)}N^{-}_{F}=\{(F_{1}),\dots,(F_{6})\}:

(F1)x,yF(x,y)F(y,x)(F2)x,yF(y,x)¬πe(x,y)(F3)x,yF(x,y)¬πe(x,y)(F4)x,yπi(x,y)πi(y,x)F(y,x)(F5)x,y,zπi(x,y)πt(y,x,z)F(y,z)F(x,y)(F6)x,y,z,uπt(x,y,z)F(x,z)πt(y,x,u)F(y,u)F(y,x)\begin{array}[]{llrl}(F_{1})&\forall x,y&F(x,y)&\rightarrow F(y,x)\\ (F_{2})&\forall x,y&F(y,x)&\rightarrow\neg\pi^{e}(x,y)\\ (F_{3})&\forall x,y&F(x,y)&\rightarrow\neg\pi^{e}(x,y)\\ (F_{4})&\forall x,y&\pi^{i}(x,y)\land\pi^{i}(y,x)&\rightarrow F(y,x)\\ (F_{5})&\forall x,y,z&\pi^{i}(x,y)\land\pi^{t}(y,x,z)\land F(y,z)&\rightarrow F(x,y)\\ (F_{6})&\forall x,y,z,u{}{}&\pi^{t}(x,y,z)\land F(x,z)\land\pi^{t}(y,x,u)\land F(y,u)&\rightarrow F(y,x)\end{array}

The universal closure GG of the conjunction of these clauses is equivalent w.r.t. 𝒯𝑈𝐼𝐹F{\mathcal{T}}\cup\mathit{UIF}_{F} to the formula E(N𝖳𝗋(E,F))\exists E(N^{*}\cup{\sf Tr}(E,F)), and thus axiomatizes 𝐂{\bf C}^{-}.

\blacksquare

5.2 Case 2: Finite representation of possibly infinite saturated sets

The saturation of a set NN of constrained PP-clauses up to redundancy under 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} might be infinite. We here consider a very special case under which a finite set of constrained PP-clauses N={ϕi(x¯)||Ci(x¯)i=1,,n}N=\{\phi_{i}({\overline{x}})~{}||~{}C_{i}({\overline{x}})\mid i=1,\dots,n\} can have a saturation that can be finitely described: The situation in which the set of clauses {C1,,Cn}\{C_{1},\dots,C_{n}\} can be finitely saturated under ordered resolution.

Theorem 14

Let N={ϕi(x¯)||Ci(x¯)i=1,,n}N=\{\phi_{i}({\overline{x}})||C_{i}({\overline{x}})\mid i=1,\dots,n\} be a finite set of constrained PP-clauses and NP={C1,,Cn}N_{P}=\{C_{1},\dots,C_{n}\}.

Assume that the saturation of NPN_{P} under ordered resolution is finite, NP={C1,,Cn,Cn+1,,Cn+k}N_{P}^{*}=\{C_{1},\dots,C_{n},C_{n+1},\dots,C_{n+k}\}, and the set P{\cal I}_{P} of all possible inferences used for deriving these clauses is finite and can be effectively described. If NP\perp\not\in N_{P}^{*}, then PN𝒯\exists P~{}N\equiv_{{\mathcal{T}}}\top. Assume now that NP\perp\in N_{P}^{*}. Let 𝒜\mathcal{A} be a model of 𝒯{\mathcal{T}}, 𝒯𝒜{\mathcal{T}}_{\mathcal{A}} the theory with 𝒜\mathcal{A} as canonical model (i.e. 𝒯𝒜=Th(𝒜){\mathcal{T}}_{\mathcal{A}}=Th(\mathcal{A})). Let NAN_{A} be the set of all instances of NN in which the variables are replaced with elements in 𝒜\mathcal{A} (seen as constants). Then:

  • (1)

    The saturation NAN^{*}_{A} of NAN_{A} up to 𝒯{\cal R}_{{\mathcal{T}}}-redundancy can be described as NA={μi𝒜(a¯)||Ci(a¯)i=1,,n+k,a¯ elements of 𝒜},N^{*}_{A}=\{\mu^{\mathcal{A}}_{i}({\overline{a}})~{}||~{}C_{i}({\overline{a}})\mid i=1,\dots,n+k,{\overline{a}}\text{ elements of }\mathcal{A}\}, where (μi𝒜)i=1,n+k(\mu^{\mathcal{A}}_{i})_{i=1,n+k} are given by the minimal model of the constrained Horn clauses777The definitions are presented in Appendix 0.C. CHNCH_{N} w.r.t. 𝒯𝒜{\mathcal{T}}_{\mathcal{A}}:

    CHN={ϕi(x¯)μi(x¯)i{1,,n}}{(μi(x¯)μj(y¯))σμk(z¯)Ck(z¯) is obtained by a resolution  inference in P from Ci(x¯) and Cj(y¯) with m.g.u. σ}{μi(x¯)σμk(z¯)Ck(z¯) is obtained by a factorization inference  in P from Ci(x¯) with m.g.u. σ}.\begin{array}[]{rl}CH_{N}=\{&\phi_{i}({\overline{x}})\rightarrow\mu_{i}({\overline{x}})\mid i\in\{1,\dots,n\}\}\\ \cup\{&(\mu_{i}({\overline{x}})\wedge\mu_{j}({\overline{y}}))\sigma\rightarrow\mu_{k}({\overline{z}})\mid C_{k}({\overline{z}})\text{ is obtained by a resolution }\\ &\hskip 42.67912pt\text{ inference in }{\cal I}_{P}\text{ from }C_{i}({\overline{x}})\text{ and }C_{j}({\overline{y}})\text{ with m.g.u.\ }\sigma\}\\ \cup\{&\mu_{i}({\overline{x}})\sigma\rightarrow\mu_{k}({\overline{z}})\mid C_{k}({\overline{z}})\text{ is obtained by a factorization inference }\\ &\hskip 42.67912pt\text{ in }{\cal I}_{P}\text{ from }C_{i}({\overline{x}})\text{ with m.g.u.\ }\sigma\}.\end{array}

  • (2)

    Let AμA^{\mu} be the extension of 𝒜\mathcal{A} with predicates (μi)i(\mu_{i})_{i} whose interpretation is given by (μi𝒜)i(\mu^{\mathcal{A}}_{i})_{i}. Let jj be such that =Cj\perp=C_{j}. Then 𝒜PN\mathcal{A}\models\exists P\,N iff CHN{¬μj(x¯)}CH_{N}{\cup}\{{\neg}\mu_{j}({\overline{x}})\} is satisfiable w.r.t. 𝒯𝒜{\mathcal{T}}_{\mathcal{A}}.

Proof: Obviously, CHNCH_{N} is satisfiable (it has one trivial model, in which all predicate symbols μi\mu_{i} are true). If 𝒜\mathcal{A} is a model of 𝒯{\mathcal{T}}, in this theorem we consider constrained Horn clauses over an assertion language that has one canonical model, namely 𝒜\mathcal{A}, i.e. w.r.t. the corresponding theory 𝒯𝒜{\mathcal{T}}_{\mathcal{A}}. In [12] it is shown – using a canonical model construction – that every set HH of constrained Horn clauses over an assertion language that has canonical models has a unique least model.
This model is defined inductively by taking

I0:=I_{0}{:=}\emptyset and

Ii+1:={r(a¯)𝖻𝗈𝖽𝗒(x)r(x)H,Ii𝒜𝖻𝗈𝖽𝗒(a¯),a¯ is a tuple of constants in 𝒜}I_{i+1}{:=}\{r({\overline{a}}){\mid}{\sf body}(x){\rightarrow}r(x)\in H,I_{i}\models_{\mathcal{A}}{\sf body}({\overline{a}}),{\overline{a}}\text{ is a tuple of constants in }\mathcal{A}\}.

The construction stabilizes at the first limit ordinal ω\omega with an interpretation IωI_{\omega}; so the set of constrained Horn clauses CHNCH_{N} has a unique least model w.r.t. 𝒯𝒜{\mathcal{T}}_{\mathcal{A}}.

This construction of this unique least model parallels the saturation process for the set of ground instances of the clauses NAN^{*}_{A}; the saturated set is:

NA=i=1n{ξik(a¯)||Ci(a¯)k,a¯ is a sequence of elements in 𝒜}N^{*}_{A}=\bigcup_{i=1}^{n}\{\xi^{k}_{i}({\overline{a}})||C_{i}({\overline{a}})\mid k{\in}{\mathbb{N}},{\overline{a}}\text{ is a sequence of elements in }\mathcal{A}\}

where ξik(a¯)||Ci(a¯)\xi^{k}_{i}({\overline{a}})||C_{i}({\overline{a}}) are clauses in NAN_{A} or are obtained (in a finite number of steps) from clauses in NAN_{A} using resolution and/or factorization. If we allow for potentially infinite disjunctions it can be described as:

NA={(kξik(a¯))||Ci(a¯),i=1,,n+k,a¯ is a sequence of elements in 𝒜}N^{*}_{A}=\{(\bigvee_{k\in{\mathbb{N}}}\xi^{k}_{i}({\overline{a}}))||C_{i}({\overline{a}}),i=1,{\dots},n+k,{\overline{a}}\text{ is a sequence of elements in }\mathcal{A}\}

and models for ξi=kξik\xi_{i}=\bigvee_{k\in{\mathbb{N}}}\xi^{k}_{i} can be built in a similar way to the way the interpretations for μi\mu_{i} in the minimal model for CHNCH_{N} are built.

To prove (2) note that the following are equivalent:

  1. (i)

    𝒜PN\mathcal{A}\models\exists P~{}N;

  2. (ii)

    There exists a Π\Pi^{\prime}-structure \mathcal{B} with N\mathcal{B}\models N and |Π=𝒜\mathcal{B}_{|\Pi}=\mathcal{A};

  3. (iii)

    𝒜N0\mathcal{A}\models N^{*}_{0};

  4. (iv)

    𝒜A(N0)A=(NA)0\mathcal{A}^{A}\models(N^{*}_{0})_{A}=(N^{*}_{A})_{0};

  5. (v)

    𝒜A¬kξj(a¯)\mathcal{A}^{A}\models\neg\bigvee_{k\in{\mathbb{N}}}\xi_{j}({\overline{a}}) for every sequence a¯{\overline{a}} of elements in 𝒜\mathcal{A};

  6. (vi)

    𝒜A¬μj𝒜(a¯)\mathcal{A}^{A}\models\neg\mu^{\mathcal{A}}_{j}({\overline{a}}) for every sequence a¯{\overline{a}} of elements in 𝒜\mathcal{A};

  7. (vii)

    𝒜μx¯¬μj(x¯)\mathcal{A}^{\mu}\models\forall{\overline{x}}~{}\neg\mu_{j}({\overline{x}});

  8. (viii)

    CHN{¬μj(x¯)}CH_{N}\cup\{\neg\mu_{j}({\overline{x}})\} is satisfiable w.r.t. 𝒯𝒜{\mathcal{T}}_{\mathcal{A}};

where N0N^{*}_{0} (NA)0N^{*}_{A})_{0} is the set of all clauses in NN^{*} (NAN^{*}_{A}) which do not contain PP.

(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 (NA)0(N^{*}_{A})_{0} can be succinctly represented by taking a possibly infinite disjunction in the constraint in front of \perp; (v) and (vi) are equivalent due to (1); (vi) and (vii) by definition.

(vii) \Rightarrow (viii): By assumption (vii), 𝒜μx¯¬μj(x¯)\mathcal{A}^{\mu}\models\forall{\overline{x}}~{}\neg\mu_{j}({\overline{x}}). Since (μi𝒜(x¯))i(\mu^{\mathcal{A}}_{i}({\overline{x}}))_{i} are the interpretations of μi\mu_{i} in the least model for CHNCH_{N} w.r.t. 𝒯A{\mathcal{T}}_{A} it follows that 𝒜μCHN{x¯¬μj(x¯)}\mathcal{A}^{\mu}\models CH_{N}\cup\{\forall{\overline{x}}~{}\neg\mu_{j}({\overline{x}})\}, hence CHN{x¯¬μj(x¯)}CH_{N}\cup\{\forall{\overline{x}}~{}\neg\mu_{j}({\overline{x}})\} is satisfiable w.r.t. 𝒯𝒜{\mathcal{T}}_{\mathcal{A}}.

(viii) \Rightarrow (vii): Assume now that CHN{x¯¬μj(x¯)}CH_{N}\cup\{\forall{\overline{x}}~{}\neg\mu_{j}({\overline{x}})\} is satisfiable w.r.t. 𝒯𝒜{\mathcal{T}}_{\mathcal{A}}, i.e. there exists an expansion \mathcal{B} of 𝒜\mathcal{A} with interpretations for the predicates μi\mu_{i} such that CHN{x¯¬μj(x¯)}\mathcal{B}\models CH_{N}\cup\{\forall{\overline{x}}~{}\neg\mu_{j}({\overline{x}})\}. Let M𝒜M^{\mathcal{A}} be the least model of CHN{¬μj(x¯)}CH_{N}\cup\{\neg\mu_{j}({\overline{x}})\}. It can be constructed with the canonical construction explained before, by considering the set (CHN{¬μj(x¯)})A(CH_{N}\cup\{\neg\mu_{j}({\overline{x}})\})_{A} of instances of clauses in CHN{¬μj(x¯)}CH_{N}\cup\{\neg\mu_{j}({\overline{x}})\} with constants in 𝒜\mathcal{A} and marking μi(a¯)\mu_{i}({\overline{a}}) as true if we have a rule 𝖻𝗈𝖽𝗒(x)μi(x){\sf body}(x)\rightarrow\mu_{i}(x). Note that {¬μj(x¯)}\{\neg\mu_{j}({\overline{x}})\} does not contribute to this model building process. This means that the least model of CHN{¬μj(x¯)}CH_{N}\cup\{\neg\mu_{j}({\overline{x}})\} is actually the least model of CHNCH_{N}, hence in the least model of CHNCH_{N} the formula x¯¬μj(x¯)\forall{\overline{x}}~{}\neg\mu_{j}({\overline{x}}) is true, which means that Aμx¯¬μj(x¯)A^{\mu}\models\forall{\overline{x}}~{}\neg\mu_{j}({\overline{x}}). \Box

If 𝒯{\mathcal{T}} has only one (canonical) model and is supported by μZ\mu Z [23], we can use μZ\mu Z for checking whether NN is satisfiable888If the set NN of constrained PP-clauses (hence the set of constrained Horn clauses CHNCH_{N}) contains at least one parameter then μZ\mu Z often returns “unknown”. In addition, if μZ\mu Z can prove satisfiability of CHN{¬μj(x¯)}CH_{N}\cup\{\neg\mu_{j}({\overline{x}})\} 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 CHN{¬μj(x¯)}CH_{N}\cup\{\neg\mu_{j}({\overline{x}})\} is sufficient for proving the satisfiability of NN in this case..

Example 6

Consider the set NN consisting of the following constrained PP-clauses:

(1)x=y||P(x,y),(2)y=x+1||P(y,z)P(x,z),(3)n(x,y)||¬P(x,y)(1)~{}x=y||P(x,y),~{}~{}(2)~{}y=x+1||P(y,z)\rightarrow P(x,z),~{}~{}(3)~{}n(x,y)||\neg P(x,y)

over the theory of integers without multiplication with model \mathbb{Z}. Saturating NN without any simplification strategy yields the infinite set NN^{*} consisting of:

(1k)i=1kxi=xi1+1||P(x0,xk)(2k)i=1kxi=xi1+1||P(xk,z)P(x0,z)(3k)n(x0,y)i=1kxi=xi1+1||¬P(xk,y)(4k)i=1kxi=xi1+1n(x0,xk)||,k\begin{array}[]{llllll}(1_{k})&\displaystyle{\bigwedge_{i=1}^{k}}x_{i}{=}x_{i-1}{+}1~{}||~{}P(x_{0},x_{k})&&(2_{k})&\displaystyle{\bigwedge_{i=1}^{k}}x_{i}{=}x_{i-1}{+}1~{}||~{}P(x_{k},z)\rightarrow P(x_{0},z)&\\ (3_{k})&n(x_{0},y)\wedge\displaystyle{\bigwedge_{i=1}^{k}}x_{i}{=}x_{i-1}{+}1~{}||~{}\neg P(x_{k},y)&&(4_{k})&\displaystyle{\bigwedge_{i=1}^{k}}x_{i}{=}x_{i-1}{+}1\wedge n(x_{0},x_{k})~{}||\perp,k\in{\mathbb{N}}\end{array}

(i) We first show how Theorem 14 can be used in this case. Let NP={C1,C2,C3}N_{P}=\{C_{1},C_{2},C_{3}\}, where C1=P(x1,y1),C2=P(y2,z1)P(x1,z1),C_{1}=P(x_{1},y_{1}),C_{2}=P(y_{2},z_{1})\rightarrow P(x_{1},z_{1}), and C3=¬P(x3,y3)C_{3}=\neg P(x_{3},y_{3}). We can saturate NPN_{P} as follows: From C1C_{1} and C3C_{3} we can derive C4=C_{4}=\perp; from C1C_{1} and C2C_{2} we can derive a clause of type C1C_{1}, from C2C_{2} and C2C_{2} a clause of type C2C_{2} and from C2C_{2} and C3C_{3} a clause of type C3C_{3}. We obtain NP={C1,C2,C3,C4}N_{P}^{*}=\{C_{1},C_{2},C_{3},C_{4}\}. By Theorem 14, the saturation of NN is NN^{*}:

{μ1(x,y)||P(x,y),μ2(x,y,z)||P(y,z)P(x,z),μ3(x,y)||¬P(x,y),μ4(x,y)||}\{\mu_{1}(x,y)||P(x,y),\,\mu_{2}(x,y,z)||P(y,z){\rightarrow}P(x,z),\,\mu_{3}(x,y)||\neg P(x,y),\,\mu_{4}(x,y)||\perp\},

where μ1,μ2,μ3,μ4\mu_{1},\mu_{2},\mu_{3},\mu_{4} are given by the minimal model 𝖬{\sf M} of CHNCH_{N}:

CHN={x=yμ1(x,y),y=x+1μ2(x,y,z),n(x,y)μ3(x,y),μ1(x,y)μ2(u,x,y)μ1(u,y),μ3(x,y)μ2(x,u,y)μ3(u,y),μ2(x,y,z)μ2(u,x,z)μ2(u,y,z),μ1(x,y)μ3(x,y)μ4(x,y)}\begin{array}[]{r@{}c@{}l}CH_{N}&=\{&x=y\rightarrow\mu_{1}(x,y),\quad y=x+1\rightarrow\mu_{2}(x,y,z),\quad n(x,y)\rightarrow\mu_{3}(x,y),\\ &&\mu_{1}(x,y)\wedge\mu_{2}(u,x,y)\rightarrow\mu_{1}(u,y),\quad\mu_{3}(x,y)\wedge\mu_{2}(x,u,y)\rightarrow\mu_{3}(u,y),\\ &&\mu_{2}(x,y,z)\wedge\mu_{2}(u,x,z)\rightarrow\mu_{2}(u,y,z),\quad\mu_{1}(x,y)\wedge\mu_{3}(x,y)\rightarrow\mu_{4}(x,y)\}\end{array}

μZ\mu Z cannot check whether this set of Horn constraints is satisfiable because of the parameter nn. If we replace n(x,y)n(x,y) with x>yx>y μZ\mu Z yields the following solution:

μ1(x,y)=xy,μ2(x,y,z)=(y>z)(x<z),μ3(x,y)=x>y,μ4=\mu_{1}(x,y)=x\leq y,~{}\mu_{2}(x,y,z)=(y>z)\lor(x<z),~{}\mu_{3}(x,y)=x>y,~{}\mu_{4}=\perp.

(ii) Alternatively, note that if we use the fact that x1xk1i=1kxi=xi1+1𝒯xk=x0+k\exists x_{1}\dots x_{k-1}~{}\bigwedge_{i=1}^{k}x_{i}{=}x_{i-1}{+}1\equiv_{{\mathcal{T}}}x_{k}=x_{0}+k we obtain an infinite set of clauses consisting of:

(1k)y=x+k||P(x,y)(2k)y=x+k||P(y,z)P(x,z)(3k)n(x,y)z=x+k||¬P(z,y)(4k)y=u+kn(u,y)||k\begin{array}[]{llllll}(1^{\prime}_{k})&y=x+k||P(x,y)&&(2^{\prime}_{k})&y=x+k||P(y,z)\rightarrow P(x,z)&\\ (3^{\prime}_{k})&n(x,y)\wedge z=x+k||\neg P(z,y)&&(4^{\prime}_{k})&y=u+k\wedge n(u,y)||\perp&k\in{\mathbb{N}}\end{array}

If we regard kk in each clause as a universally quantified variable (with additional condition k0k\geq 0) we obtain:

N={y=x+kk0||P(x,y),y=x+kk0||P(y,z),n(x,y)z=x+kk0||¬P(z,y),y=u+kk0n(u,y)||}.\begin{array}[]{ll}N^{\prime}=\{&y=x+k\wedge k\geq 0||P(x,y),~{}y=x+k\wedge k\geq 0||P(y,z),\\ &n(x,y)\wedge z=x+k\wedge k\geq 0||\neg P(z,y),~{}y=u+k\wedge k\geq 0\wedge n(u,y)||\perp\}.\end{array}

If 𝒜=(,nA)\mathcal{A}=({\mathbb{Z}},n_{A}), 𝒜PN\mathcal{A}\models\exists P~{}N^{\prime} iff 𝒜u,y,k(k0y=u+k¬n(u,y))\mathcal{A}\models\forall u,y,k~{}(k\geq 0\wedge y=u+k\rightarrow\neg n(u,y)).

Remark: In linear integer arithmetic the interpretations of (μi)1i4(\mu_{i})_{1\leq i\leq 4} in the minimal model of CHNCH_{N} w.r.t. the model 𝒜=(,nA)\mathcal{A}=({\mathbb{Z}},n_{A}), for a fixed interpretation of nn (say as nA(x,y)=(x>y)n_{A}(x,y)=(x>y)) are: μ1(x,y)=μ2(x,y,z)=k(k0y=x+k)\mu_{1}(x,y)=\mu_{2}(x,y,z)=\exists k(k\geq 0\wedge y=x+k), μ3(x,y)=zk(n(z,y)x=z+k)\mu_{3}(x,y)=\exists z\exists k(n(z,y)\wedge x=z+k) and μ4(x,y)=μ1(x,y)μ3(x,y)\mu_{4}(x,y)=\mu_{1}(x,y)\wedge\mu_{3}(x,y). \blacksquare

Example 6(ii) uses acceleration techniques, in particular the following result:

Theorem 15 ([14, 17])

Let NN be a set of constrained clauses of the form:

N={ϕ0(x¯)||R(x¯),ϕ(x¯)y¯=Mx¯+v¯||R(x¯)R(y¯)}N=\{\phi_{0}({\overline{x}})~{}||~{}R({\overline{x}}),\quad\phi({\overline{x}})\wedge{\overline{y}}=M\cdot{\overline{x}}+{\overline{v}}~{}||~{}R({\overline{x}})\rightarrow R({\overline{y}})\}

where x¯,y¯{\overline{x}},{\overline{y}} describe vectors of nn variables, v¯{\overline{v}} a vector of nn constants in {\mathbb{Z}}, ϕ0\phi_{0} is a condition expressible in Presburger arithmetic and M=(mi,j)1i,jnM=(m_{i,j})_{1\leq i,j\leq n} is a n×nn\times n matrix over {\mathbb{Z}}, and ϕ(x1,,xn)=i=1k(j=1naijxjbi)\phi(x_{1},\dots,x_{n})=\bigwedge_{i=1}^{k}(\sum_{j=1}^{n}a_{ij}x_{j}\leq b_{i}), where aij,bia_{ij},b_{i}\in{\mathbb{Z}}.

The interpretation of RR in the minimal model of NN is Presburger definable if M={Mnn}\left<M\right>=\{M^{n}\mid n\in{\mathbb{N}}\} is finite. If ϕ=\phi=\top then the interpretation of RR in the minimal model of NN is Presburger definable if and only if M={Mnn}\left<M\right>=\{M^{n}\mid n\in{\mathbb{N}}\} 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 𝒯{\mathcal{T}} be a theory with signature Π=(S,Σ,𝖯𝗋𝖾𝖽)\Pi=(S,\Sigma,{\sf Pred}), and let P¯1=P11,,Pn11{\overline{P}}_{1}=P^{1}_{1},\dots,P^{1}_{n_{1}} and P¯2=P12,,Pn22{\overline{P}}_{2}=P^{2}_{1},\dots,P^{2}_{n_{2}} be finite sequences of different predicate symbols with Pji𝖯𝗋𝖾𝖽P^{i}_{j}\not\in{\sf Pred}, and Πi=(Σ,𝖯𝗋𝖾𝖽{Pji1jni})\Pi_{i}=(\Sigma,{\sf Pred}\cup\{P^{i}_{j}\mid 1\leq j\leq n_{i}\}) for i=1,2i=1,2.

Let F1F_{1} be a universal Π1\Pi_{1}-formula and F2F_{2} be a universal Π2\Pi_{2}-formula. We analyze the problem of checking whether “P¯1F1\exists{\overline{P}}_{1}~{}F_{1} entails P¯2F2\exists{\overline{P}}_{2}~{}F_{2} w.r.t. 𝒯{\mathcal{T}}” holds.

Example 7

Such questions arise in the graph-theoretic problems discussed in Section 2. Let 𝐀{\bf A} be a class of graphs described by axioms 𝖠𝗑A{\sf Ax}_{A} and 𝐁{\bf B} be a class of graphs described by axioms 𝖠𝗑B{\sf Ax}_{B}. Let 𝒯{\mathcal{T}} be a theory used for expressing these axioms. Consider the +\cdot^{+} and \cdot^{-} transformations described in Section 2. Then 𝐀+𝐁{\bf A}^{+}\subseteq{\bf B}^{-} (i.e. for every graph H=(V,F)𝐀+H=(V,F)\in{\bf A}^{+} we have H𝐁H\in{\bf B}^{-}) if and only if EA(𝖠𝗑ATr+(EA,F))𝒯EB(𝖠𝗑BTr(EB,F))\exists E_{A}~{}({\sf Ax}_{A}\wedge Tr^{+}(E_{A},F))\models_{{\mathcal{T}}}\exists E_{B}~{}({\sf Ax}_{B}\wedge Tr^{-}(E_{B},F)). \blacksquare

Assume that there exist Π\Pi-formulae G1G_{1} and G2G_{2} such that G1𝒯P¯1F1G_{1}\equiv_{{\mathcal{T}}}\exists{\overline{P}}_{1}F_{1} and G2𝒯P¯2F2G_{2}\equiv_{{\mathcal{T}}}\exists{\overline{P}}_{2}F_{2}. Such formulae can be found either by saturation999We can iterate the application of 𝐻𝑅𝑒𝑠P\mathit{HRes}^{P}_{\succ} for variables P1i,,PniP^{i}_{1},\dots,P^{i}_{n} (in this order). This corresponds to a variant of ordered resolution which we denote by 𝐻𝑅𝑒𝑠P1i,,Pni\mathit{HRes}^{P^{i}_{1},\dots,P^{i}_{n}}_{\succ}; if saturation terminates the conjunction of clauses not containing P1i,,PniP^{i}_{1},\dots,P^{i}_{n} is equivalent to P1i,,PniNFi\exists P^{i}_{1},\dots,P^{i}_{n}~{}N_{F_{i}}, where NFiN_{F_{i}} is the clause form of FiF_{i}. by successively eliminating P1,,PnP_{1},\dots,P_{n}, or by using acceleration techniques or other methods. In this case, P¯1F1𝒯P¯2F2\exists{\overline{P}}_{1}~{}F_{1}\models_{{\mathcal{T}}}\exists{\overline{P}}_{2}~{}F_{2} iff G1𝒯G2G_{1}\models_{{\mathcal{T}}}G_{2} (which is the case iff G1¬G2𝒯G_{1}\wedge\neg G_{2}\models_{{\mathcal{T}}}\perp).

The problem of checking whether G1¬G2𝒯G_{1}\wedge\neg G_{2}\models_{{\mathcal{T}}}\perp is in general undecidable, even if G1G_{1} and G2G_{2} are universal formulae and 𝒯{\mathcal{T}} is the extension of Presburger arithmetic or real arithmetic with a new function or predicate symbol (cf. [44]).

If G1¬G2G_{1}\wedge\neg G_{2} is in a fragment of 𝒯{\mathcal{T}} for which checking satisfiability is decidable, then we can effectively check whether P¯1F1𝒯P¯2F2\exists{\overline{P}}_{1}~{}F_{1}\models_{{\mathcal{T}}}\exists\overline{P}_{2}~{}F_{2}. This is obviously the case when 𝒯{\mathcal{T}} is a decidable theory. We will show that a similar condition can be obtained for local theory extensions of theories allowing quantifier elimination if G1G_{1} and G2G_{2} 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 Π\Pi-formulae G1G_{1} and G2G_{2} such that G1𝒯P¯1F1G_{1}\equiv_{{\mathcal{T}}}\exists{\overline{P}}_{1}F_{1} and G2𝒯P¯2F2G_{2}\equiv_{{\mathcal{T}}}\exists{\overline{P}}_{2}F_{2}. If 𝒯{\mathcal{T}} is a decidable theory then we can effectively check whether P¯1F1𝒯P¯2F2\exists{\overline{P}}_{1}~{}F_{1}\models_{{\mathcal{T}}}\exists{\overline{P}}_{2}~{}F_{2}. If 𝒯{\mathcal{T}} has quantifier elimination and the formulae F1,F2F_{1},F_{2} contain parametric constants, we can use quantifier elimination in 𝒯{\mathcal{T}} to derive conditions on these parameters under which P¯1F1𝒯P¯2F2\exists{\overline{P}}_{1}\,F_{1}\models_{{\mathcal{T}}}\exists{\overline{P}}_{2}\,F_{2}.

Theorem 17

Assume that there exist universal Π\Pi-formulae G1G_{1} and G2G_{2} such that G1𝒯P¯1F1G_{1}\equiv_{{\mathcal{T}}}\exists{\overline{P}}_{1}F_{1} and G2𝒯P¯2F2G_{2}\equiv_{{\mathcal{T}}}\exists{\overline{P}}_{2}F_{2}, and that 𝒯=𝒯0𝒦{\mathcal{T}}={\mathcal{T}}_{0}\cup{\mathcal{K}}, where 𝒯0{\mathcal{T}}_{0} is a decidable theory with signature Π0=(S0,Σ0,𝖯𝗋𝖾𝖽0)\Pi_{0}=(S_{0},\Sigma_{0},{\sf Pred}_{0}) where S0S_{0} is a set of interpreted sorts and 𝒦{\mathcal{K}} is a set of (universally quantified) clauses over Π=(S0S1,Σ0Σ1,𝖯𝗋𝖾𝖽0𝖯𝗋𝖾𝖽1)\Pi=(S_{0}\cup S_{1},\Sigma_{0}\cup\Sigma_{1},{\sf Pred}_{0}\cup{\sf Pred}_{1}), where (i) S1S_{1} is a new set of uninterpreted sorts, (ii) Σ1,𝖯𝗋𝖾𝖽1\Sigma_{1},{\sf Pred}_{1} are sets of new function, resp. predicate symbols which have only arguments of uninterpreted sort S1\in S_{1}, and all function symbols in Σ1\Sigma_{1} have interpreted output sort S0\in S_{0}. Assume, in addition, that all variables and constants of sort S1\in S_{1} in 𝒦,G1{\mathcal{K}},G_{1} and ¬G2\neg G_{2} occur below function symbols in Σ1\Sigma_{1}. Then:

  • (1)

    We can use the decision procedure for 𝒯0{\mathcal{T}}_{0} to effectively check whether G1¬G2𝒯G_{1}\wedge\neg G_{2}\models_{{\mathcal{T}}}\perp (hence if P¯1F1𝒯P¯2F2\exists{\overline{P}}_{1}~{}F_{1}\models_{{\mathcal{T}}}\exists{\overline{P}}_{2}~{}F_{2}).

  • (2)

    If 𝒯0{\mathcal{T}}_{0} allows quantifier elimination and the formulae F1,F2F_{1},F_{2} (hence also G1,G2G_{1},G_{2}) contain parametric constants and functions, we can use Algorithm 1 for obtaining constraints on the parameters under which P¯1F1𝒯P¯2F2\exists{\overline{P}}_{1}~{}F_{1}\models_{{\mathcal{T}}}\exists{\overline{P}}_{2}~{}F_{2}.

Proof: Let CC be the set of constants of uninterpreted sort sS1s\in S_{1} occurring in 𝒦,G1{\mathcal{K}},G_{1} and ¬G2\neg G_{2}. Note that G1¬G2G_{1}\wedge\neg G_{2} is satisfiable w.r.t. 𝒯=𝒯0𝒦{\mathcal{T}}={\mathcal{T}}_{0}\cup{\mathcal{K}} iff (𝒦G1)[C]¬G2({\mathcal{K}}\wedge G_{1})^{[C]}\wedge\neg G_{2} is satisfiable, where (𝒦G1)[C]({\mathcal{K}}\wedge G_{1})^{[C]} is the set of all instances of 𝒦G1{\mathcal{K}}\wedge G_{1} in which the variables of sort sS1s\in S_{1} are replaced with constants of sort ss in CC. (1) The hierarchical reasoning method in Theorem 4 allows us to reduce testing whether G1¬G2𝒯G_{1}\wedge\neg G_{2}\models_{{\mathcal{T}}}\perp to a satisfiability test w.r.t. 𝒯0{\mathcal{T}}_{0}. (2) If 𝒯0{\mathcal{T}}_{0} allows QE we can use Theorem 2. \Box

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 𝐐𝐔𝐃𝐆(r)=(𝐌𝐢𝐧𝐃𝐆(r)𝐌𝐚𝐱𝐃𝐆(1)){\bf QUDG}(r)=({\bf MinDG}(r)\cap{\bf MaxDG}(1))^{-}, be axiomatized by 𝖬𝗂𝗇𝖣𝖦(r)𝖬𝗂𝗇𝖣𝖦(1)𝖳𝗋(E,F){\sf MinDG}(r)\wedge{\sf MinDG}(1)\wedge{\sf Tr^{-}}(E,F), where:

𝖬𝗂𝗇𝖣𝖦(r):x,yπi(x,y,r)E(x,y) where πi(x,y,r)=xyd(x,y)r(x)𝖬𝖺𝗑𝖣𝖦(1):x,yπe(x,y)¬E(x,y) where πe(x,y)=d(x,y)>1𝖳𝗋(E,F):x,y(F(x,y)E(x,y)E(y,x)).\begin{array}[]{llll}{\sf MinDG}(r):&\forall x,y&\pi^{i}(x,y,r)\rightarrow E(x,y)&\quad\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\text{ where }\pi^{i}(x,y,r)=x\neq y\land d(x,y)\leq r(x)\\ {\sf MaxDG}(1):&\forall x,y&\pi^{e}(x,y)\rightarrow\lnot E(x,y)&\quad\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\text{ where }\pi^{e}(x,y)=d(x,y)>1\\ {\sf Tr^{-}}(E,F):&\forall x,y&(F(x,y)\leftrightarrow E(x,y)\land E(y,x))&.\end{array}

We want to check whether 𝐀(r)𝐁(r){\bf A}(r)\subseteq{\bf B}(r), where 𝐀(r)=𝐐𝐔𝐃𝐆(r){\bf A}(r)={\bf QUDG}(r) and 𝐁(r)=(𝐌𝐢𝐧𝐃𝐆(r)𝐌𝐚𝐱𝐃𝐆(1))+{\bf B}(r)=({\bf MinDG}(r)\cap{\bf MaxDG}(1))^{+} is described by 𝖬𝗂𝗇𝖣𝖦(r)𝖬𝗂𝗇𝖣𝖦(1)𝖳𝗋+(E,F){\sf MinDG}(r)\wedge{\sf MinDG}(1)\wedge{\sf Tr^{+}}(E,F).

We obtain the axiomatization G1G_{1} by eliminating EE from

E(𝖬𝗂𝗇𝖣𝖦(r)𝖬𝗂𝗇𝖣𝖦(1)𝖳𝗋(E,F))\exists E({\sf MinDG}(r)\wedge{\sf MinDG}(1)\wedge{\sf Tr^{-}}(E,F))

and the axiomatization G2G_{2} by eliminating EE from

E(𝖬𝗂𝗇𝖣𝖦(r)𝖬𝗂𝗇𝖣𝖦(1)𝖳𝗋+(E,F)).\exists E({\sf MinDG}(r)\wedge{\sf MinDG}(1)\wedge{\sf Tr^{+}}(E,F)).

G1x,yπi(x,y,r)πe(x,y)x,yπi(x,y)πi(y,x)F(y,x)x,yπe(x,y)¬F(x,y)x,yπe(x,y)¬F(y,x)x,yF(x,y)F(y,x)\begin{array}[]{lll}&G_{1}&\\ \hline\cr\forall x,y{}&\pi^{i}(x,y,r)\land\pi^{e}(x,y)&\rightarrow~{}~{}\perp\\ \forall x,y&\pi^{i}(x,y)\land\pi^{i}(y,x)&\rightarrow~{}~{}F(y,x)\\ \forall x,y&\pi^{e}(x,y)&\rightarrow\neg F(x,y)\\ \forall x,y&\pi^{e}(x,y)&\rightarrow\neg F(y,x)\\ \forall x,y&F(x,y)&\rightarrow~{}~{}F(y,x)\\ &&\end{array}G2x,yπi(x,y,r)πe(x,y)x,yπe(x,y)πe(y,x)¬F(y,x)x,yπi(x,y)F(x,y)x,yπi(x,y)F(y,x)x,yF(x,y)F(y,x)xπe(x,x)¬F(x,x)\begin{array}[]{lll}&G_{2}&\\ \hline\cr\forall x,y{}&\pi^{i}(x,y,r)\land\pi^{e}(x,y)&\rightarrow~{}~{}\perp\\ \forall x,y&\pi^{e}(x,y)\land\pi^{e}(y,x)&\rightarrow\neg F(y,x)\\ \forall x,y&\pi^{i}(x,y)&\rightarrow~{}~{}F(x,y)\\ \forall x,y&\pi^{i}(x,y)&\rightarrow~{}~{}F(y,x)\\ \forall x,y&F(x,y)&\rightarrow~{}~{}F(y,x)\\ \forall x&\pi^{e}(x,x)&\rightarrow\neg F(x,x)\end{array}

We check whether G1𝒯G2G_{1}\models_{{\mathcal{T}}}G_{2}, i.e. whether G1¬G2G_{1}\wedge\neg G_{2} is unsatisfiable w.r.t. 𝒯{\mathcal{T}}, where ¬G2\neg G_{2} is the disjunction of the following ground formulae (we ignore the negation of the first clause obviously implied by G1G_{1}):

(g1)πe(a,b)πe(b,a)F(b,a)(g2)πe(a,a)F(a,a)(g3)F(a,b)¬F(b,a)(g4)πi(a,b)¬F(a,b)(g5)πi(a,b)¬F(b,a)\begin{array}[]{llllllll}~{}(g_{1})&\pi^{e}(a,b)\wedge\pi^{e}(b,a)\wedge F(b,a)&&(g_{2})&\pi^{e}(a,a)\wedge F(a,a)&&(g_{3})&F(a,b)\wedge\neg F(b,a)\\ ~{}(g_{4})&\pi^{i}(a,b)\wedge\neg F(a,b)&&(g_{5})&\pi^{i}(a,b)\wedge\neg F(b,a)\\ \end{array}

By Theorem 17 (2), we can consider the set of all instances of G1G_{1} in which the variables of sort 𝗉{\sf p} are replaced with the constants a,ba,b, then use a method for checking ground satisfiability of G1[T]giG_{1}[T]\wedge g_{i} w.r.t.  𝒯du{\mathcal{T}}^{u}_{d} (dd is uninterpreted), 𝒯dp{\mathcal{T}}^{p}_{d} (dd is positive), 𝒯ds{\mathcal{T}}^{s}_{d} (dd is symmetric) and 𝒯dm{\mathcal{T}}^{m}_{d} (dd 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 G1[T]giG_{1}[T]\wedge g_{i} is unsatisfiable for i{1,2,3}i\in\{1,2,3\}, but satisfiable for i{4,5}i\in\{4,5\} (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 G1[T]giG_{1}[T]\wedge g_{i} is unsatisfiable. We give here two examples:

(1) We consider dd and rr to be parameters, i.e. we eliminate only FF from G1[T]giG_{1}[T]\wedge g_{i}. For 𝒯dm{\mathcal{T}}^{m}_{d} we get the condition

Cd,r=x,y(xyd(x,y)1d(x,y)r(x)d(y,x)r(y)).C^{d,r}=\forall x,y(x\neq y\wedge d(x,y)\leq 1\wedge d(x,y)\leq r(x)\rightarrow d(y,x)\leq r(y)).

(2) We consider only rr to be a parameter, i.e. we eliminate the symbols FF and dd. For 𝒯ds{\mathcal{T}}^{s}_{d} we obtain the condition

Cr=x,y(r(y)<1xyr(y)r(x)).C^{r}=\forall x,y(r(y)<1\wedge x\neq y\rightarrow r(y)\geq r(x)).

This condition holds e.g. if r(x)=r(y)r(x)=r(y) for all x,yx,y, i.e. if rr is a constant function. Adding this as an additional condition we get unsatisfiability of G1[T]giG_{1}[T]\wedge g_{i} with i{4,5}i\in\{4,5\} for 𝒯dm{\mathcal{T}}^{m}_{d} and 𝒯ds{\mathcal{T}}^{s}_{d}, but not for 𝒯du{\mathcal{T}}^{u}_{d} and 𝒯dp{\mathcal{T}}^{p}_{d}.

Checking the other inclusion We now check whether 𝐁(r)𝐀(r){\bf B}(r)\subseteq{\bf A}(r), where 𝐀(r)=𝐐𝐔𝐃𝐆(r){\bf A}(r)={\bf QUDG}(r) and 𝐁(r)=(𝐌𝐢𝐧𝐃𝐆(r)𝐌𝐚𝐱𝐃𝐆(1))+{\bf B}(r)=({\bf MinDG}(r)\cap{\bf MaxDG}(1))^{+}. We have the axiomatizations G1G_{1}, G2G_{2} for the two classes.

We check whether G2𝒯G1G_{2}\models_{{\mathcal{T}}}G_{1}, i.e. whether G2¬G1G_{2}\wedge\neg G_{1} is unsatisfiable w.r.t. 𝒯{\mathcal{T}}, where ¬G1\neg G_{1} is the disjunction of the following ground formulae (we ignore the negation of the first clause obviously implied by G2G_{2}):

(g1)πi(a,b)πi(b,a)¬F(b,a)(g2)πe(a,b)F(a,b)(g3)πi(a,b)¬F(b,a)(g4)F(a,b)¬F(b,a)\begin{array}[]{llllllll}~{}(g_{1})&\pi^{i}(a,b)\wedge\pi^{i}(b,a)\wedge\neg F(b,a)&&(g_{2})&\pi^{e}(a,b)\wedge F(a,b)\\ ~{}(g_{3})&\pi^{i}(a,b)\wedge\neg F(b,a)&&(g_{4})&F(a,b)\wedge\neg F(b,a)\\ \end{array}

We use H-PILoT for checking ground satisfiability of G2[T]giG_{2}[T]\wedge g_{i} w.r.t.  𝒯{𝒯du,𝒯dp,𝒯ds,𝒯dm}{\mathcal{T}}\in\{{\mathcal{T}}^{u}_{d},{\mathcal{T}}^{p}_{d},{\mathcal{T}}^{s}_{d},{\mathcal{T}}^{m}_{d}\}. For TsT_{s} and TmT_{m} we obtain unsatisfiability of G2[T]giG_{2}[T]\wedge g_{i} for i{1,2,3,4}i\in\{1,2,3,4\}, thus we have proved that the inclusion holds for these two theories. For TpT_{p} and TuT_{u} we get satisfiability for cases 2 and 3. We use Algorithm 1 to obtain conditions on parameters such that G2[T]g2G_{2}[T]\wedge g_{2} and G2[T]g3G_{2}[T]\wedge g_{3} is unsatisfiable.

If we consider dd and rr to be parameters, i.e. we eliminate only FF from G1[T]giG_{1}[T]\wedge g_{i} we obtain the condition

Cd,r=x,y(d(y,x)>1d(x,y)1d(x,y)r(x)x=y).C^{d,r}=\forall x,y(d(y,x)>1\lor d(x,y)\leq 1\lor d(x,y)\leq r(x)\lor x=y).

It is easy to see that this condition holds if dd is symmetric. \blacksquare

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 F(P1,,Pn)F(P_{1},\dots,P_{n}) containing predicate symbols P1,,PnP_{1},\dots,P_{n} 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 P1,PnF(P1,,Pn)\exists P_{1},\dots\exists P_{n}F(P_{1},\dots,P_{n}), which does not contain the predicate symbols P1,,PnP_{1},\dots,P_{n}.

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 Ψ\Psi-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 𝒯{\mathcal{T}} and for checking entailment between formulae. Property-based symbol elimination proved useful for obtaining (weakest) constraints Γ\Gamma on “parameters” used in the description of the theory 𝒯{\mathcal{T}} such that satisfiability or entailment is guaranteed in models satisfying Γ\Gamma.

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 μZ\mu Z 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. μ\muZ- 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 \forall\exists^{*} 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 (c1)(c1), (c2)(c2) and (c3)(c3) from Example 2 are valid w.r.t. 𝒯=𝒯dm𝖥𝗋𝖾𝖾(r1,r2){\mathcal{T}}={\mathcal{T}}_{d}^{m}\cup{\sf Free}(r_{1},r_{2}). For this we show, one after the other, that the negation of each of these formulae is unsatisfiable w.r.t. 𝒯{\mathcal{T}}. We start with (c1)(c1). In the input file for H-PILoT we have the axioms for a metric specified under Clauses and the negation of (c1)(c1) is the Query.

Base_functions:={(+,2), (-,2), (*,2)}
Extension_functions:={(r1, 1, 1), (r2, 1, 1), (d, 2, 1)}
Relations:={(<=, 2), (<, 2), (>=, 2), (>, 2)}
Clauses := (FORALL x,y). d(x,y) = _0 –> x = y;
(FORALL x,y). x = y –> d(x,y) = _0;
(FORALL x,y). d(x,y) = d(y,x);
(FORALL x,y,z). d(x,y) <= d(x,z) + d(z,y);
Query := NOT(u = v);
d(u,v) <= r1(u);
NOT(u = w);
d(u,w) <= d(u,v);
OR(u = w, d(u,w) > r1(u));

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:

Reduced problem written to
example4-check_redundancy_1.smt.
unsat
H-PILoT spent 0.013423s on the problem.
The prover needed 0.012652s for the problem.
Total running time: 0.026075s.

The answer is “unsat” (unsatisfiable), so we have proved that (c1)(c1) is valid w.r.t. 𝒯=𝒯dm𝖥𝗋𝖾𝖾(r1,r2){\mathcal{T}}={\mathcal{T}}_{d}^{m}\cup{\sf Free}(r_{1},r_{2}). In the same way we can prove validity of (c2)(c2) and (c3)(c3) w.r.t. 𝒯dm𝖥𝗋𝖾𝖾(r1,r2){\mathcal{T}}_{d}^{m}\cup{\sf Free}(r_{1},r_{2}), and also the validity of the three formulae w.r.t. 𝒯du𝖥𝗋𝖾𝖾(r1,r2){\mathcal{T}}_{d}^{u}\cup{\sf Free}(r_{1},r_{2}), 𝒯dp𝖥𝗋𝖾𝖾(r1,r2){\mathcal{T}}_{d}^{p}\cup{\sf Free}(r_{1},r_{2}) and 𝒯dn𝖥𝗋𝖾𝖾(r1,r2){\mathcal{T}}_{d}^{n}\cup{\sf Free}(r_{1},r_{2}).

Remark. The encoding in H-PILoT presented above did not use two different sorts 𝗉{\sf p} and 𝗇𝗎𝗆{\sf num} as described in the theoretical considerations. Since in our case the sort 𝗉{\sf p} can be considered to be uninterpreted and there are no function symbols of arity 𝗉k𝗉{\sf p}^{k}\rightarrow{\sf p}, the following holds: Let GG be a flat ground formula over a signature containing a binary function dd and a unary function r1r_{1} with the property that the only constraints on the constants used as arguments for dd and r1r_{1} are equalities and disequalities. Then the following are equivalent:

  • (1)

    GG is satisfiable w.r.t. the extension of {\mathbb{R}} with a binary function dd satisfying the metric axioms and a unary free function symbol r1r_{1}.

  • (2)

    GG is satisfiable w.r.t. the extension of the two-sorted theory 𝒯dm{\mathcal{T}}^{m}_{d} with the free function r1r_{1}.

Indeed, from every model 𝒜=(,dA:2,r1A:)\mathcal{A}=({\mathbb{R}},d_{A}:{\mathbb{R}}^{2}\rightarrow{\mathbb{R}},{r_{1}}_{A}:{\mathbb{R}}\rightarrow{\mathbb{R}}) of GG w.r.t. the extension of {\mathbb{R}} with a binary function dd satisfying the metric axioms and a unary free function symbol r1r_{1}, we can define a model

=(B𝗉,,dB:B𝗉2,r1B:B𝗉)\mathcal{B}=(B_{\sf p},{\mathbb{R}},d_{B}:B_{\sf p}^{2}\rightarrow{\mathbb{R}},{r_{1}}_{B}:B_{\sf p}\rightarrow{\mathbb{R}})

of 𝒯dm𝖥𝗋𝖾𝖾(r1){\mathcal{T}}^{m}_{d}\cup{\sf Free}(r_{1}) as follows:

  • Take as 𝗉\mathcal{B}_{\sf p} an isomorphic copy (via isomorphism ii) of the set
    {c𝒜c constant of sort p occurring in G}\{c_{\mathcal{A}}\mid c\text{ constant of sort {\sf p} occurring in }G\},

  • Define dB,r1Bd_{B},{r_{1}}_{B} as follows:

    • d(i(c𝒜),i(d𝒜)):=d𝒜(c𝒜,d𝒜)d_{\mathcal{B}}(i(c_{\mathcal{A}}),i(d_{\mathcal{A}})):=d_{\mathcal{A}}(c_{\mathcal{A}},d_{\mathcal{A}});

    • r1(i(c𝒜)):=r1𝒜(c𝒜){r_{1}}_{\mathcal{B}}(i(c_{\mathcal{A}})):={r_{1}}_{\mathcal{A}}(c_{\mathcal{A}}).

The converse implication is analogous, with the only difference that we first construct a partial algebra 𝒜=(,dA:2,r1A:)\mathcal{A}=({\mathbb{R}},d_{A}:{\mathbb{R}}^{2}\rightarrow{\mathbb{R}},{r_{1}}_{A}:{\mathbb{R}}\rightarrow{\mathbb{R}}) by considering an injective map from the support of sort 𝗉{\sf p} in {\mathbb{R}} and then we use the locality property of 𝒯dm𝖥𝗋𝖾𝖾(r1){\mathcal{T}}^{m}_{d}\cup{\sf Free}(r_{1}) to prove the existence of a total model with support {\mathbb{R}}.

0.A.2 Tests for Example 4

We use sehpilot (an implementation of Algorithm 1) to derive constraints Γ\Gamma on the parameters r1,r2r_{1},r_{2} such that

πi(u,v)πe(u,v)=(uvd(u,v)r1(u))(d(u,v)>r2(u))\pi^{i}(u,v)\wedge\pi^{e}(u,v)=(u\neq v\land d(u,v)\leq r_{1}(u))\wedge(d(u,v)>r_{2}(u))

is unsatisfiable (we consider the case in which dd 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:

Base_functions:={(+,2), (-,2), (*,2)}
Extension_functions:={(r1, 1, 1), (r2, 1, 1), (d, 2, 1)}
Relations:={(<=, 2), (<, 2), (>=, 2), (>, 2)}
Query := NOT(u = v);
d(u,v) <= r1(u);
d(u,v) > r2(u);

Note that when using sehpilot the user has to specify which symbols have to be eliminated.

Assume that r1r_{1} and r2r_{2} are parameters (and thus should not be eliminated). Since the variable uu occurs as an argument of r1r_{1} and r2r_{2} (which are parameters), uu should not be eliminated. We have to eliminate the remaining symbols, i.e. vv and dd. We obtain the following output (in verbose mode) from sehpilot:

[2021-02-12 14:06:07,115 | INFO] convert prefix notation
{’e_3’: r2(u)’, e_2’: r1(u)’, e_1’: d(u, v)’}
to
{’e_3’: r2(u)’, e_2’: r1(u)’, e_1’: d(u, v)’}
[2021-02-12 14:06:07,115 | INFO] assignments of new variables
e_3 = r2(u)
e_2 = r1(u)
e_1 = d(u, v)
[2021-02-12 14:06:07,115 | INFO] reduced assignments
e_3 = r2(u)
e_2 = r1(u)
e_1 = d(u, v)
[2021-02-12 14:06:07,115 | INFO] variables that will be eliminated
by REDLOG:
e_1, d, v
[2021-02-12 14:06:07,116 | INFO] extension functions declared in loc-file
[(’r1’, 1, 1), (’r2’, 1, 1), (’d’, 2, 1)]
[2021-02-12 14:06:07,116 | INFO] universal arguments
u, u
[2021-02-12 14:06:07,116 | INFO] add switches:
off nat;
[2021-02-12 14:06:07,117 | INFO] saved REDLOG file with
new variable declaration
/home/dpeuter/Work/FroCoS-2021/example4.dat
[2021-02-12 14:06:07,315 | INFO] REDLOG query after
variable elimination:
all(u, e_2 - e_3 > 0)
[2021-02-12 14:06:07,315 | INFO] REDLOG command:
run_redlog_computation := not (e_2 - e_3 > 0);
[2021-02-12 14:06:07,508 | INFO] REDLOG command:
run_redlog_computation := rlnnf (not(e_2 - e_3 > 0));
[2021-02-12 14:06:07,707 | INFO] reduce constants {} of
e_2 - e_3 <= 0
to
e_2 - e_3 <= 0
[2021-02-12 14:06:07,707 | INFO] REDLOG command:
run_redlog_computation := rlsimpl (e_2 - e_3 <= 0);
Constraints (H-PILoT syntax, reduced):
(FORALL u). r1(u) - r2(u) <= _0

The generated constraint Γ=u(r1(u)r2(u))\Gamma=\forall u(r_{1}(u)\leq r_{2}(u)) 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 (e1e_{1}, e2e_{2} and e3e_{3}) and which terms they represent. The output also shows the result obtained directly after the elimination (e2>e3e_{2}>e_{3}), the negation of this result (e2e3)e_{2}\leq e_{3}), and finally the universally quantified formula with the constants replaced back with the corresponding terms (u(r1(u)r2(u))\forall u(r_{1}(u)\leq r_{2}(u))).

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 𝗉{\sf p} are only equalities and disequalities. If variables initially of sort 𝗉{\sf p} are eliminated, they do not occur below any parameter. Such variables occur separately from the variables of original sort 𝗇𝗎𝗆{\sf num} in the quantifier elimination problem.

This means that the quantifier elimination problem is of the form

x1,,xny1,,ymC𝗉(x1,,xn)C𝗇𝗎𝗆(y1,,ym)\exists x_{1},\dots,x_{n}\exists y_{1},\dots,y_{m}C_{\sf p}(x_{1},\dots,x_{n})\wedge C_{\sf num}(y_{1},\dots,y_{m})

where x1,,xnx_{1},\dots,x_{n} are variables of sort 𝗉{\sf p} and y1,,ymy_{1},\dots,y_{m} are variables of sort 𝗇𝗎𝗆{\sf num}, which is equivalent to:

x1,,xnC𝗉(x1,,xn)y1,,ymC𝗇𝗎𝗆(y1,,ym).\exists x_{1},\dots,x_{n}C_{\sf p}(x_{1},\dots,x_{n})~{}~{}\wedge~{}~{}\exists y_{1},\dots,y_{m}C_{\sf num}(y_{1},\dots,y_{m}).

Quantifier elimination in the theory of real-closed fields can be used for the formula y1,,ymC𝗇𝗎𝗆(y1,,ym)\exists y_{1},\dots,y_{m}C_{\sf num}(y_{1},\dots,y_{m}).

If we consider theories whose models of sort 𝗉{\sf p} contain infinitely many elements, then – since the constraint C𝗉C_{\sf p} 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

𝐐𝐔𝐃𝐆(r)=(𝐌𝐢𝐧𝐃𝐆(r)𝐌𝐚𝐱𝐃𝐆(1))(𝐌𝐢𝐧𝐃𝐆(r)𝐌𝐚𝐱𝐃𝐆(1))+{\bf QUDG}(r)=({\bf MinDG}(r)\cap{\bf MaxDG}(1))^{-}\subseteq({\bf MinDG}(r)\cap{\bf MaxDG}(1))^{+}

holds we have to check whether G1giG_{1}\land g_{i} is unsatisfiable for all i1,2,3,4,5i\in{1,2,3,4,5} (where G1G_{1} is the axiomatization for 𝐐𝐔𝐃𝐆(r){\bf QUDG}(r) and the gig_{i} are the ground formulae obtained from the negation of G2G_{2}, the axiomatization of the other class; cf. Example 8).

We assume that dd is a metric. Using H-PILoT we can show that G1giG_{1}\land g_{i} is unsatisfiable w.r.t. 𝒯dm{\mathcal{T}}_{d}^{m} for i{1,2,3}i\in\{1,2,3\}. We here only show the test for the case G1g4G_{1}\land g_{4} in detail (the case G1g5G_{1}\land g_{5} is similar and yields the same results).

We check satisfiability of G1g4G_{1}\land g_{4} w.r.t. 𝒯dm{\mathcal{T}}_{d}^{m} using H-PILoT. We have the following input file:

Base_functions:={(+,2), (-,2), (*,2)}
Extension_functions:={(r, 1, 1), (d, 2, 1), (F, 2, 1)}
Relations:={(<=, 2), (<, 2), (>=, 2)}
Clauses :=
% axioms for G1
(FORALL x,y). d(x,y) <= r(x), d(x,y) > _1
–> x = y, _0 = _1;
(FORALL x,y). d(x,y) <= r(x), d(y,x) <= r(y)
–> x = y, F(y,x) = _1;
(FORALL x,y). d(x,y) > _1 –> F(x,y) = _0;
(FORALL x,y). d(x,y) > _1 –> F(y,x) = _0;
(FORALL x,y). F(x,y) = _1 –> F(y,x) = _1;
% axioms for d being a metric
(FORALL x,y). d(x,y) >= _0;
(FORALL x,y). d(x,y) = _0 –> x = y;
(FORALL x,y). x = y –> d(x,y) = _0;
(FORALL x,y). d(x,y) = d(y,x);
(FORALL x,y,z). d(x,y) <= d(x,z) + d(z,y);
% F is either 0 or 1
(FORALL x,y). –> F(x,y) = _0, F(x,y) = _1;
Query :=
% g4 of (not G2)
NOT(a = b);
d(a,b) <= r(a);
F(a,b) = _0;
% needed for instantiation
F(a,b) = F(a,b);
F(b,a) = F(b,a);
F(a,a) = F(a,a);
F(b,b) = F(b,b);
d(a,b) = d(a,b);
d(b,a) = d(b,a);
d(a,a) = d(a,a);
d(b,b) = d(b,b);
r(a) = r(a);
r(b) = r(b);}

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:

Reduced problem written to example8-Tm-4.smt.
Unknown. Prover says sat but this can only be trusted
for local extensions and this problem is not known to be
local.
H-PILoT spent 0.208608s on the problem.
The prover needed 0.01677 s for the problem.
Total running time: 0.225378s.

Since we know that 𝒯dm𝖥𝗋𝖾𝖾(r1,r2){\mathcal{T}}^{m}_{d}\cup{\sf Free}(r_{1},r_{2}) is a Ψ\Psi-local theory extension and we ensured that H-PILoT computes sufficiently many instances, we know that G1g4G_{1}\wedge g_{4} is satisfiable. This means that the class inclusion does not hold in general. We use sehpilot to derive (weakest) conditions Γ\Gamma on parameters such that unsatisfiability of G1Γg4G_{1}\land\Gamma\land g_{4} is guaranteed.

We first consider rr to be the only parameter, i.e. we tell sehpilot to eliminate FF and dd (aa and bb appear as arguments of parameter rr 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:

[2021-02-20 12:55:56,356 | INFO] convert prefix notation
{’e_10’: r(b)’, e_9’: r(a)’, e_8’: d(b, b)’,
e_7’: d(b, a)’, e_6’: d(a, b)’, e_5’: d(a, a)’,
e_4’: F(b, b)’, e_3’: F(b, a)’, e_2’: F(a, b)’,
e_1’: F(a, a)’}
to
{’e_10’: r(b)’, e_9’: r(a)’, e_8’: d(b, b)’,
e_7’: d(b, a)’, e_6’: d(a, b)’, e_5’: d(a, a)’,
e_4’: F(b, b)’, e_3’: F(b, a)’, e_2’: F(a, b)’,
e_1’: F(a, a)’}
[2021-02-20 12:55:56,356 | INFO] assignments of new variables
e_10 = r(b)
e_9 = r(a)
e_8 = d(b, b)
e_7 = d(b, a)
e_6 = d(a, b)
e_5 = d(a, a)
e_4 = F(b, b)
e_3 = F(b, a)
e_2 = F(a, b)
e_1 = F(a, a)
[2021-02-20 12:55:56,356 | INFO] reduced assignments
e_10 = r(b)
e_9 = r(a)
e_8 = d(b, b)
e_7 = d(b, a)
e_6 = d(a, b)
e_5 = d(a, a)
e_4 = F(b, b)
e_3 = F(b, a)
e_2 = F(a, b)
e_1 = F(a, a)
[2021-02-20 12:55:56,356 | INFO] variables that will be
eliminated by REDLOG:
e_1, e_7, e_6, e_3, d, e_5, e_8, e_4, F, e_2
[2021-02-20 12:55:56,357 | INFO] extension functions
declared in loc-file
[(’r’, 1, 1), (’d’, 2, 1), (’F’, 2, 1)]
[2021-02-20 12:55:56,357 | INFO] universal arguments
b, a
[2021-02-20 12:55:56,358 | INFO] add switches:
off nat;
[2021-02-20 12:55:56,358 | INFO] saved REDLOG file with
new variable declaration
/home/dpeuter/Work/FroCoS-2021/example8/example8-Tm-4.dat
[2021-02-20 12:55:56,631 | INFO] REDLOG query after
variable elimination:
all({a, b}, e_9 > 0 and e_9 - 1 <= 0 and e_10 - e_9 < 0
and a - b <> 0 or e_9 - 1
>= 0 and e_10 - 1 < 0 and a - b <> 0)
[2021-02-20 12:55:56,631 | INFO] REDLOG command:
run_redlog_computation := not (e_9 > 0 and e_9 - 1 <= 0
and e_10 - e_9 < 0 and a - b <> 0 or e_9 - 1 >= 0
and e_10 - 1 < 0 and a - b <> 0);
[2021-02-20 12:55:56,830 | INFO] REDLOG command:
run_redlog_computation := rlnnf (not(e_9 > 0
and e_9 - 1 <= 0 and e_10 - e_9 < 0 and a - b <> 0
or e_9 - 1 >= 0 and e_10 - 1 < 0 and a - b <> 0));
[2021-02-20 12:55:57,039 | INFO] reduce constants {} of
(e_9 <= 0 or e_9 - 1 > 0 or e_10 - e_9 >= 0 or a - b = 0)
and (e_9 - 1 < 0 or e_10 - 1 >= 0 or a - b = 0)
to
(e_9 <= 0 or e_9 - 1 > 0 or e_10 - e_9 >= 0 or a - b = 0)
and (e_9 - 1 < 0 or e_10 - 1 >= 0 or a - b = 0)
[2021-02-20 12:55:57,039 | INFO] REDLOG command:
run_redlog_computation := rlsimpl ((e_9 <= 0
or e_9 - 1 > 0 or e_10 - e_9 >= 0 or a - b = 0)
and (e_9 - 1 < 0 or e_10 - 1 >= 0 or a - b = 0));
Constraints (H-PILoT syntax, reduced):
(FORALL a, b). AND(OR(r(a) <= _0, r(a) - _1 > _0,
r(b) - r(a) >= _0, a - b = _0), OR(r(a) - _1 < _0,
r(b) - _1 >= _0, a - b = _0))

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

Cr=x,y(r(y)<1xyr(y)r(x)).C^{r}=\forall x,y(r(y)<1\wedge x\neq y\rightarrow r(y)\geq r(x)).

We could also choose different parameters, e.g. we could assume dd and rr to be parameters and then tell sehpilot to eliminate only FF. In this case the computed constraint will be:

Constraints (H-PILoT syntax, reduced):
(FORALL b, a). OR(NOT(d(b, b) = _0), d(b, a) <= _0,
d(a, b) <= _0, d(a, b) - _1 > _0, d(a, b) - r(a) > _0,
NOT(d(a, b) - d(b, a) = _0), NOT(d(a, a) = _0),
r(b) - d(b, a) >= _0, a - b = _0)

This constraint can be simplified to

Cd,r=x,y(xyd(x,y)1d(x,y)r(x)d(y,x)r(y)).C^{d,r}=\forall x,y(x\neq y\wedge d(x,y)\leq 1\wedge d(x,y)\leq r(x)\rightarrow d(y,x)\leq r(y)).

Appendix 0.B Proof of Theorem 2

Theorem 2. Let 𝒦{\mathcal{K}} be a set of Σ\Sigma-flat clauses, with the property that every variable occurs only once in every term. Let Ψ\Psi be a term closure operator with the property that for every flat set of ground terms TT, Ψ(T)\Psi(T) is flat.

Assume that 𝒦{\mathcal{K}} and Ψ\Psi have the property that for every flat set of ground terms TT and for every clause C𝒦C\in{\mathcal{K}}, if CC contains terms f(x1,,x,,xn)f(x_{1},\dots,x,\dots,x_{n}) and g(y1,,x,,ym)g(y_{1},\dots,x,\dots,y_{m}) (where f,gΣf,g\in\Sigma are extension functions and ff and gg are not necessarily different), if f(t1,,t,,tn),g(s1,,s,,sm)Ψ𝒦(T)f(t_{1},\dots,t,\dots,t_{n}),g(s_{1},\dots,s,\dots,s_{m})\in\Psi_{{\mathcal{K}}}(T) then f(t1,,s,,tn),g(s1,,t,,sm)Ψ𝒦(T)f(t_{1},\dots,s,\dots,t_{n}),g(s_{1},\dots,t,\dots,s_{m})\in\Psi_{{\mathcal{K}}}(T). Then (𝖤𝗆𝖻w,fΨ)({\sf Emb}_{w,f}^{\Psi}) implies (𝖫𝗈𝖼fΨ)({\sf Loc}_{f}^{\Psi}).

Proof: Assume that 𝒯0𝒦{\mathcal{T}}_{0}\cup{\mathcal{K}} is not a Ψ\Psi-local extension of 𝒯0{\mathcal{T}}_{0}. Then there exists a set GG of ground clauses (with additional constants) such that 𝒯0𝒦G{\mathcal{T}}_{0}\cup{\mathcal{K}}\cup G\models\perp but 𝒯0𝒦[Ψ𝒦(G)]G{\mathcal{T}}_{0}\cup{\mathcal{K}}[\Psi_{\cal K}(G)]\cup G has a weak partial model PP in which all terms in Ψ𝒦(G)\Psi_{\cal K}(G) are defined. We assume w.l.o.g. that G=G0G1G=G_{0}\cup G_{1}, where G0G_{0} contains no function symbols in Σ\Sigma and G1G_{1} consists of ground unit clauses of the form f(c1,,cn)cf(c_{1},\dots,c_{n})\approx c where ci,cc_{i},c are constants in Σ0Σc\Sigma_{0}\cup\Sigma_{c} and fΣf\in\Sigma.

We construct another structure, 𝒜\mathcal{A}, having the same support as PP, which inherits all relations in 𝖯𝗋𝖾𝖽{\sf Pred} and all maps in Σ0Σc\Sigma_{0}\cup\Sigma_{c} from PP, but on which the domains of definition of the Σ\Sigma-functions are restricted as follows: for every fΣf\in\Sigma, f𝒜(a1,,an)f_{\mathcal{A}}(a_{1},\dots,a_{n}) is defined if and only if there exist constants c1,,cnc^{1},\dots,c^{n} such that f(c1,,cn)f(c^{1},\dots,c^{n}) is in Ψ𝒦(G)\Psi_{\cal K}(G) and ai=cPia^{i}=c^{i}_{P} for all i{1,,n}i\in\{1,\dots,n\}. In this case we define f𝒜(a1,,an):=fP(cP1,,cPn)f_{\mathcal{A}}(a_{1},\dots,a_{n}):=f_{P}(c^{1}_{P},\dots,c^{n}_{P}). The reduct of 𝒜\mathcal{A} to (Σ0Σc,𝖯𝗋𝖾𝖽)(\Sigma_{0}\cup\Sigma_{c},{\sf Pred}) coincides with that of PP. Thus, 𝒜\mathcal{A} is a model of 𝒯0G0{\mathcal{T}}_{0}\cup G_{0}. By the way the operations in Σ\Sigma are defined in 𝒜\mathcal{A} it is clear that 𝒜\mathcal{A} satisfies G1G_{1}, so 𝒜\mathcal{A} satisfies GG.

We now show that 𝒜w𝒦\mathcal{A}\models_{w}{\mathcal{K}}. Let DD be a clause in 𝒦{\mathcal{K}}. If DD is ground then all its terms are defined, and all terms starting with an extension function are contained in Ψ𝒦(G)\Psi_{{\mathcal{K}}}(G), i.e. D𝒦[Ψ𝒦(G)]D\in{\mathcal{K}}[\Psi_{{\mathcal{K}}}(G)], so DD is true in PP, hence it is also true in 𝒜\mathcal{A}.

Now consider the case in which DD is not ground. Let β:X𝒜\beta:X\rightarrow\mathcal{A} be an arbitrary valuation. Again, if there is a term tt in DD such that β(t)\beta(t) is undefined, we immediately have that β\beta weakly satisfies DD. So let us suppose that for all terms tt occurring in DD, β(t)\beta(t) is defined. We associate with β\beta a substitution σ\sigma as follows: Let xx be a variable.We have the following possibilities:

Case 1: xx does not occur below any extension function. This case is unproblematic. We can define σ(x)\sigma(x) arbitrarily.

Case 2: xx occurs in a unique term t=f(xy)t=f(...x...y...) (which may occur more than once) and xx occurs only once in tt. From the fact that β(t)\beta(t) is defined, we know that there are ground terms which we will denote by tx,ty,t_{x},t_{y},\dots such that β(x)=(tx)P,β(y)=(ty)P,\beta(x)=(t_{x})_{P},\beta(y)=(t_{y})_{P},\dots. Since β(t)=fA((tx)P(ty)P)\beta(t)=f_{A}(...(t_{x})_{P}\dots(t_{y})_{P}\dots) is defined, f(,tx,,ty,)Ψ𝒦(G)f(\dots,t_{x},\dots,t_{y},\dots)\in\Psi_{\cal K}(G). We can define σ(x)=tx\sigma(x)=t_{x}.

Case 3: xx occurs in two or more terms of the form fk(x1k,,x,,xnkk)f_{k}(x^{k}_{1},\dots,x,\dots,x^{k}_{n_{k}}), 1kp1\leq k\leq p, p2p\geq 2, but occurs at most once in any term of CC, where f1,,fnf_{1},\dots,f_{n} are function symbols, not necessarily different (but in terms starting with the same function symbols xx occurs on different positions).

From the fact that β(fk(x1k,,x,,xnk))\beta(f_{k}(x^{k}_{1},\dots,x,\dots,x^{k}_{n})) is defined, we know that there are ground terms which we will denote by txk,txikt^{k}_{x},t_{x^{k}_{i}} such that for every kk with 1kp1\leq k\leq p:

  • β(x)=(txk)P,β(xik)=(txik)P\beta(x)=(t^{k}_{x})_{P},\beta(x^{k}_{i})=(t_{x^{k}_{i}})_{P} for 1kp1\leq k\leq p and 1ink1\leq i\leq n_{k}, and

  • β(fk(x1k,,x,,xnkk))=f𝒜((tx1k)P,,(txk)P,,(txnk)P)\beta(f_{k}(x^{k}_{1},\dots,x,\dots,x^{k}_{n_{k}}))=f_{\mathcal{A}}((t_{x^{k}_{1}})_{P},...,(t^{k}_{x})_{P},\dots,(t_{x^{k}_{n}})_{P}),
    i.e.  f(tx1k,,txk,,txnk)Ψ𝒦(G)f(t_{x^{k}_{1}},\dots,t^{k}_{x},\dots,t_{x^{k}_{n}})\in\Psi_{\cal K}(G).

We know that Ψ𝒦\Psi_{{\mathcal{K}}} has the property that for every clause C𝒦C\in{\mathcal{K}}, if CC contains terms fi(x1i,,x,,xnii)f_{i}(x^{i}_{1},\dots,x,\dots,x^{i}_{n_{i}}) and fk(x1k,,x,,xnkk)f_{k}(x^{k}_{1},\dots,x,\dots,x^{k}_{n_{k}}) and if

fi(tx1i,,txi,,txnii)Ψ𝒦(G)f_{i}(t_{x^{i}_{1}},\dots,t^{i}_{x},\dots,t_{x^{i}_{n_{i}}})\in\Psi_{\cal K}(G) and fk(tx1k,,txk,,txnkk)Ψ𝒦(G)f_{k}(t_{x^{k}_{1}},\dots,t^{k}_{x},\dots,t_{x^{k}_{n_{k}}})\in\Psi_{\cal K}(G)

then also fi(tx1ii,,txk,,sxnii)Ψ𝒦(G)f_{i}(t^{i}_{x^{i}_{1}},\dots,t^{k}_{x},\dots,s_{x^{i}_{n_{i}}})\in\Psi_{\cal K}(G) andfk(tx1kk,,txi,,sxnkk)Ψ𝒦(G)f_{k}(t^{k}_{x^{k}_{1}},\dots,t^{i}_{x},\dots,s_{x^{k}_{n_{k}}})\in\Psi_{\cal K}(G).

This means that we can define σ(y)=ty\sigma(y)=t_{y} for every linear variable; for every variable xx which occurs in different terms, let txt_{x} be one of the terms obtained as before (say tx=tx1t_{x}=t^{1}_{x}) and define σ(x)=tx\sigma(x)=t_{x}.

Thus, we can construct a substitution σ\sigma with σ(D)𝒦[G]\sigma(D)\in{\mathcal{K}}[G] and βσ=β\beta\circ\sigma=\beta. As (P,β)wσ(D)(P,\beta)\models_{w}\sigma(D) we can infer (𝒜,β)wD(\mathcal{A},\beta)\models_{w}D.

We now show that D(𝒜)={f(a1,,an)fA(a1,,an) defined}D(\mathcal{A})=\{f(a_{1},\dots,a_{n})\mid f_{A}(a_{1},\dots,a_{n})\text{ defined}\} is closed under Ψ𝒦\Psi_{\cal K}. By definition, f(a1,,an)D(𝒜)f(a_{1},\dots,a_{n})\in D(\mathcal{A}) iff there exist  constants c1,,cn\text{ constants }c_{1},\dots,c_{n} with ciA=ai{c_{i}}_{A}=a_{i} for all ii and f(c1,,cn)Ψ𝒦(G)f(c_{1},\dots,c_{n})\in\Psi_{\cal K}(G). Thus,

D(𝒜)={f(a1,,an)fA(a1,,an) defined}={f(c1𝒜,,cn𝒜)ci constants with f(c1,,cn)Ψ𝒦(G)}=h¯(Ψ𝒦(G)) where h(ci)=ai for all iΨ𝒦(D(𝒜))=Ψ𝒦(h¯(Ψ𝒦(G)))=h¯(Ψ𝒦(Ψ𝒦(G))) by property (iv) of Ψh¯(Ψ𝒦(G))=D(𝒜) by property (iii) of Ψ\begin{array}[]{rll}D(\mathcal{A})&=\{f(a_{1},\dots,a_{n})\mid f_{A}(a_{1},\dots,a_{n})\text{ defined}\}&\\ &=\{f({c_{1}}_{\mathcal{A}},\dots,{c_{n}}_{\mathcal{A}})\mid c_{i}\text{ constants with }f(c_{1},\dots,c_{n})\in\Psi_{\cal K}(G)\}&\\ &={\overline{h}}(\Psi_{\cal K}(G))&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\text{ where }h(c_{i})=a_{i}\text{ for all }i\\ \Psi_{\cal K}(D(\mathcal{A}))&=\Psi_{\cal K}({\overline{h}}(\Psi_{\cal K}(G)))={\overline{h}}(\Psi_{\cal K}(\Psi_{\cal K}(G)))&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\text{ by property (iv) of }\Psi\\ &\subseteq{\overline{h}}(\Psi_{\cal K}(G))=D(\mathcal{A})&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\text{ by property (iii) of }\Psi\\ \end{array}

As 𝒜w𝒦\mathcal{A}\models_{w}{\mathcal{K}}, 𝒜\mathcal{A} weakly embeds into a total algebra \mathcal{B} satisfying 𝒯0𝒦{\mathcal{T}}_{0}\cup{\mathcal{K}}. But then G\mathcal{B}\models G, so 𝒯0𝒦G\mathcal{B}\models{\mathcal{T}}_{0}\cup{\mathcal{K}}\cup G, which is a contradiction. \Box

Remark: A similar result can be proved also in the case in which some variables occur several times below a function symbol if Ψ𝒦\Psi_{{\mathcal{K}}} has the property that if f(x1,,x,,xxn)𝒦f(x_{1},\dots,x,\dots,x\dots x_{n})\in{\mathcal{K}} and f(t1,,s,,t,,tn)Ψ𝒦(T)f(t_{1},\dots,s,\dots,t,\dots,t_{n})\in\Psi_{{\mathcal{K}}}(T)
then f(t1,,t,,t,,tn)Ψ𝒦(T)f(t_{1},\dots,t,\dots,t,\dots,t_{n})\in\Psi_{{\mathcal{K}}}(T) and f(t1,,s,,s,,tn)Ψ𝒦(T)f(t_{1},\dots,s,\dots,s,\dots,t_{n})\in\Psi_{{\mathcal{K}}}(T).

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 Π\Pi of constrained Horn clauses are constructed as follows:

Π\displaystyle\Pi ::=𝖼𝗁𝖼Π\displaystyle::={\sf chc}\wedge\Pi\mid\top
𝖼𝗁𝖼\displaystyle{\sf chc} ::=var.𝖼𝗁𝖼𝖻𝗈𝖽𝗒𝗁𝖾𝖺𝖽\displaystyle::=\forall var.{\sf chc}\mid{\sf body}\rightarrow{\sf head}
𝗉𝗋𝖾𝖽\displaystyle{\sf pred} ::=𝗎𝗉𝗋𝖾𝖽ϕ\displaystyle::={\sf upred}\mid\phi
𝗁𝖾𝖺𝖽\displaystyle{\sf head} ::=𝗉𝗋𝖾𝖽\displaystyle::={\sf pred}
𝖻𝗈𝖽𝗒\displaystyle{\sf body} ::=𝗉𝗋𝖾𝖽𝖻𝗈𝖽𝗒𝖻𝗈𝖽𝗒var.𝖻𝗈𝖽𝗒\displaystyle::=\top\mid{\sf pred}\mid{\sf body}\wedge{\sf body}\mid\exists var.{\sf body}
𝗎𝗉𝗋𝖾𝖽\displaystyle{\sf upred} ::=an uninterpreted predicate applied to terms\displaystyle::=\text{an uninterpreted predicate applied to terms}
ϕ\displaystyle\phi ::=a formula whose terms and predicates are interpreted over 𝒜\displaystyle::=\text{a formula whose terms and predicates are interpreted over }\mathcal{A}
var\displaystyle var ::=a variable\displaystyle::=\text{a variable}

A clause where the head is a formula ϕ\phi 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 ϕ\phi.

It is easy to see that in Theorem 14, if we guarantee that the formulae ϕi\phi_{i} are formulae whose terms and predicates are interpreted over 𝒜\mathcal{A} then all clauses of the form

ϕi(x¯)μi(x¯)\phi_{i}({\overline{x}})\rightarrow\mu_{i}({\overline{x}})

are constrained Horn clauses, hence:

CHN={ϕi(x¯)μi(x¯)i{1,,n}}{(μi(x¯)μj(y¯))σμk(z¯)Ck(z¯) is obtained by a resolution  inference in P from Ci(x¯) and Cj(y¯) with m.g.u. σ}{μi(x¯)σμk(z¯)Ck(z¯) is obtained by a factorization inference  in P from Ci(x¯) with m.g.u. σ}\begin{array}[]{rl}CH_{N}=\{&\phi_{i}({\overline{x}})\rightarrow\mu_{i}({\overline{x}})\mid i\in\{1,\dots,n\}\}\\ \cup\{&(\mu_{i}({\overline{x}})\wedge\mu_{j}({\overline{y}}))\sigma\rightarrow\mu_{k}({\overline{z}})\mid C_{k}({\overline{z}})\text{ is obtained by a resolution }\\ &\hskip 42.67912pt\text{ inference in }{\cal I}_{P}\text{ from }C_{i}({\overline{x}})\text{ and }C_{j}({\overline{y}})\text{ with m.g.u.\ }\sigma\}\\ \cup\{&\mu_{i}({\overline{x}})\sigma\rightarrow\mu_{k}({\overline{z}})\mid C_{k}({\overline{z}})\text{ is obtained by a factorization inference }\\ &\hskip 42.67912pt\text{ in }{\cal I}_{P}\text{ from }C_{i}({\overline{x}})\text{ with m.g.u.\ }\sigma\}\end{array}

is a set of constrained Horn clauses.