On combinations of local theory extensions
aa r X i v : . [ c s . L O ] O c t On combinations of local theory extensions
Viorica Sofronie-Stokkermans
Max-Planck-Institut f¨ur Informatik, Stuhlsatzenhausweg 85, Saarbr¨ucken, Germanye-mail: [email protected]
Abstract.
In this paper we study possibilities of efficient reasoning incombinations of theories over possibly non-disjoint signatures. We firstpresent a class of theory extensions (called local extensions) in which hi-erarchical reasoning is possible, and give several examples from computerscience and mathematics in which such extensions occur in a natural way.We then identify situations in which combinations of local extensions ofa theory are again local extensions of that theory. We thus obtain crite-ria both for recognizing wider classes of local theory extensions, and formodular reasoning in combinations of theories over non-disjoint signa-tures.
Many problems in mathematics and computer science can be reduced to provingthe satisfiability of conjunctions of literals in a background theory (which can bethe extension of a base theory with additional functions – e.g., free, monotone, orrecursively defined – or a combination of theories). It is therefore very importantto identify situations where reasoning in complex theories can be done efficientlyand accurately. Efficiency can be achieved for instance by:(1) reducing the search space (preferably without loosing completeness);(2) modular reasoning, i.e., delegating some proof tasks which refer to a specifictheory to provers specialized in handling formulae of that theory.We are interested in identifying situations when both these goals can be achievedwithout loss of completeness.
Controlling the search space.
The quest for identifying theories where the searchspace can be controlled without loss of completeness led McAllester and Givanto define local theories , that is sets N of Horn clauses with the property that forany ground clause G , N | = G iff G can be proved already using those instances N [ G ] of N containing only ground terms occurring in G or in N . For localtheories, validity of ground Horn clauses can be checked in polynomial time. In[BG96,BG01], Ganzinger and Basin defined the more general notion of orderlocality and showed how to recognize (order-)local theories and how to use theseresults for automated complexity analysis.Similar ideas also occurred in algebra, where the main interest was to identifyclasses of algebras for which the uniform word problem is decidable in polynomial time. In [Bur95], Burris proved that if a quasi-variety axiomatized by a set K ofHorn clauses has the property that every finite partial algebra which is a partialmodel of the axioms in K can be extended to a total algebra model of K thenthe uniform word problem for K is decidable in polynomial time. In [Gan01],Ganzinger established a link between proof theoretic and semantic concepts forpolynomial time decidability of uniform word problems. He defined two notionsof locality for equational Horn theories, and established relationships betweenthese notions of locality and corresponding semantic conditions, referring toembeddability of partial algebras into total algebras. Modular reasoning.
When reasoning in extensions or combinations of theoriesit is very important to find ways of delegating some proof tasks which refer toa specific theory to provers specialized in handling formulae of that theory. Ofparticular interest are situations when reasoning can be done: – in a hierarchical way (that is, for reasoning in a theory extension a proverfor the base theory can be used as a black-box), or – in a modular way (that is, for reasoning in a combination of theories rea-soning in the component theories is “decoupled”, i.e., the information aboutthe component theories is never combined and only formulae in the jointsignature are exchanged between provers for the components).One of the first methods for modular reasoning in combinations of theories,due to Nelson and Oppen [NO79], can be applied for combining decision pro-cedures of stably infinite theories over disjoint signatures. There were severalattempts to extend the completeness results for modular inference systems forcombinations of theories over non-disjoint signatures. In [Ghi04] the compo-nent theories need to satisfy a model theoretical compatibility condition withrespect to the shared theory. In [Tin03], similar modularity results are achievedif the theories share all function symbols. Several modularity results using su-perposition were established for combinations of theories over disjoint signaturesin [ARR03,Hil04,ABRS05]. In [GSSW04,GSSW06] we analyzed possibilities ofmodular reasoning (using special superposition calculi) in combination of first-order theories involving both total and partial functions. The calculi are shownto be complete provided that functions that are not in the intersection of thecomponent signatures are declared as partial. Cases where the partial modelscan always be made total are identified: in such cases modular superpositionis also complete with respect to the standard (total function) semantics of thetheories. Inspired by the link between embeddability and locality established byGanzinger in [Gan01], such extensions were called local . Reasoning in local theory extensions and their combinations.
In [GSSW04],[GSSW06] and, later, in [SS05] we showed that for local theory extensions ef-ficient hierarchic reasoning is possible. For such extensions the two goals previ-ously mentioned can be addressed at the same time: the locality of an extensionallows to reduce the search space, but at the same time (as a by-product) it allows to perform an easy reduction to a proof task in the base theory (for this,a specialized prover can be used as a black box).Many theories important for computer science or mathematics are local ex-tensions of a base theory: theories of data structures, theories of monotone func-tions or of functions satisfying the Lipschitz conditions. However, often it isnecessary to consider complex extensions, with various types of functions (suchas, for instance, extensions of the theory of real numbers with free, monotoneand Lipschitz functions). It is important to have efficient methods for hierarchicand/or modular reasoning also for such combinations. Finding methods for rea-soning in combinations of extensions of a base theory is far from trivial: as theseare usually combinations of theories over non-disjoint signatures, classical com-bination results such as the Nelson-Oppen combination method [NO79] cannotbe applied; methods for reasoning in combinations of theories over non-disjointsignatures – as studied by Ghilardi et al. [Ghi04,BG07] – may also not always beapplicable (unless the base theory is universal and the extensions satisfy certainmodel-theoretic compatibility conditions required in [Ghi04,BG07]).In this paper we identify situations in which a combination of local extensionsof a base theory is guaranteed to be itself a local extension of the base theory.We thus obtain criteria for recognizing complex local theory extensions, and forefficient reasoning in such combinations of theories (over non-disjoint signatures)in a modular way.
Structure of the paper:
The paper is structured as follows: Section 2 containsgeneralities on partial algebras, weak validity and embeddability of partial al-gebras into total algebras. In Section 3 the notion of local theory extension isintroduced. In Section 4 links between embeddability and locality of an exten-sion are established. In Section 5, examples of local theory extensions are given.In the following two sections we identify situations under which a combination oflocal extensions of a base theory is guaranteed to be itself a local extension of thebase theory, under stronger (Section 6) or weaker (Section 7) embeddability con-ditions for the components. Some ideas on hierarchical and modular reasoningin such combinations are discussed in Section 8. Section 9 contains conclusionsand plans for future work.The results on combinations of local extensions of a base theory presentedin this paper generalize results on combinations of local theories obtained in[GSS01].
This section contains the main notions and definitions necessary in the paper.
Let Π = ( Σ, Pred ) be a signature where Σ is a set of function symbols and Pred a set of predicate symbols.
Definition 1 A partial Π -structure is a structure ( A, { f A } f ∈ Σ , { P A } P ∈ Pred ) ,where A is a non-empty set and for every f ∈ Σ with arity n , f A is a partialfunction from A n to A . The structure is a (total) structure if all functions f A are total. In what follows we usually denote both an algebra and its support with the samesymbol. Details on partial algebras can be found in [Bur86].The notion of evaluating a term t with respect to a variable assignment β : X → A for its variables in a partial algebra A is the same as for totalalgebras, except that this evaluation is undefined if t = f ( t , . . . , t n ) and eitherone of β ( t i ) is undefined, or else ( β ( t ) , . . . , β ( t n )) is not in the domain of f A . Definition 2
We define weak validity in structures ( A, { f A } f ∈ Σ , { P A } P ∈ Pred ) ,where Pred is a set of predicate symbols and ( A, { f A } f ∈ Σ ) is a partial Σ -algebra.Let β : X → A .(1) ( A, β ) | = w t ≈ s if and only if one of the conditions below is fulfilled:(a) β ( t ) and β ( s ) are both defined and equal; or(b) at least one of β ( s ) and β ( t ) is undefined.(2) ( A, β ) | = w t s if and only if one of the conditions below is fulfilled:(a) β ( t ) and β ( s ) are both defined and different; or(b) at least one of β ( s ) and β ( t ) is undefined.(3) ( A, β ) | = w P ( t , . . . , t n ) if and only if one of the conditions below is fulfilled:(a) β ( t ) , . . . , β ( t n ) are all defined and ( β ( t ) , . . . , β ( t n )) ∈ P A ; or(b) at least one of β ( t ) , . . . , β ( t n ) is undefined.(4) ( A, β ) | = w ¬ P ( t , . . . , t n ) if and only if one of the conditions below is fulfilled:(a) β ( t ) , . . . , β ( t n ) are all defined and ( β ( t ) , . . . , β ( t n )) P A ; or(b) at least one of β ( t ) , . . . , β ( t n ) is undefined. ( A, β ) weakly satisfies a clause C (notation: ( A, β ) | = w C ) if ( A, β ) | = w L for atleast one literal L in C . A weakly satisfies C (notation: A | = w C ) if ( A, β ) | = w C for all assignments β . A weakly satisfies a set of clauses K (notation: A | = w K )if A | = w C for all C ∈ K . Example 3
Let A be a partial Σ -algebra, where Σ = { car / , nil / } . Assumethat nil A is defined and car A ( nil A ) is not defined. Then A | = w car ( nil ) ≈ nil and A | = w car ( nil ) nil (because one term is not defined in A ). Definition 4 A weak Π -embedding between the partial structures ( A, { f A } f ∈ Σ , { P A } P ∈ Pred ) and ( B, { f B } f ∈ Σ , { P B } P ∈ Pred ) is a total map i : A → B such that – whenever f A ( a , . . . , a n ) is defined then f B ( i ( a ) , . . . , i ( a n )) is defined and i ( f A ( a , . . . , a n )) = f B ( i ( a ) , . . . , i ( a n )) ; – i is injective; – i is an embedding w.r.t. Pred , i.e. for every P ∈ Pred with arity n and every a , . . . , a n ∈ A , P A ( a , . . . , a n ) if and only if P B ( i ( a ) , . . . , i ( a n )) .In this case we say that A weakly embeds into B . Theories can be regarded as sets of formulae or as sets of models. Let T be a Π -theory and φ, ψ be Π -formulae. We say that T ∧ φ | = ψ (written also φ | = T ψ )is ψ is true in all models of T which satisfy φ .In what follows we consider extensions of theories, in which the signatureis extended by new function symbols (i.e. we assume that the set of predicatesymbols remains unchanged in the extension). If a theory is regarded as a set offormulae, then its extension with a set of formulae is set union. If T is regardedas a collection of models then its extension with a set K of formulae consistsof all structures (in the extended signature) which are models of K and whosereduct to the signature of T is in T . In this paper we regard theories as sets offormulae. All the results of this paper can easily be reformulated to a setting inwhich T is a collection of models.Let T be an arbitrary theory with signature Π = ( Σ , Pred ), where the setof function symbols is Σ . We consider extensions T of T with signature Π =( Σ, Pred ), where the set of function symbols is Σ = Σ ∪ Σ . We assume that T is obtained from T by adding a set K of (universally quantified) clauses. Definition 5 (Weak partial model)
A partial Π -algebra A is a weak partialmodel of T with totally defined Σ -function symbols if (i) A | Π is a model of T and (ii) A weakly satisfies all clauses in K . If the base theory T and its signature are clear from the context, we will referto weak partial models of T . We will use the following notation: – PMod w ( Σ , T ) is the class of all weak partial models of T in which the Σ -functions are partial and all the other function symbols are total; – PMod fw ( Σ , T ) is the class of all finite weak partial models of T in whichthe Σ -functions are partial and all the other function symbols are total; – PMod fdw ( Σ , T ) is the class of all weak partial models of T in which the Σ -functions are partial and their definition domain is a finite set, and allthe other function symbols are total; – Mod ( T ) denotes the class of all models of T in which all functions in Σ ∪ Σ are totally defined. For theory extensions T ⊆ T = T ∪ K , where K is a set of clauses, we considerthe following condition:( Emb w ) Every A ∈ PMod w ( Σ , T ) weakly embeds into a total model of T .We also define a stronger notion of embeddability, which we call completability :( Comp w ) Every A ∈ PMod w ( Σ , T ) weakly embeds into a total model B of T such that A | Π and B | Π are isomorphic.Weaker conditions, which only refer to embeddability of finite partial models, willbe denoted by ( Emb fw ), resp. ( Comp fw ). Conditions which refer to embeddabilityof partial models in PMod fdw ( Σ , T ) will be denoted by ( Emb fdw ), resp. (
Comp fdw ). The notion of local theory was introduced by Givan and McAllester [GM92,McA93].
Definition 6 (Local theory)
A local theory is a set of Horn clauses K suchthat, for any ground Horn clause C , K | = C only if already K [ C ] | = C (where K [ C ] is the set of instances of K in which all terms are subterms of ground termsin either K or C ). The notion of locality in equational theories was studied by Ganzinger [Gan01],who also related it to a semantical property, namely embeddability of partialalgebras into total algebras. In [GSSW04,GSSW06,SS05] the notion of localityfor Horn clauses is extended to the notion of local extension of a base theory.Let K be a set of clauses in the signature Π = ( Σ ∪ Σ , Pred ). In what follows,when we refer to sets G of ground clauses we assume that they are in the signature Π c = ( Σ ∪ Σ c , Pred ), where Σ c is a set of new constants. If Ψ is a set of ground Σ ∪ Σ ∪ Σ c -terms, we denote by K Ψ the set of all instances of K in which allterms starting with a Σ -function symbol are ground terms in the set Ψ . If G isa set of ground clauses and Ψ = st ( K , G ) is the set of ground subterms occurringin either K or G then we write K [ G ] := K Ψ .We will focus on the following type of locality of a theory extension T ⊆ T ,where T = T ∪ K with K a set of (universally quantified) clauses:( Loc ) For every set G of ground clauses T ∪ G | = ⊥ iff T ∪ K [ G ] ∪ G hasno weak partial model in which all terms in st ( K , G ) are defined.A weaker notion ( Loc f ) can be defined if we require that the respective conditionshold only for finite sets G of ground clauses. An intermediate notion of locality( Loc fd ) can be defined if we require that the respective conditions hold only forsets G of ground clauses containing only a finite set of terms starting with afunction symbol in Σ . Definition 7 (Local theory extension)
An extension T ⊆ T is local if itsatisfies condition ( Loc f ) . A local theory [Gan01] is a local extension of the empty theory.
There is a strong link between locality of a theory extension and embeddabilityof partial models into total ones. Links between locality of a theory and embed-dability were established by Ganzinger in [Gan01]. We show that similar resultscan be obtained also for local theory extensions .In what follows we say that a non-ground clause is Σ - flat if function symbols(including constants) do not occur as arguments of function symbols in Σ . A Σ -flat non-ground clause is called Σ - linear if whenever a variable occurs intwo terms in the clause which start with function symbols in Σ , the two termsare identical, and if no term which starts with a function in Σ contains twooccurrences of the same variable. We first show that for sets of Σ -flat clauses locality implies embeddability. Thisgeneralizes results presented in the case of local theories in [Gan01]. Theorem 8
Assume that K is a family of Σ -flat clauses in the signature Π .(1) If the extension T ⊆ T := T ∪ K satisfies ( Loc ) then it satisfies ( Emb w ) .(2) If the extension T ⊆ T := T ∪ K satisfies ( Loc f ) then it satisfies ( Emb fw ) .(3) If the extension T ⊆ T := T ∪ K satisfies ( Loc fd ) then it satisfies ( Emb fdw ) .(4) If T is compact and the extension T ⊆ T satisfies ( Loc f ) , then T ⊆ T satisfies ( Emb w ) .Proof : We prove (4) and show how the proof can be changed to provide proofs for(1), (2) and (3). Let A be a partial Π -algebra with totally defined Σ -functions,which is a model of T and weakly satisfies K . Let ∆ ( A ) = { f ( a , . . . a n ) ≈ a | if f A ( a , . . . , a n ) is defined and equal to a }∪{ f ( a , . . . a n ) a | if f A ( a , . . . , a n ) is defined and not equal to a }∪{ P ( a , . . . , a n ) | P ∈ Pred and ( a , . . . , a n ) ∈ P A }∪{¬ P ( a , . . . , a n ) | P ∈ Pred and ( a , . . . , a n ) P A } ∪ ^ a = a ′ ,a,a ′ ∈ A a a ′ We prove that T ∪K∪ ∆ ( A ) is consistent, where the elements of A are regarded asnew constants. Assume T ∪K∪ ∆ ( A ) | = ⊥ . By compactness of T , T ∪K∪ Γ | = ⊥ ,for some finite subset Γ of ∆ ( A ). We know that A is a model of T . Every termstarting with a function symbol in Σ contained in the clauses in K [ Γ ] is eithera ground (subterm of a) term occurring in Γ (and, hence, a constant a ∈ A , ora term f ( a , . . . , a n ), where f A ( a , . . . , a n ) is defined), or is a ground subterm in K , i.e. a constant, and hence, again defined in A . Therefore, all terms occurringin the clauses in K [ Γ ] are defined in A , so A satisfies all these clauses, i.e. A isa model of T ∪ K [ Γ ]. Since ∆ ( A ) is obviously true in A and Γ ⊆ ∆ ( A ), A is apartial model of T ∪ K [ Γ ] ∪ Γ , in which all ground terms occurring in K or Γ are defined. This contradicts the fact that T is a local extension of T . Hence,the assumption that T ∪ K ∪ ∆ ( A ) | = ⊥ was false, so T ∪ K ∪ ∆ ( A ) has a model A ′ in which, therefore, A weakly embeds.(1) If ( Loc ) holds then we can choose Γ = ∆ ( A ). (2) If A is finite we can choose Γ = ∆ ( A ), so the compactness of T is not needed. (3) If all functions in Σ havea finite domain of definition in A , then ∆ ( A ) contains only finitely many termsstarting with a Σ -function. Therefore also in this case we can choose Γ = ∆ ( A ). ✷ Conversely, embeddability implies locality. The following results appear in [SS05]and [SSI07]. This result allows to give several examples of local theory extensions.
Theorem 9 ([SS05,SSI07])
Let K be a set of Σ -flat and Σ -linear clauses.(1) If the extension T ⊆ T satisfies ( Emb w ) then it satisfies ( Loc ) .(2) Assume that T is a locally finite universal theory, and that K contains onlyfinitely many ground subterms. If the extension T ⊆ T satisfies ( Emb fw ) ,then T ⊆ T satisfies ( Loc f ) .(3) T ⊆ T satisfies ( Emb fdw ) . Then T ⊆ T satisfies ( Loc fd ) . We present several examples of theory extensions for which embedding con-ditions among those mentioned above hold and are thus local. For details cf.[SS05,SS06a,SSI07].
Extensions with free functions.
Any extension T ∪ Free ( Σ ) of a theory T with a set Σ of free function symbols satisfies condition ( Comp w ). Extensions with selector functions.
Let T be a theory with signature Π =( Σ , Pred ), let c ∈ Σ with arity n , and let Σ = { s , . . . , s n } consist of n unary function symbols. Let T = T ∪ Sel c (a theory with signature Π =( Σ ∪ Σ , Pred )) be the extension of T with the set Sel c of clauses below.Assume that T satisfies the (universally quantified) formula Inj c (i.e. c isinjective in T ) then the extension T ⊆ T satisfies condition ( Comp w ) [SS05]. ( Sel c ) s ( c ( x , . . . , x n )) ≈ x · · · s n ( c ( x , . . . , x n )) ≈ x n x ≈ c ( x , . . . , x n ) → c ( s ( x ) , . . . , s n ( x )) ≈ x ( Inj c ) c ( x , . . . , x n ) ≈ c ( y , . . . , y n ) → ( n ^ i =1 x i ≈ y i ) Extensions with functions satisfying general monotonicity conditions.
In [SS05] and [SSI07] we analyzed extensions with monotonicity conditionsfor an n -ary function f w.r.t. a subset I ⊆ { , . . . , n } of its arguments:( Mon If ) ^ i ∈ I x i ≤ i y i ∧ ^ i I x i = y i → f ( x , .., x n ) ≤ f ( y , .., y n ) . Here,
Mon ∅ f is equivalent to the congruence axiom for f . If I = { , . . . , n } we speak of monotonicity in all arguments; we denote Mon { ,...,n } f by Mon f . Monotonicity in some arguments and antitonicity in other arguments is mod-eled by considering functions f : Q i ∈ I P σ i i × Q j I P j → P with σ i ∈ {− , + } ,where P + i = P i and P − i = P ∂i , the order dual of the poset P i . The corre-sponding axioms are denoted by Mon σf , where for i ∈ I , σ ( i ) = σ i ∈ {− , + } ,and for i I , σ ( i ) = 0. The following hold [SS05,SSI07]:1. Let T be a class of (many-sorted) bounded semilattice-ordered Σ -structures. Let Σ be disjoint from Σ and T = T ∪{ Mon σ ( f ) | f ∈ Σ } .Then the extension T ⊆ T satisfies ( Comp fdw ), hence is local.2. Any extension of the theory of posets with functions in a set Σ satisfying { Mon σf | f ∈ Σ } satisfies condition ( Emb w ) , hence is local.This provides us with a large number of concrete examples. For instancethe extensions with functions satisfying monotonicity axioms Mon σf of thefollowing (possibly many-sorted) classes of algebras are local: – any class of algebras with a bounded (semi)lattice reduct, a boundeddistributive lattice reduct, or a Boolean algebra reduct (( Comp fdw ) holds); – any extension of a class of algebras with a semilattice reduct, a (dis-tributive) lattice reduct, or a Boolean algebra reduct, with monotonefunctions into an infinite numeric domain (( Comp fdw ) holds); – T , the class of totally-ordered sets; DO , the theory of dense totally-ordered sets (( Comp fdw ) holds); – the class P of partially-ordered sets (( Emb w ) holds).Similarly, it can be proved that any extension of the theory of reals (integers)with functions satisfying M on σf into a fixed infinite numerical domain is local(condition ( Comp fdw ) holds).
Boundedness conditions.
Any extension of a theory for which ≤ is reflexivewith functions satisfying ( Mon σf ) and boundedness ( Bound tf ) conditions islocal [SS06a,SSI07].( Bound tf ) ∀ x , . . . , x n ( f ( x , . . . , x n ) ≤ t ( x , . . . , x n ))where t ( x , . . . , x n ) is a term in the base signature Π with variables among x , . . . , x n (such that in any model the associated function has the samemonotonicity as f ).Similar results can be given for guarded monotonicity conditions with mutu-ally disjoint guards [SS06a]. Extensions with Lipschitz functions.
The extension R ⊆ R ∪ ( L λ f ) of R witha unary function which is λ -Lipschitz in a point x (for λ >
0) satisfiescondition (
Comp w ).( L λf ) ∀ x | f ( x ) − f ( x ) | ≤ λ · | x − x | The results described before can easily be extended to a many-sorted framework.Therefore various additional examples of (many-sorted) theory extensions relatedto data structures can be given cf. e.g. [SS06b]. Comp w ) In this and the following sections we study the locality of combinations of localtheory extensions. In the light of the results in Section 4 we concentrate onstudying which embeddability properties are preserved under combinations oftheories. For the sake of simplicity, in what follows we consider only conditions(
Emb w ) and ( Comp w ). Analogous results can be given for conditions ( Emb fw ),( Comp fw ), resp. ( Emb fdw ), (
Comp fdw ) and combinations thereof.We start with a simple case of combinations of local extensions of a base the-ory: we consider the situation when both components satisfy the embeddabilitycondition (
Comp w ). We first analyze the simple case of combinations of localextensions of a base theory T by means of sets of mutually disjoint functionsymbols. Then some results on combining extensions with non-disjoint sets offunction symbols are discussed. Theorem 10
Let T be a first-order theory with signature Π = ( Σ , Pred ) and T = T ∪ K and T = T ∪ K two extensions of T with signatures Π = ( Σ ∪ Σ , Pred ) and Π = ( Σ ∪ Σ , Pred ) , respectively. Assume that both extensions T ⊆ T and T ⊆ T satisfy condition ( Comp w ) , and that Σ ∩ Σ = ∅ . Then theextension T ⊆ T = T ∪ K ∪ K satisfies condition ( Comp w ) . If, additionally,in K i all terms starting with a function symbol in Σ i are flat and linear, for i = 1 , , then the extension is local.Proof : Let P ∈ PMod w ( Σ ∪ Σ , T ). Then P | Π ∈ PMod w ( Σ , T ), hence P | Π weakly embeds into a total model B of T , such that P | Π and B | Π are isomor-phic. Let i : P | Π → B | Π be the isomorphism between these two Π -structures.We use the isomorphism i to transfer also the Σ -structure from P to B . Thatis, for every f ∈ Σ with arity n , and every b , . . . , b n ∈ B , we define: f B ( b , . . . , b n ) = i ( f P ( i − ( b ) , . . . , i − ( b n ))) if f P ( i − ( b ) , . . . , i − ( b n ))is defined in P undefined otherwiseWith these definitions of Σ -functions, B | Π ∈ PMod w ( Σ , T ). Therefore, B | Π weakly embeds into a total model C of T , such that B | Π and C | Π are isomor-phic. Let j : B | Π → C | Π be the isomorphism between these two structures. Weuse this isomorphism to transfer, as explained above, the (total) Σ -structurefrom B to C . The algebra A obtained this way from C is a total model of T , and j ◦ i : P | Π → A | Π is an isomorphism. Thus, the extension T ⊆ T = T ∪K ∪K satisfies condition ( Comp w ). The last claim is an immediate consequence of The-orem 9. ✷ Example 11
The following combinations of theories (seen as extensions ofa first-order theory T ) satisfy condition ( Comp w ) (or in case (4) condition( Comp fdw )): (1) T ∪ Free ( Σ ) and T ∪ Sel c if T is a theory and c ∈ Σ is injective in T .(2) R ∪ Free ( Σ ) and R ∪ Lip λc ( f ), where f Σ .(3) R ∪ Lip λ c ( f ) and R ∪ Lip λ c ( g ), where f = g .(4) T ∪ Free ( Σ ) and T ∪ Mon σf , where f Σ has arity n , σ : { , . . . , n } →{− , , } , if T is, e.g., a theory of algebras with a bounded semilatticereduct.A more general result holds, which allows to prove locality also for extensionswhich share non-base function symbols. Theorem 12
Let T be an arbitrary first-order theory, and T = T ∪ K and T = T ∪ K two extensions of T with functions in Σ and Σ respectively,which satisfy condition ( Comp w ) . Assume that there exists a set K of clausesin signature Σ ∪ Σ , where Σ = Σ ∩ Σ ⊂ Σ i , i = 1 , , such that everymodel of T ∪ K i is a model of T ∪ K for i = 1 , . Then the extension T ∪ K ⊆ ( T ∪K ) ∪K ∪K again satisfies condition ( Comp w ) and hence is a local extension.Proof : Note that if T ⊆ T ∪ K i satisfies condition ( Comp w ) then the extension T ∪ K ⊆ ( T ∪ K ) ∪ K i also satisfies condition ( Comp w ). The conclusion nowfollows from Theorem 10, taking into account the fact that the signatures ( Σ \ Σ )and ( Σ \ Σ ) are disjoint. ✷ Example 13
The following theory extensions satisfy condition (
Comp w ):(1) T ∪ Free ( Σ ) ⊆ ( T ∪ Free ( Σ ∪ Σ )) ∪ ( T ∪ Free ( Σ ) ∪ Sel c ), provided that T is a theory containing an injective function c .(2) R ∪ Free ( f ) ⊆ ( R ∪ Mon f ∪ Mon g ) ∪ ( R ∪ Free ( f ) ∪ Lip λc ( h )), where f, g, h aredifferent function symbols.(3) R ∪ Lip λ c ( f ) ⊆ ( R ∪ Lip λ c ( f ) ∪ Mon ( g )) ∪ ( R ∪ Lip λ c ( f ) ∪ Free ( h )), where f, g, h are different function symbols and λ ≤ λ . Proof : Immediate consequences of Theorem 12. (1) is obvious; for (2) note thatevery model of R ∪ Mon f ∪ Mon g is a model of R ∪ Free ( f ); for (3) note that, as λ ≤ λ , every model of R ∪ Lip λ c ( f ) ∪ Mon ( g ) is a model of R ∪ Lip λ c ( f ). ✷ The result above can be extended to the more general situation in which one ofthe extensions, say T ⊆ T = T ∪ K , satisfies condition ( Emb w ) and the otherextension T ⊆ T = T ∪ K satisfies condition ( Comp w ), or if both extensionssatisfy condition ( Emb w ). The natural analogon of the proof of Theorem 10 wouldbe the following: Start with a partial model P of T ∪ K ∪ K ; extend it, usingproperty ( Emb w ), to a total model A of T . The technical problem which occurswhen we now try to use the embedding property for T is that we need to besure that A remains also a partial model of T , with the operations inheritedfrom P . Unfortunately this may not always be the case, as shown below. Example 14
Let Π = ( { f } , Pred ) and let T be a Π -theory. Let T = T ∪ K ,and T = T ∪ K be two theories over extensions of Π with function symbols in Σ , Σ . Assume that Σ = { g } , Σ ∩ Σ = ∅ , and K = { x = f ( x ) → g ( y ) = y } ( f and g are unary function symbols).Let P = ( { a, b } , f P , g P , { σ P } σ ∈ Σ ) be a partial algebra, where f P is total with f P ( a ) = b and f P ( b ) = a ; g P ( a ) = b and g P ( b ) is undefined. P weakly satisfies K because the premise of the clause in K is always false in P . Assume that P weakly embeds into a total model A of T via a Π -embedding h : P ֒ → A , andthat A contains an element c
6∈ { h ( a ) , h ( b ) } , such that f A ( c ) = c . A “inherits”the Σ -operation g from P via h , in the sense that we can define g A ( h ( a )) := h ( g P ( a )) = h ( b ) and assume that g A is undefined in rest. However, with the Σ -operation defined this way A does not weakly satisfy K . Let β : X → A with β ( x ) = c and β ( y ) = h ( a ). ( A, β ) does not weakly satisfy the clause in K ,since: β ( f ( x )) = f A ( β ( x )) = f A ( c ) = c, whereas β ( g ( y )) = g A ( β ( y )) = g A ( h ( a )) = h ( g P ( a )) = h ( b ) = h ( a ) = β ( y ) . This happens because the variable x in the clause in K does not occur belowany function symbol in Σ .In what follows we identify conditions which ensure that an extension A of apartial algebra P which weakly satisfies K remains a partial model of K withthe Σ -operations inherited from P , Let T be a theory with signature Π = ( Σ , Pred ) , and let T ⊆T := T ∪ K be a theory extension by means of a set K of Σ -flat clauses over thesignature Π = ( Σ ∪ Σ, Pred ) . Assume that for each clause C of K all variablesin C occur below some Σ -function symbol.Let P ∈ PMod w ( Σ, T ) , A ∈ Mod ( T ) , and h : P ֒ → A be a Π -embedding.Then a partial Σ -structure can be defined on A such that A weakly satisfies K ,and h is a weak Π -embedding.Proof : For every a , . . . , a n ∈ A and every f ∈ Σ define f A ( a , . . . , a n ) := a if ∃ p , . . . , p n ∈ P such that all a i = h ( p i ) ,f P ( p , . . . , p n ) is defined in P, and a = h ( f P ( p , . . . , p n ))undefined otherwise.As h is injective, f A is well-defined. By hypothesis, h is a Π -embedding. Withthe definition of operations in Σ given above, h is also a weak Σ -homomorphism.Let p , . . . , p n ∈ P and f ∈ Σ be such that f P ( p , . . . , p n ) is defined. Then, by thedefinition of f A , f A ( h ( p ) , . . . , h ( p n )) is defined and equal to h ( f P ( p , . . . , p n )). We now prove that with the operations defined as shown before A weaklysatisfies K . Let C ∈ K and let β : X → A be an assignment of elements in A to the variables in C . Assume that for every term t occurring in C , β ( t ) isdefined in A (otherwise, due to the definition of weak satisfiability, ( A, β ) | = w C trivially). In order to show that ( A, β ) | = w C , we construct an assignment α ofelements in P to the variables in C , and use the fact that ( P, α ) | = w C .Let t = f ( t , . . . , t k ) be an arbitrary term occurring in C , with f ∈ Σ . As β ( t )is defined, f A ( β ( t ) , . . . , β ( t k )) is defined in A , hence there exist p , . . . , p k ∈ P such that h ( p i ) = β ( t i ), f P ( p , . . . , p k ) is defined, and f A ( β ( t ) , . . . , β ( t k )) = h ( f P ( p , . . . , p n )). As all clauses in K are Σ -flat, all terms t i are variables. Inthis way we can associate with every variable x occurring as argument in a term f ( t , . . . , t n ) of C with f ∈ Σ an element p x ∈ P such that h ( p x ) = β ( x ). Assumethat for some such (variable) subterm x , two elements of P , say p x and q x , canbe associated in this way. Then h ( p x ) = β ( x ) = h ( q x ), and the injectivity of h guarantees that p x = q x . This shows that an assignment α : X → P can bedefined, such that for all variables in C occurring below a function symbol in Σ (hence for all variables in C ) α ( x ) := p x . It is easy to see that for every term t occurring in C , h ( α ( t )) = β ( t ). As ( P, α ) | = C and h is a weak Π -embedding itfollows that ( A, β ) | = C . ✷ The result above will be applied in Theorems 17 and 19 in the following form:
Corollary 16
Let T be a first-order theory with signature Π = ( Σ , Pred ) . Let Σ , Σ be two disjoint sets of function symbols, and let Π i = ( Σ ∪ Σ i , Pred ) , i = 1 , , and Π = ( Σ ∪ Σ ∪ Σ , Pred ) . Let K be a set of Σ -flat clauses over Π . Assume that for each clause C of K all variables in C occur below somefunction symbol in Σ .Let P be a partial Π -structure such that P | Π is a total model of T , and P weakly satisfies K . Let A be a total Π -structure, and let h : P ֒ → A be aweak Π -embedding. Then a partial Σ -structure can be defined on A such that A weakly satisfies K , and h is a weak Π -embedding. Comp w ) We now analyze the case of combinations of theories in which one componentsatisfies condition (
Comp w ) and the other component satisfies condition ( Emb w ). Theorem 17
Let T be a first-order theory with signature Π = ( Σ , Pred ) ,and let T = T ∪ K and T = T ∪ K be two extensions of T with signatures Π = ( Σ ∪ Σ , Pred ) and Π = ( Σ ∪ Σ , Pred ) , respectively. Assume that:(1) T ⊆ T satisfies condition ( Comp w ) ,(2) T ⊆ T satisfies condition ( Emb w ) ,(3) K is a set of Σ -flat clauses in which all variables occur below a Σ -function.Then the extension T ⊆ T ∪ K ∪ K satisfies ( Emb w ) . If, additionally, in K i all terms starting with a function symbol in Σ i are flat and linear, for i = 1 , ,then the extension is local. Proof : Let P ∈ PMod w ( Σ ∪ Σ , T ∪ K ∪ K ). Then P | Π ∈ PMod w ( Σ , T ),hence P | Π weakly embeds into a total model B of T . By (3), in K all variablesoccur below some function symbol in Σ , and all clauses in K are Σ -flat. Then,by Lemma 15, we can transform B into a weak partial model B ′ of T (with the Σ -structure inherited from B and the Σ -structure inherited from P ). But then B ′ weakly embeds into a total model C of T such that B ′| Π and C | Π are Π -isomorphic. We can use this isomorphism to transfer the (total) Σ -structurefrom B to C . This way, we obtain a total model A of T ∪ K ∪ K in which P weakly embeds. The last claim is an immediate consequence of Theorem 9. ✷ Example 18
The following theory extensions satisfy (
Emb w ), hence are local:(1) E q ⊆ Free ( Σ ) ∪ L , where E q is the pure theory of equality, without functionsymbols, and L the theory of lattices.(2) T ⊆ ( T ∪ Free ( Σ )) ∪ ( T ∪ Mon ( Σ )), where Σ ∩ Σ = ∅ , and T is, e.g.the theory of posets.An analogon of Theorem 12 holds also in this case. Emb w ) We identify conditions under which embeddability conditions for the componenttheories imply embeddability conditions for the theory combination.
Theorem 19
Let T be an arbitrary theory in signature Π = ( Σ , Pred ) . Let K and K be two sets of clauses over signatures Π i = ( Σ ∪ Σ i , Pred ) , where Σ and Σ are disjoint. We make the following assumptions:(A1) The class of models of T is closed under direct limits of diagrams inwhich all maps are embeddings (or, equivalently, T is a ∀∃ theory).(A2) K i is Σ i -flat and Σ i -linear for i = 1 , , and T ⊆ T ∪ K i , i = 1 , are both local extensions of T .(A3) For all clauses in K and K , every variable occurs below some ex-tension function.Then T ∪ K ∪ K is a local extension of T .Proof : The proof uses the semantical characterization of locality in Theorems 8and 9. Assumption (A2) guarantees that the extensions T ⊆ T ∪ K i , i = 1 , Emb w ). We showthat T ⊆ T ∪ K ∪ K satisfies condition ( Emb w ), hence, by Theorem 9, is local.Let Π = ( Σ ∪ Σ ∪ Σ , Pred ) and let P be a partial Π -algebra which weaklysatisfies K ∪ K and whose Π -reduct is a total model of T . By the locality ofthe extension T ⊆ T ∪ K , there exists a total Π -model of T ∪ K , which wedenote P , and a weak embedding π : P ֒ → P . By Lemma 15 and Corollary 16,a partial Σ -structure can be defined on P such that P weakly satisfies K and π is a weak Π -embedding. Thus, P becomes a partial Π -algebra which weakly satisfies K , and isa total Π -model of T . By the locality of the extension T ⊆ T ∪ K , thereexists a total Π -model of T ∪ K , which we denote P , and a weak embedding π : P ֒ → P . Again, a partial Σ -structure can be defined on P such that P weakly satisfies K and π is a weak Π -embedding.By iterating this process we obtain a sequence of partial Π -structures P i , P i , i ≥
1, all of whose reducts to Π are total models of T , which weakly satisfy K ∪ K , and have the property that, for every i ≥ P i is a total Σ -algebra, P i is a total Σ -algebra, and there are weak Π -embeddings π i : P i → P i and π i : P i → P i +11 . P π @@@@@@@ P π @@@@@@@ P π " " DDDDDDDD . . .P π ? ? (cid:127)(cid:127)(cid:127)(cid:127)(cid:127)(cid:127)(cid:127)(cid:127) P π > > ~~~~~~~ P π > > ~~~~~~~ P . . . If P il precedes P jk in the chain above (where k, l ∈ { , } and i, j ≥ g kjli : P il → P jk be the composition of the corresponding weak embeddings from P il to P jk . Being a composition of weak embeddings, g kjli is itself a weak embedding.Let P ` ( ` i ≥ ( P i ` P i )) be the disjoint union of all partial Π -structures con-structed this way. In this disjoint union we identify all elements that are imagesof the same element in some P ik . This is, we define an equivalence relation ≡ onthis disjoint union by x ≡ y if x ∈ P il , y ∈ P jk and either (i) P il precedes P jk inthe chain above and g kjli ( x ) = y , or (ii) P jk precedes P il in the chain above and g likj ( y ) = x . As for every l ∈ { , } , i ≥ g lili is the identity map, if x ≡ y for x, y ∈ P il then x = y . It is easy to see that ≡ is an equivalence relation.Let A := P ` ( ` i ≥ ( P i ` P i )) / ≡ . We show that total functions in Σ ∪ Σ ∪ Σ and predicates in Pred can be defined on A such that the expansion A of A obtained this way is a (total) model of T ∪ K ∪ K , and that the map g : P → A defined by g ( p ) = [ p ] (the equivalence class of p in A ) is a weak Π -embedding.A Π -structure on A can be defined as follows: Interpretation of signature Π . We first define the Σ -functions. Let f ∈ Σ with arity n , and let [ a ] , . . . , [ a n ] ∈ A . Then, for every 1 ≤ j ≤ n , there exist i j ≥ a j ∈ P i j ` P i j . Let m = max { i j | ≤ j ≤ n } . Let b , . . . , b n be the images of a , . . . , a n in P m +11 . By the definition of ≡ , [ b j ] = [ a j ] for every1 ≤ j ≤ n . P m +11 is a total Σ -algebra, so b = f P m +11 ( b , . . . , b n ) exists in P m +11 .The fact that the definition does not depend on the representatives follows fromthe fact that all embeddings in the diagram are Σ -homomorphisms.The predicates in Pred are defined in a similar way. The fact that the definitionsdo not depend on the choice of representatives in the equivalence classes followsfrom the fact that all the maps in the diagram are Π -embeddings. Interpretation of the signature Σ ∪ Σ . We define the Σ -functions (the Σ -functions can be defined similarly). Let f ∈ Σ with arity n , and let [ a ] , . . . , [ a n ] ∈ A . Then, for every 1 ≤ j ≤ n , there exist i j ≥ a j ∈ P i j ` P i j .Let m = max { i j | ≤ j ≤ n } . Let b , . . . , b n be the images of a , . . . , a n in P m +11 . By the definition of ≡ , [ b j ] = [ a j ] for every 1 ≤ j ≤ n . P m +11 is a total Σ -algebra, so b = f P m +11 ( b , . . . , b n ) exists in P m +11 . The equivalence class of b does not depend on the choice of representatives of the equivalence classes[ a ] , . . . , [ a n ]. Indeed, assume that c , . . . , c n are images of a , . . . , a n in P k +11 ,with e.g. k ≥ m . By the definition of g ,k +11 ,m +1 : P m +11 → P k +11 , c j = g ,k +11 ,m +1 ( b j ). As f P m +11 ( b , . . . , b n ) is defined in P m +11 , we know that g ,k +11 ,m +1 ( f P m +11 ( b , . . . , b n )) = f P k +11 ( g ,k +11 ,m +1 ( b ) , . . . , g ,k +11 ,m +1 ( b n )) = f P k +11 ( c , . . . , c n ). It follows therefore that b ≡ f P k +11 ( c , . . . , c n ), so the equivalence class of b does not depend on the choiceof the representatives of [ a ] , . . . , [ a n ]. We can define f A ([ a ] , . . . , [ a n ]) := [ b ]. f A is well-defined for every f ∈ Σ .We now prove that for every k, i , the map g ik : P ik → A defined by g ( x ) := [ x ] isa weak Π -embedding. The fact that g ik is a Σ -homomorphism is obvious. We show that g ik is a weak Σ -homomorphism. Let f ∈ Σ of arity n and x , . . . , x n ∈ P ik be such that f P ik ( x , . . . , x n ) is defined. Then, by the definitionof f A , f A ([ x ] , . . . , [ x n ]) = [ f P ik ( x , . . . , x n )] = g ik ( f P ik ( x , . . . , x n )). The fact that g ik is a Σ -homomorphism can be proved analogously. We prove that g ik is injective. Assume that g ik ( x ) = g ik ( y ) for x, y ∈ P ik . Then x ≡ y , hence g kiki ( x ) = y , i.e. x = y (since g kiki is the identity map). This alsoshows that g : P → A , g ( p ) = [ p ] is an injective weak homomorphism. We prove that g ik is an embedding w.r.t. Pred . Let Q ∈ Pred be an n -arypredicate symbol, and let x , . . . , x n ∈ P ik . We show that Q P ik ( x , . . . , x n ) ifand only if Q A ( g ik ( x ) , . . . , g ik ( x n )). By the way Q A is constructed it is ob-vious that if Q P ik ( x , . . . , x n ) then Q A ([ x ] , . . . , [ x n ]). Conversely, assume that Q A ([ x ] , . . . , [ x n ]). By definition, there exists m and b , . . . , b n ∈ P m +11 such that[ x ] = [ b ] , . . . , [ x n ] = [ b n ] and Q P m +11 ( b , . . . , b n ). The conclusion now followsfrom the fact that the composition of all maps in the diagram leading from P ik to P m +11 (or viceversa) is a weak Π -embedding, and hence also Q P ik ( x , . . . , x n ).The reduct to Π of A is the direct limit of a diagram of models of T , in whichall maps are embeddings. Therefore, if T is closed under such direct limits (i.e.it is a ∀∃ theory) then A is a model of T .Finally, we show that A satisfies all clauses in K ∪K . Let C ∈ K (the case C ∈K is similar). Let β : X → A . We know that every variable of C occurs below afunction symbol in Σ , and that all terms of C containing a function symbol in Σ are of the form f ( x , . . . , x n ). For every variable x occurring in C , β ( x ) = [ a x ],where a x ∈ P j x k for some j x ≥
1. Let m = max { j x | x variable of C } , and let b x be the image of a x in P m +11 for each variable x of C . Then β ( f ( x , . . . , x n )) isdefined in P m +11 for every term of C of the form f ( x , . . . , x n ). In fact, it is easyto see that for every term occurring in C , β ( t ) = [ b t ] for some b t ∈ P m +11 . Let α : X → P m +11 with α ( x ) := b x for every variable x of C . It can be seen that g m +11 ( α ( t )) = β ( t ) for every subterm t of C . As P m +11 satisfies C and all termsin C are defined under the assignment α it follows that there exists a literal L in C such that ( P m +11 , α ) | = w L . We know that g m +11 : P m +11 ֒ → A is a weakembedding w.r.t. Π . It therefore preserves the truth of positive and negative Π -literals. Therefore, as g m +11 ( α ( t )) = β ( t ) for every term t of C , ( A, β ) | = L . ✷ Example 20
The following combinations of theories (seen as extensions of thetheory T ) satisfy condition ( Emb w ):(1) The combination of the theory of lattices and the theory of integers withinjective successor and predecessor is local (local extension of the theory ofpure equality).(2) T ⊆ T ∪ Mon ( Σ ), where Mon ( Σ ) = V f ∈ Σ Mon σ ( f ) f , and T is one of thetheories of posets, (dense) totally-ordered sets, (semi)lattices, distributivelattices, Boolean algebras, R . In what follows we discuss some issues related to modular reasoning in combi-nations of local theory extensions. By results in [SS05], hierarchical reasoning isalways possible in local theory extensions. In this section we analyze possibilitiesof modular reasoning, and, in particular, the form of information which needsto be exchanged between provers for the component theories when reasoning incombinations of local theory extensions.
Consider a local theory extension T ⊆ T ∪ K , where K is a set of clauses in thesignature Π = ( Σ ∪ Σ , Pred ). The locality condition requires that, for everyset G of ground clauses, T ∪ G is satisfiable if and only if T ∪ K [ G ] ∪ G has aweak partial model with additional properties. All clauses in K [ G ] ∪ G have theproperty that the function symbols in Σ only occur at the root of ground terms.Therefore, K [ G ] ∪ G can be flattened and purified (i.e. the function symbols in Σ are separated from the other symbols) by introducing, in a bottom-up manner,new constants c t for subterms t = f ( g , . . . , g n ) with f ∈ Σ , g i ground Σ ∪ Σ c -terms (where Σ c is a set of constants which contains the constants introducedby flattening, resp. purification), together with corresponding definitions c t ≈ t .The set of clauses thus obtained has the form K ∪ G ∪ D , where D is a set ofground unit clauses of the form f ( g , . . . , g n ) ≈ c , where f ∈ Σ , c is a constant, g , . . . , g n are ground terms without function symbols in Σ , and K and G are clauses without function symbols in Σ . These flattening and purificationtransformations preserve both satisfiability and unsatisfiability with respect tototal algebras, and also with respect to partial algebras in which all groundsubterms which are flattened are defined [SS05]. For the sake of simplicity in what follows we will always flatten and then purify K [ G ] ∪ G . Thus we ensure that D consists of ground unit clauses of the form f ( c , . . . , c n ) ≈ c , where f ∈ Σ , and c , . . . , c n , c are constants. Lemma 21 ([SS05])
Let K be a set of clauses and G a set of ground clauses,and let K ∪ G ∪ D be obtained from K [ G ] ∪ G by flattening and purification, asexplained above. Assume that T ⊆ T ∪ K is a local theory extension. Then thefollowing are equivalent:(1) T ∪ K [ G ] ∪ G has a partial model in which all terms in st ( K , G ) are defined.(2) T ∪K ∪ G ∪ D has a partial model with all terms in st ( K , G , D ) defined.(3) T ∪ K ∪ G ∪ N has a (total) model, where N = { n ^ i =1 c i ≈ d i → c = d | f ( c , . . . , c n ) ≈ c, f ( d , . . . , d n ) ≈ d ∈ D } . Let T and T be theories with signatures Π = ( Σ , Pred ) and Π = ( Σ , Pred ),and G a set of ground clauses in the joint signature with additional constants Π c = ( Σ ∪ Σ ∪ Σ ∪ Σ c , Pred ). We want to decide whether T ∪ T ∪ G | = ⊥ .The set G of ground clauses can be flattened and purified as explained above. Forthe sake of simplicity, everywhere in what follows we will assume w.l.o.g. that G = G ∧ G , where G , G are flat and linear sets of clauses in the signatures Π , Π respectively, i.e. for i = 1 , G i = G i ∧ G ∧ D i , where G i and G are clauses in the base theory and D i a conjunction of unit clauses of the form f ( c , . . . , c n ) = c, f ∈ Σ i . Corollary 22
Assume that T = T ∪ K and T = T ∪ K are local extensionsof a theory T with signature Π = ( Σ , Pred ) , where Σ = Σ ∩ Σ , and thatthe extension T ⊆ T ∪ K ∪ K is local. Let G = G ∧ G be a set of flat, linearare purified ground clauses, such that G i = G i ∧ G ∧ D i are as explained above.Then the following are equivalent:(1) T ∪ T ∪ ( G ∧ G ) | = ⊥ ,(2) T ∪ ( K ∪ K )[ G ∧ G ] ∪ ( G ∧ G ∧ D ) ∧ ( G ∧ G ∧ D ) | = ⊥ ,(3) T ∪ K [ G ] ∪ K [ G ] ∪ ( G ∧ G ∧ D ) ∧ ( G ∧ G ∧ D ) | = ⊥ ,(4) T ∪ K ∪ K ∪ ( G ∪ G ) ∪ ( G ∪ G ) ∪ N ∪ N | = ⊥ , where N = { n ^ i =1 c i ≈ d i → c = d | f ( c , . . . , c n ) ≈ c, f ( d , . . . , d n ) ≈ d ∈ D } N = { n ^ i =1 c i ≈ d i → c = d | f ( c , . . . , c n ) ≈ c, f ( d , . . . , d n ) ≈ d ∈ D } and K i is the formula obtained from K i [ G i ] after purification and flattening,taking into account the definitions from D i . Proof : Direct consequence of Lemma 21. The fact that ( K ∪ K )[ G ∧ G ] = K [ G ] ∪K [ G ] is a consequence of the fact that G i are flattened and for i = 1 , K i contains only function symbols in Σ i . The equivalence of (3) and (4) followsfrom the fact that Σ and Σ only have function symbols in Σ in common. ✷ The method for hierarchic reasoning described in Corollary 22 is modular, in thesense that once the information about Σ ∪ Σ -functions was separated into a Σ -part and a Σ -part, it does not need to be recombined again. For reasoningin the combined theory one can proceed as follows: – Purify (and flatten) the goal G , and thus transform it into an equisatisfiableconjunction G ∧ G , where G i consists of clauses in the signature Π i , for i = 1 ,
2, and G i = G i ∧ G ∧ D i , as above. – The formulae containing extension functions in the signature Σ i , K i [ G i ] ∧ G i are “reduced” (using the equivalence of (3) and (6)) to the formula K i ∧ G i ∧ G ∧ N i in the base theory. – The conjunction of all the formulae obtained this way, for all componenttheories, is used as input for a decision procedure for the base theory.
Remark 23
Let T ⊆ T ∪ K i be local extensions for i = 1 , . Assume that K i are Σ i -flat and Σ i -linear and all variables in clauses in K i occur below a Σ i -symbol, and that the extension T ⊆ T ∪ K ∪ K is local. Let G = G ∧ G be as constructed before. Assume that T ∪ ( K ∧ G ) ∧ ( K ∧ G ) | = ⊥ . Thenwe can construct a ground formula I which contains only function symbols in Σ = Σ ∩ Σ such that ( T ∪ K ) ∧ G | = I ( T ∪ K ) ∧ G ∧ I | = ⊥ Proof : We assumed that the goal is flat and linear, i.e. G i = G i ∧ ∧ G ∧ D i where G i , G contains only function symbols in Σ and D i is a set of definitionsof the form c ≈ f ( c , . . . , c n ) with f ∈ Σ i . If T ∪ ( K ∧ G ) ∧ ( K ∧ G ) | = ⊥ then, by Corollary 22 (with the notations used there): T ∪ K ∪ K ∪ ( G ∪ G ) ∪ ( G ∪ G ) ∪ N ∪ N | = ⊥ .Obviously, every model of T which satisfies K ∧ G ∧ G ∧ D is also a model of T ∪ K ∪ G ∪ G ∪ N , and every model of T which satisfies K ∧ G ∧ G ∧ D is also a model of T ∪ K ∪ G ∧ G ∪ N . Let I = K ∪ G ∪ G ∪ N . Then T ∧ G ∧ G ∧ D | = I,I ∧ T ∧ G ∧ G ∧ D | = T ∪ ( K ∪ G ∪ G ∪ N ) ∪ ( K ∪ G ∪ G ∪ N ) | = ⊥ . All variables in clauses in K i occur below a Σ i -symbol, so K i [ G i ] (hence also K i )is ground for i = 1 ,
2, i.e. I is quantifier-free. ✷ If the goal is not flattened, then we can flatten and purify it first and use The-orem 23 to construct an interpolant I . We can now construct I from I by replacing each constant c t introduced in the purification process (and thereforecontained in a definition c t ≈ t in D ∪ D ) with the term t . It is easy to see that I satisfies the required conditions. We can, in fact prove that only informationover the shared signature (i.e. shared functions and constants) is necessary. Theorem 24 ([SS06a])
With the notations above, assume that G ∧ G | = T ∪T ⊥ .Then there exists a ground formula I , containing only constants shared by G and G , with G | = T ∪T I and I ∧ G | = T ∪T ⊥ . We presented criteria for recognizing situations when combinations of theoryextensions of a base theory are again local extensions of the base theory. Weshowed, for instance, that if both component theories satisfy the embeddabilitycondition (
Comp w ), which guarantees that we can always embed a partial modelinto one with isomorphic support, then the combinations of the two theories sat-isfies again condition ( Comp w ). The main problem which we needed to overcomewhen considering more general combinations of local theory extensions was thepreservation of truth of clauses when extending partial operations to total oper-ations in a partial algebra. We identified some conditions which guarantee thatthis is the case. These results allow to recognize wider classes of local theoryextensions, and open the way for studying possibilities of modular reasoning insuch extensions. From the point of view of modular reasoning in such combina-tions of local extensions of a base theory, it is interesting to analyze the exactamount of information which needs to be exchanged between provers for thecomponent theories. We showed that if we start with a goal in purified form G = G ∧ G , it is sufficient to exchange only ground formulae containing onlyconstants and function symbols common to G ∧ T and G ∧ T . We wouldlike to understand whether there are any links between the results describedin this paper and other methods for reasoning in combinations of theories overnon-disjoint signatures e.g. by Ghilardi [Ghi04]. Acknowledgments.
This work was partly supported by the German ResearchCouncil (DFG) as part of the Transregional Collaborative Research Center “Au-tomatic Verification and Analysis of Complex Systems” (SFB/TR 14 AVACS).See for more information.
References
ABRS05. A. Armando, M. P. Bonacina, S. Ranise, and St. Schulz. On a rewriting ap-proach to satisfiability procedures: extension, combination of theories andan experimental appraisal. In
Proceedings of the 5th International Work-shop Frontiers of Combining Systems (FroCos’05) , LNCS 3717, pages 65–80.Springer Verlag, 2005.ARR03. A. Armando, S. Ranise, and M. Rusinowitch. A rewriting approach tosatisfiability procedures.
Information and Computation , 183(2):140–164,2003.1BG96. D.A. Basin and H. Ganzinger. Complexity analysis based on ordered res-olution. In
Proc. 11th IEEE Symposium on Logic in Computer Science(LICS’96) , pages 456–465. IEEE Computer Society Press, 1996.BG01. D. Basin and H. Ganzinger. Automated complexity analysis based on or-dered resolution.
Journal of the ACM , 48(1):70–109, 2001.BG07. F. Baader and S. Ghilardi. Connecting many-sorted theories.
The Journalof Symbolic Logic , 72(2):535–583, 2007.Bur86. P. Burmeister.
A Model Theoretic Oriented Approach to Partial Algebras:Introduction to Theory and Application of Partial Algebras, Part I , vol-ume 31 of
Mathematical Research . Akademie-Verlag, Berlin, 1986.Bur95. S. Burris. Polynomial time uniform word problems.
Mathematical LogicQuarterly , 41:173–182, 1995.Gan01. H. Ganzinger. Relating semantic and proof-theoretic concepts for poly-nomial time decidability of uniform word problems. In
Proc. 16th IEEESymposium on Logic in Computer Science (LICS’01) , pages 81–92. IEEEComputer Society Press, 2001.Ghi04. S. Ghilardi. Model theoretic methods in combined constraint satisfiability.
Journal of Automated Reasoning , 33(3-4):221–249, 2004.GM92. R. Givan and D. McAllester. New results on local inference relations. In
Principles of Knowledge Representation and reasoning: Proceedings of theThird International Conference (KR’92) , pages 403–412. Morgan KaufmannPress, 1992.GSS01. H. Ganzinger and V. Sofronie-Stokkermans. Combining local equationalhorn theories. Unpublished manuscript, 2001.GSSW04. H. Ganzinger, V. Sofronie-Stokkermans, and U. Waldmann. Modular proofsystems for partial functions with weak equality. In
Proc. InternationalJoint Conference on Automated Reasoning (IJCAR’04), LNCS 3097 , pages168–182. Springer, 2004.GSSW06. H. Ganzinger, V. Sofronie-Stokkermans, and U. Waldmann. Modular proofsystems for partial functions with Evans equality.
Information and Compu-tation , 204(10):1453–1492, 2006.Hil04. Th. Hillenbrand. A superposition view on Nelson-Oppen. In Ulrike Sattler,editor,
Contributions to the Doctoral Programme of the Second InternationalJoint Conference on Automated Reasoning , volume 106 of
CEUR WorkshopProceedings , pages 16–20, 2004.McA93. D. McAllester. Automatic recognition of tractability in inference relations.
Journal of the Association for Computing Machinery , 40(2):284–303, 1993.NO79. G. Nelson and D.C. Oppen. Simplification by cooperating decision proce-dures.
ACM Transactions on Programming Languages and Systems , 1979.SS05. V. Sofronie-Stokkermans. Hierarchic reasoning in local theory extensions.In R. Nieuwenhuis, editor, , pages 219–234, Tallinn, Estonia, 2005.Springer.SS06a. V. Sofronie-Stokkermans. Interpolation in local theory extensions. In U. Fur-bach and N. Shankar, editors,
Proceedings of the International Joint Confer-ence on Automated Reasoning (IJCAR 2006) , volume 4130 of
Lecture Notesin Artificial Intelligence , pages 235–250. Springer, 2006.SS06b. V. Sofronie-Stokkermans. Local reasoning in verification. In S. Autexierand H. Mantel, editors,
IJCAR’06 Workshop : VERIFY’06: VerificationWorkshop , pages 128–145, Seattle, USA, 2006. -.2SSI07. V. Sofronie-Stokkermans and C. Ihlemann. Automated reasoning in somelocal extensions of ordered structures. In
Proceedings of ISMVL-2007 . IEEEComputer Society, 2007. To appear.Tin03. C. Tinelli. Cooperation of background reasoners in theory reasoning byresidue sharing.