unification algebras: an axiomatic approach to unification, … · 2005-05-21 · an axiomatic...

45
Unification Algebras: An Axiomatic Approach to Unification, Equation Solving and Constraint Solving Manfred Schmidt-Schauß and J¨ org H.Siekmann Fachbereich Informatik, Universit¨ at Kaiserslautern, 6750 Kaiserslautern, F.R. Germany {schauss,siekmann}@uklirb.uucp current address of the first author (2005): Institut f¨ ur Informatik, Johann Wolfgang Goethe-Universit¨ at, Postfach 11 19 32, D-60054 Frankfurt, Germany, [email protected] Abstract. Traditionally unification is viewed as solving an equation in an algebra given an explicit construction method for terms and substitu- tions. We abstract from this explicit term construction methods and give a set of axioms describing unification algebras that consist of objects and mappings, where objects abstract terms and mappings abstract substitu- tions. A unification problem in a given unification algebra is the problem to find mappings for a system of equations si = ti |i I , where si and ti are objects, such that si and ti are mapped onto the same object. Typical instances of unification algebras and unification problems are: Term uni- fication with respect to equational theories and sorts, standard equation solving in mathematics, unification in the λ-calculus, constraint solving, disunification, and unification of rational terms. Within this framework we give general purpose unification rules that can be used in every uni- fication algorithm in unification algebras. Furthermore we demonstrate the use of this framework by investigating the analogue of syntactic uni- fication and unification of rational terms. Keywords : Unification algebra, universal algebra, equation solving, constraint solving, equational theories Acknowledgement: I thank my wife for her help in reconstructing this paper from old MacWrite Files. Note that some errors have been corrected, and that the references are updated

Upload: others

Post on 09-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Unification Algebras:An Axiomatic Approach to

Unification, Equation Solving andConstraint Solving

Manfred Schmidt-Schauß and Jorg H.Siekmann

Fachbereich Informatik, Universitat Kaiserslautern,6750 Kaiserslautern, F.R. Germanyschauss,[email protected]

current address of the first author (2005): ??

Institut fur Informatik,Johann Wolfgang Goethe-Universitat,

Postfach 11 19 32,D-60054 Frankfurt, Germany,

[email protected]

Abstract. Traditionally unification is viewed as solving an equation inan algebra given an explicit construction method for terms and substitu-tions. We abstract from this explicit term construction methods and givea set of axioms describing unification algebras that consist of objects andmappings, where objects abstract terms and mappings abstract substitu-tions. A unification problem in a given unification algebra is the problemto find mappings for a system of equations 〈si = ti|i ∈ I〉, where si and ti

are objects, such that si and ti are mapped onto the same object. Typicalinstances of unification algebras and unification problems are: Term uni-fication with respect to equational theories and sorts, standard equationsolving in mathematics, unification in the λ-calculus, constraint solving,disunification, and unification of rational terms. Within this frameworkwe give general purpose unification rules that can be used in every uni-fication algorithm in unification algebras. Furthermore we demonstratethe use of this framework by investigating the analogue of syntactic uni-fication and unification of rational terms.

Keywords : Unification algebra, universal algebra, equation solving,constraint solving, equational theories

?? Acknowledgement: I thank my wife for her help in reconstructing this paper fromold MacWrite Files.Note that some errors have been corrected, and that the references are updated

Page 2: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Acknowledgement. We are grateful to Hans-Jurgen Burckert andWerner Nutt for discussions on the subject of this paper. We acknowledgesuggestions from Gert Smolka concerning solved forms.

1 Introduction

What are the common features of unification of first-order terms with respect toan equational theory, unification in λ-calculus, equation solving in mathematicsand answering a query with respect to a logic program? In order to approximatethe answer let us look more closely to the different problems.

– Unification is the task to make two terms equal, i.e., given two terms s, t,which contain variables (in some sense), find replacements for these variables,such that s and t are equal after the replacement. This task arises in severalsettings, for free first order terms [Her30,MM82,Hue76] for terms togetherwith an equational theory [Plo72,Sie89] and for terms in sorted signatures[Wal88,SS89,SNMG89]

– Unification in λ-calculus [Hue75,SG89] is the task given two λ-expressionswith free variables, find λ-expressions that substituted for these variablesmake the two expressions equal after application of reduction rules.

– Solving an equation s = t over a fixed (universal) algebra A is to find as-signments from variables in s and t to elements of A, such that s and t aremapped to the same element of the algebra by the assignment.

– Solving equations in mathematics, for example solving Diophantine equa-tions over the naturals, means given a polynomial p with several variables,to find natural numbers for every variable in p such that the p becomes zeroafter replacing the variables by those naturals.

– Solving constraints [Col82b,JL86,DSvH87] is the task to find solutions, i.e.,substitutions into variables, such that a given constraint is satisfied. It isalso common in practice only to require a test for solvability of a constraintrather than explicitly computing solutions.

– Answering a query with respect to a logic program is given a query includingvariables, find one or all answers, i.e., all instantiation of variables in thequery, such that the instantiated query follows from the logic program.

To summarize, some common features of all these problems are:

(i) there are objects having variables,(ii) the names of the variables do not matter(iii) there exists an operation like substituting objects into variables(iv) there is a domain where the valid solutions come from.

The common problems are that some or all instantiations are wanted that solvesome equation or makes some formulae true. A further common problem is thatmethods are needed to represent infinite sets of solutions in a finite way. For

2

Page 3: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

example the equation x2 = y2 has an infinite number of solutions over theintegers, but every solution can be represented using variables, and in this caseeither by x = y or by x = −y.

This paper is an attempt to give an axiomatic framework for unification interms of unification algebras, such that all the problems above can be seen asunification problems within this framework. We develop this unification theoryto the extent that a set of lemmas and theorems can be derived including somenondeterministic unification rules that are valid in general.

A particular advantage of this approach is that many of the familiar lemmataand theorems of standard unification theory can be shown for unification algebrasand hence can be used for every problem domain, which satisfies the axioms ofa unification algebra.

This work was inspired by a recent excellent paper of J. Goguen [Gog88],which advocates a categorical approach to unification, viewing unifiers as equal-izers in some category. His attempt to provide a framework for unification theoryclearly advanced the field and had strong influence in that it showed a new lineof development. However, category theory appears to have too strong an em-phasis on the substitutions (as arrows) and underrates the inner structure ofthe objects, for example the role of the variables in objects. Furthermore hisapproach has a built-in renaming every time a unifier or a unifying step is ex-ecuted. This makes completeness proofs for unification algorithms that renamevariables only if necessary overly complicated. Though we were inspired by J.Goguen, the first authors to consider unification in categories were R. M. Burstalland D.E.Rydeheard [RB85,RS87].

Our approach allows a natural treatment of unification algorithms based ontransforming systems of equations or multi-equations as for example used in[Her30,MM82,GS87,Hue76,SS89]. This approach allows easy proofs of complete-ness of such nonrenaming algorithms, which are of high practical interest. Afurther advantage is that our approach allows a unified treatment of sorts andof equational theories.

The paper is structured as follows: In sections 2-4 we give the basic axiomsfor a unification algebra, define the notions of unification type and provide someconsequences in order to show that the substitutions behave as expected. Section5 on homomorphisms and congruences shows that unification algebras form acategory where the usual homomorphism theorem holds. In section 6 we givecomplete transformation steps for equation systems that can be used in everyunification algorithm. Section 7 presents the notion of dimension and redundantequations in unification algebras. In section 8 we discuss the notion of minimalrepresentations of solutions. Section 9 presents a complete unification algorithmfor the equivalent of the Robinson-case and also for the case of rational infiniteterms.

3

Page 4: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

2 Unification Algebras

Basically, unification algebras consist of a set OBJ and a set MAP of mappingsfrom OBJ into OBJ. Intuitively, the set OBJ can be viewed as the set of allwell-formed expressions with respect to some language modulo a congruenceand MAP as the set of well-formed variable-replacements modulo the samecongruence. We will distinguish some elements in OBJ as variables V . Thisgives a level of abstraction, in which the properties of the defined structurecan be investigated without regarding the language which is used to define thisstructure.

The design decisions we have made are for example that variables are ex-plicitly available in contrast to the categorical approach, where variables areconsidered modulo renamings. Furthermore it is not possible to prohibit the ap-plication of a substitution to some term, for example it is impossible to say thatit is disallowed to substitute 0 for x in the term y/x if substituting 0 for x isallowed in other terms.

As a preliminary for the definition of unification algebra we define a unificationquasi-algebra A as a triple (V,OBJ,MAP), where OBJ 6= ∅,MAP is a setof total mappings σ : OBJ → OBJ and V ⊆ OBJ. We tacitly assume thatequal mappings on OBJ are equal elements of MAP. Usually we will refer toelements of OBJ as objects, to MAP as mappings and to V as variables.

We try to provide a minimal axiomatization, such that it is easy to check thata given structure is a unification algebra, and that the machinery for unificationalgebras can be used.

Now we give the axioms which a unification algebra A should obey. In thefollowing we assume that A = (V,OBJ,MAP) is a unification quasi-algebra.

MON) MAP is a monoid with respect to composition of mappings with identityId .

We use the usual notation for substitutions also for mappings σ ∈ MAP.By DOM(σ) we denote x ∈ V |σx 6= x and by COD(σ) = σDOM(σ). Thenotation σ = τ [W ] for mappings σ, τ means that σx = τx for all variables x inW .

The next axiom states that every mapping can be characterized by its values onV :

V1) (Basis axiom)∀σ, τ ∈MAP : σ = τ [V ]⇒ σ = τ.

We represent a mapping σ ∈ MAP by σ = xi ← σxi|i ∈ I, whereDOM(σ) = xi|i ∈ I.The axiom (V2) captures the intuition that one can independently choose in-stantiations for variables.

4

Page 5: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

V2) (Restriction axiom)∀σ ∈MAP ∀W ⊆ V ∃τ ∈MAP : σ = τ [W ] and τy = y for all y 6∈W .We denote τ as σ|W .

Definition 2.1. We say ξ is a variable permutation iff

i) ξV ⊆ V, andii) There exists a mapping ξ− ∈MAP such that ξ−ξ = Id.

We say two variables x, y are equivalent, if ξx = y for some variable permutationξ.

Axiom V 3 has the task to axiomatize that the name of variables is irrelevant.

V3) (Renaming axiom)For all finite sets W,W ′ of variables there exists a variable permutationξ ∈MAP such that ξW ∩W ′ = ∅.

The following axiom is the first of the finiteness axioms, and together with thesecond (finiteness of variables occurring in an object) we are enabled considerthe set of variables as coinfinite, i.e., we can always assume that new variablescan be introduced. This is a slight restriction, since this makes it impossibleto solve problems including an infinite number of variables. A solution for thismore general case would be to choose V such that the cardinality of V is greaterthan the cardinality of the set of variables in an object and the set of variablesin the domain of a mapping. Note that in the infinite case, the axioms may beinsufficient, since we have tried to make the axioms as small as possible.

V4) (Finiteness of domains of mappings)DOM(σ) is finite for all σ ∈MAP.

Definition 2.2. The set of variables of an object t ∈ OBJ is defined as thefollowing set:V(t) := x ∈ V|∃σ σ|xt 6= t.

We denote the set of variables introduced by a mapping σ byI(σ) := V(COD(σ)).

V5) (Finiteness axiom for objects)∀t ∈ OBJ : V(t) is finite.

Definition 2.3. (V,OBJ,MAP) is a unification algebra, iff it is a unifica-tion quasi-algebra and the axioms (MON) and (V1) - (V5) are satisfied.

We denote the set of the set of reachable objects as TERM := MAP(V ) =σx|σ ∈MAP, x ∈ V and refer to objects in TERM as terms.

5

Page 6: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Definition 2.4. A unification algebra (V,OBJ,MAP) is called unsorted, iffall variables are equivalent and MAP(OBJ − TERM) ⊆ OBJ − TERM.Otherwise it is called sorted.

The condition MAP(OBJ−TERM) ⊆ OBJ−TERM can be interpretedas: instances of literals are again literals, and literals and terms are different.If for some object t that is not a term some instance is a term, then t canbe considered as a non-well-sorted term, which has become well-sorted afterinstantiation.

The definition characterizes the set of unsorted terms and literals withrespect to some signature as unsorted unification algebra.

Example 2.5.

1) Let Σ be a signature, V be a set of variables, T(Σ,V) be the set of first orderterms and let SUB be the set of substitutions over T(Σ,V). It can easily beverified that (V, T(Σ,V),SUB) is an (unsorted) unification algebra.

2) Let Σ,V, T(Σ,V), and SUB be as above and let ∼ be a congruence onT (Σ,V), such that s ∼ t implies σs ∼ σt for all terms s, t and all substitu-tions σ ∈ SUB.Let V/∼, T(Σ,V)/∼,SUB/∼ be the quotients of variables, terms and sub-stitutions modulo ∼.Again it can easily be verified that (V/∼, T(Σ,V)/∼,SUB/∼) is an (unsorted)unification algebra.If the congruence comes from an equational theory E , then E-equality trans-forms into identity of objects and substitutions in the unification algebra.It should be noted that the set of variables in a term defined here is notthe syntactic one as in term algebras. For example the theory E axiomatizedby f(x) = f(y) causes f(x) to contain no variables with respect to theunification algebra, since it cannot be changed (modulo E) by instantiatingthe variable x.

3) Let F be the set of set of first-order-expressions with respect to some signa-ture, i.e., the set consisting of variables, terms, and first order formulae.As equivalence ≡ we use the change of bound variables in formulae. Since thenames of bound variables should not conflict with free variables, we assumethat the set of free variables is disjoint from the set of bound variables.Then let OBJ = F/≡, and MAP be the set of first-order substitutionswith respect to the terms over free variables. This constitutes a unificationalgebra.

4) Let F be the set of set of first-order-expressions with respect to some signa-ture, i.e., the set consisting of variables, terms, and first order formulae. Weinclude also the constants true and false. We assume that for every groundliteral (i.e., without variables), we know whether it is true or false. Further-more we assume that every literal has a ground instance.We choose an equivalence different to 3): A formula L is equivalent to true,iff it contains no free variables and is interpreted as true with respect to

6

Page 7: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

the given semantics. A formulae L is equivalent to false, iff it contains nofree variables and is interpreted as true with respect to the given semantics.For arbitrary formulae we assume that two formulae are equivalent (≡), iffthey always evaluate to the same truth-value under every interpretation. Asabove, we can assume that the set of free variables is disjoint from the setof bound variables.Then let OBJ = F/≡, and let MAP be the set of first-order substitu-tions over the set of terms with respect to free variables. This constitutes aunification algebra.We have not allowed that free variables are captured, for example it is notallowed to replace y by x in the formula ∀x P (x, y), since then there existsno variable permutation that renames y.

5) A slight variation of the example in 4) is that the semantics is defined via alogic program, and formulae are only the queries, i.e., clauses with negativeliterals, where the variables in the query are considered as free. As equiva-lence we may use the following: two queries are equivalent (≡), iff they areequal under associativity, commutativity and idempotency of ∨.Then F/≡ together with the set of first-order substitutions over the set ofterms with respect to free variables constitute a unification algebra.It is also possible to have stronger equivalences, for example an equationaltheory on the term-algebra, and a theory on literals, such as symmetry ofpredicates.

6) The well-sorted terms of a sorted term algebra [Wal88,SS89] together withthe well-sorted substitutions form a sorted unification algebra, as is easilyverified.This unification algebras are sorted in the sense of Definition 2.4, since ingeneral not all variables are equivalent.

7) The set of all polynomials over the integers together with substitutions thatsubstitute polynomials into variables is a unification algebra.

8) Let ≡ be the set of λ-expressions (including free variables) over some sig-nature modulo some equivalence (βη-reduction, denoted by ≡). We assumethat the set of bound and free variables are disjoint. Then F/≡ togetherwith the set of substitutions that substitute λ-expressions into variables area unification algebra.

9) Solving equations over fields:Let K be a field. We add an error-element error. We take the set of first orderformulae as OBJ, where we assume that = is a built-in binary predicate, anduse an appropriate congruence on first order-formulae. For example p/0 =error. Two formulae are equivalent, if they can be made equal by renamingof bound variables. The mappings MAP are all assignments of rationalpolynomials (including error) to variables (modulo the congruence).This constitutes a unification algebra.Solving an equation p/q = 0 means to solve the problem 〈p/q = 0, q 6= 0〉.

7

Page 8: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Example 2.6.

1) Matching as defined in [BHMS87] can be seen as solving equations in a unifi-cation algebra. The unification algebra for matching is constructed from theterm-algebra by considering some variables as constants, i.e., by restrictingthe set of substitutions.

2) Matching as defined in [FH83] cannot be seen as solving equations in aunification algebra in the sense that a matching problem is replaced by itssolution. In our framework this type of matching means to add equations toa to-be-solved system, where these additional equations come from a substi-tution.

3) Disunification [Col84,Com88,Bur88] can also be seen as solving equations ina unification algebra, where the encoding as equations may be via formulaeas in Example 2.5.Disunification with parameters can be interpreted as solving an infinite sys-tem of equations containing only a finite set of variables.

3 Semantics and Unification Problems.

In this section we develop the notion of solving equations and systems of equa-tions adopting the notion of solutions as ground solutions. This is according toour intuition of equation solving in mathematics, but seems not to capture term-unification. However, considering the variables in a problem and the variablesin terms, which occur in solutions, as different things, we can view the variablesin terms as free constants, whereas the variables in a problem to be solved arevariables in the sense of unification algebras.

In sections 5 and 6 we show more explicitly the relation between our notion ofthe solution of an equation and with the unification in term-algebras.

Rather than to provide the semantics of expressions with respect to some externalmodels, we prefer to use a similar notion as the Herbrand-model, which usesground terms and atoms for providing a semantics. This (internal) semanticscan be seen as definite semantics, and captures also the case where semantics isdefined via a class of models.

Let OBJgr := t ∈ OBJ|V (t) = ∅ be the set of ground objects, andlet the set of ground mappings on a set of variables W be MAPgr,W =σ ∈ MAP|W ⊆ DOM(σ) and I(σ) = ∅. If σ ∈ MAPgr,W we say also σ isground on W.

Definition 3.1. A unification algebra is called inhabited, iff for every x ∈ V ,there exists an object t with V (t) = ∅, such that x← t ∈MAP.

In the following we assume that A is inhabited.

8

Page 9: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Definition 3.2. A unification problem is a set Γ of pairs of objects, alsodenoted by Γ = 〈si = ti|i ∈ I〉, such that V (Γ ) is finite.

A solution σ of Γ = 〈si = ti|i ∈ I〉 is a mapping σ ground on V (Γ ), suchthat σsi = σti for all i ∈ I.

The set of solutions of Γ is also denoted SOL(Γ ). We say Γ is solvable, ifSOL(Γ ) 6= ∅, otherwise it is called unsolvable.

For a mapping σ = x1 ← t1, . . . , xn ← tn, we denote the unification problem〈x1 = t1, . . . , xn = tn〉 by 〈σ〉.

For a set of mappings U we define the set of restrictions on a set of variablesW as U|W = σ|W |σ ∈ U. For two sets of mappings U and U ′, we say U andU ′ are equal modulo a set of variablesW , denoted by U = U ′[W ], iff U|W = U ′

|W .

We define systems of solved forms as an extension of idempotent substitu-tions:

Definition 3.3. Let S be a set of unification problems.We say S is a system of solved problems, iff

i) SOL(∆) 6= ∅ for every ∆ ∈ S.ii) For every unification problem Γ , there exists a subset D ∈ S such that

SOL(Γ ) = ∪SOL(∆)|∆ ∈ D [V (Γ )].Such a set D is also called an S-representation of SOL(Γ ).

iii) For every σ ∈MAP with DOM(σ) ∩ I(σ) = ∅ : 〈σ〉 ∈ S.

In section 4 (Lemma 4.16) we show that this definition is consistent, since formappings σ ∈MAP with DOM(σ) ∩ I(σ) = ∅, the unification problem 〈σ〉 issolvable.

Definition 3.4. Let S be a system of solved problem. The unification type ofunification problems and algebras is defined with respect to a system S of solvedproblems.Let Γ be a solvable unification problem and let A be a unification algebra.

i) We say Γ is S-unitary, iff there exists a S-representation of SOL(Γ ) thatis a singleton.

ii) We say Γ is S-finitary, iff there exists a finite S-representation of SOL(Γ ).iii) We say Γ is S-infinitary, iff there exists no finite S-representation.iv) We say A is S-unitary, iff every solvable Γ is S-unitary.v) We say A is S-finitary, iff every solvable Γ is S-finitaryvi) We say A is S-infinitary, if there exists some solvable Γ that is S-

infinitary.

It is common in unification theory to use as system S of solved problemsonly the set of all 〈σ〉 for all mappings σ with DOM(σ)∩I(σ) = ∅, i.e., allidempotent substitutions. However, there are also examples where the system ofsolved problems is larger. For rational terms, it is accepted that cyclic problems

9

Page 10: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

are also solved forms, and for unification in λ-calculus there are also flexible-flexible term pairs allowed in a solved form [Hue75,SG89]. We compare systemsof equations (unification problems) with an ordering.

Definition 3.5. Let W be a set of variables and let Γ,∆ be unification problems.Then

Γ ⊆W ∆, iff SOL(Γ )|W ⊆ SOL(∆)|W .

We do not define minimal problems as in [Sie89], since for the general frameworkgiven here, this notion seems to be unimportant, see our discussion in section8 on optimal representations. Let SUNI be the standard (and minimal) set ofsolved forms consisting of all equational systems that correspond to idempotentsubstitutions, i.e., SUNI :=〈σ〉|σ ∈MAP and DOM(σ) ∩ I(σ) = ∅. We givethe definition of unifiers and correct and complete sets of unifiers:

Definition 3.6. Let Γ be a unification problem.

i) A mapping σ is a unifier of Γ , if whenever λσ is ground on V(Γ ) it is alsoa solution of Γ .

ii) A set cU is a correct set of unifiers of Γ , if every mapping in cU is aunifier.

iii) A set cU is a complete set of unifiers of Γ , if for every σ ∈ SOL(Γ ),there exists a τ ∈ cU and a mapping λ, such that λτ = σ[V (Γ )].

iv) A correct and complete set of unifiers is also called a unifier-representation of SOL(Γ ).

In the rest of this paper we will only consider solved forms that correspondto unifiers, if not stated otherwise.

4 Properties of Unification Algebras

In this section we explore some consequences of our axioms and show that thebehavior of mappings is as expected. The proofs are in general simple, but someare rather tedious to our surprise.Throughout this section we assume that V 6= ∅.

Lemma 4.1 (Nontriviality of variables).

i) For all x ∈ V there exists a σ ∈MAP with σx 6= x.ii) V is an infinite set.

Proof. i) Follows from Axiom V6).ii) Axiom V3) allows the introduction of infinitely many variables, hence V is

infinite.ut

As noted above, every mapping σ can be represented in a finite way asx1 ← t1, . . . , xn ← tn where DOM(σ) = x1, . . . , xn and COD(σ) =t1, . . . , tn. The mappings xi ← ti are called components of σ. We show,how to compute the representation of the composition of mappings σ, τ ∈MAP:

10

Page 11: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Lemma 4.2.If σ = x1 ← s1, . . . , xn ← sn and τ = y1 ← t1, . . . , ym ← tm, thenστ = y1 ← σt1, . . . , ym ← σtm ∪ xi ← si|xi 6∈ DOM(τ).

Proof. Using V1) we can compute στ by testing στ on variables: Forx 6∈ DOM(σ)∪DOM(τ), we have στx = σx = x. If x ∈ DOM(σ)−DOM(τ),then στx = σx. If x ∈ DOM(τ), then στx = σ(τx). ut

Proposition 4.3. For every x ∈ V there exist infinitely many variables x′

equivalent to x.

Proof. Let x be a variable and assume there are only finitely many variables Wequivalent to x. Then application of axiom V3 yields for the set W a variablepermutation ξ, such thatW∩ξW = ∅. Since ξW is a set of variables equivalent tox, this is a contradiction to the assumption that W is the largest set of variablesequivalent to x. ut

This proposition justifies the notion of new variable: if we have alreadyused a finite set of variables W and we have a variable x, then it is alwayspossible to select a variable x′ equivalent to x, such that x′ 6∈W .Let s, t be two objects. We say s is more general than t (or t is an instanceof s), iff there exists a mapping σ with σs = t. This is denoted by s 6≤ t. We says and t are equivalent, iff s 6≤ t and t 6≤ s, and denote this by s ≡ t. The nextlemma shows, that this is consistent with the notion of equivalent variables.

Lemma 4.4. The following statements are equivalent:

i) The variables x and y are equivalent,ii) y ← x ∈MAP and x← y ∈MAPiii) There exist σ, τ ∈MAP with σx = y and σy = x.

Proof. i)⇒ ii) follows from the definition of variable permutation and V2).ii)⇒ iii) trivial.iii)⇒ ii) follows from the restriction axiom V2).ii)⇒ i) Let x ← y ∈ MAP and y ← x ∈ MAP. Let y′ be a new variableequivalent to x. Then x ← y′, y′ ← x ∈ MAP , since i) implies ii). Hencealso (x← yy′ ← x) ∈MAP.Obviously we have (y′ ← yy ← x, x← y′)|x,y = x← y, y ← x.Since x ← y, y ← xx ← y, y ← x = Id, we have constructed a variablepermutation ξ := x← y, y ← x with ξx = y. ut

Lemma 4.5. Let ξ = x1 ← y1, . . . , xn ← yn be a variable permutation.Then

i) the left-inverse ξ− is also a right-inverseii) the inverse ξ− is unique.iii) the inverse ξ− is a variable permutationiv) ξ is a bijection on V .v) ξ− = y1 ← x1, . . . , yn ← xn

11

Page 12: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Proof. Let ξ− be a mapping with ξ−ξ = Id.For xi ∈ DOM(ξ) we have ξ−ξxi = ξ−yi = xi, since ξ− is a left inverse of ξ.For x 6∈ DOM(ξ) we have ξ−ξx = ξ−x = x, since ξ− is a left inverse of ξ.Let yi ∈ COD(ξ) −DOM(ξ), then on the one hand, we have ξ−yi = yi, sinceyi 6∈ DOM(ξ), on the other hand, we have ξ−yi = xi. This implies xi = yi,hence we have the contradiction that xi 6∈ DOM(ξ). We have proved thatCOD(ξ) ⊆ DOM(ξ).ξ is injective on DOM(ξ), since ξxj = ξxk implies σξxj = σξxk which is equiv-alent xj = xk.Since DOM(ξ) is finite, we have DOM(ξ) = COD(ξ).Summarizing, we have shown that ξ− = y1 ← x1, . . . , yn ← xn, which alsoshows that the inverse is unique.Now ξ− is also a right inverse of ξ:For x 6∈ DOM(ξ), we have ξξ−x = x.For x ∈ DOM(ξ), we can assume that x = yk for some k. Then ξξ−yk = ξxk =yk.Hence ξ− is a variable permutation.That ξ is a bijection on V follows, since ξ is surjective as DOM(ξ) = COD(ξ),and since ξ is injective, which is implied by the fact that ξ has a left inverse. ut

A renaming ρ ∈ MAP is a restriction of a variable permutation ξ, such thatDOM(ρ) ∩ I(ρ) = ∅. If ρ = x1 ← y1, . . . , xn ← yn, then the converse ρ− isdefined as ρ− = y1 ← x1, . . . , yn ← xn. If the domain of a renaming ρ is Wand the codomain of ρ consists of new variables, we will call ρ a renaming ofW .

Lemma 4.6. Let ρ be a renaming.

i) A renaming is the product of its components.ii) ρ is idempotent, i.e., ρρ = ρ.iii) The converse ρ− of a renaming exists and is a renaming.iv) ρ−ρ = ρ−, ρρ− = ρ.

In the following we analyze the notion of variables in an object, and show thatit behaves as expected.

Lemma 4.7. Let t be an object, let y be a variable and let y′ be a new variableequivalent to y. Then y ∈ V (t)⇔ y ← y′t 6= t.

Proof. ”⇐” is trivial.”⇒” Let y ∈ V (t). Then there exists an object s such that y ← st 6= t. Let y′

be a new variable equivalent to y. Since y′ is new we have y′ 6∈ V (t) ∪ V (y ←st) ∪ V (s). Now consider the product: y ← sy′ ← y = y′ ← s, y ← s,hence by V2 the mapping y′ ← s is in MAP. Now y′ ← sy ← y′ = y′ ←s, y ← s = y′ ← sy ← s, hence y′ ← sy ← y′t = y′ ← sy ← st =y ← st 6= t. Furthermore y′ ← yy ← y′t = y′ ← yt = t. This meansy′ ∈ V (y ← y′t), hence y ← y′t 6= t. ut

12

Page 13: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Lemma 4.8. Let t be a nonvariable object with y ∈ V (t) and let y′ be a newvariable equivalent to y. Then y ← y′t 6∈ V .

Proof. Assume for contradiction that y ← y′t = z ∈ V . Then y′ ← yy ←y′t = t , hence y′ ← yz = t. This means that t = z or t = y′, which is acontradiction. ut

Now the notion of mappings and objects seem to be understandable, however,one problem remains: we have not proved that σt = t, if DOM(σ) ∩ V (t) = ∅.Surprisingly, the proof is tedious:

Lemma 4.9. Let t be an object and let ρ ∈MAP be a renaming with I(ρ)∩V (t) = ∅.Then V (ρt) = ρV (t).

Proof.

i) It suffices to consider a single component of ρ, since ρ = ρ1ρ2 . . . ρn:Assume as base case for the induction on the number of components, thatthe lemma is true for a single component.Then we can prove the induction step:We have I(ρ1) ∩ V (ρ2 . . . ρnt) = I(ρ1) ∩ ρ2 . . . ρnV (t) = ∅ (by inductionhypothesis and assumption).Then we can conclude V (ρ1ρ2 . . . ρnt) = ρ1V (ρ2 . . . ρnt) = ρ1ρ2 . . . ρnV (t),since the lemma holds for a single component.

ii) The lemma holds for a single component, i.e. for different (but equivalent)x, x′ ∈ V with x′ 6∈ V (t), we have V (x← x′t) = x← x′V (t):The case that x 6∈ V (t) is trivial, since then by definition of V (t) we havex ← x′t = t, hence V (x ← x′t) = V (t) = x ← x′V (t). Thus we canassume that x ∈ V (t).Now we can compute x← x′V (t) = x′ ∪ (V (t)− x).Since for all mappings x ← s, we have x ← s(x ← x′t) = (x ←sx ← x′)t = x ← x′t, we have that x is not a variable of the objectx← x′t, hence x← x′t 6= t.Since x and x′ are equivalent, there exists a mapping x′ ← x, hencex′ ← xx← x′t = x′ ← xt = t implies that x′ ∈ V (x← x′t).We show that V (x← x′t)− x′ = x← x′V (t)− x′:1) V (x← x′t)− x′ ⊆ x← x′V (t)− x′:

Assume by contradiction that for some y ∈ V (x← x′t) with y 6= x, x′

we have y 6∈ x← x′V (t). Then y 6∈ V (t). Let y′ ≡ y be a variable suchthat y′ is new.We have y ← y′x ← x′t 6= x ← x′t, since y ∈ V (x ← x′t).However, y ← y′x← x′ = x← x′y ← y′, since all variables aredifferent, hence y ← y′x← x′t = x← x′y ← y′t = x← x′t .This is a contradiction.

2) x← x′V (t)− x′ ⊆ V (x← x′t)− x′:Assume there exists a variable y 6= x, x′ with y ∈ V (t), but y 6∈ V (x←

13

Page 14: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

x′t).Let y′ ≡ y be a new variable. Then y ← y′x ← x′t = x ← x′t.Application of x′ ← x gives x′ ← xy ← y′x ← x′t = x′ ←xx ← x′t = t, but x′ ← xy ← y′x ← x′t = y ← y′x′ ←xx← x′t = y ← y′t. This is a contradiction, since t 6= y ← y′t.

ut

Lemma 4.10. For σ ∈MAP and t ∈ OBJ we have σt = (σ|V (t))t.

Proof. Let σ ∈ MAP and let t be an object. Let ρ be a renaming ofDOM(σ) ∩ I(σ), such that I(ρ) consists of new variables. Assume thatDOM(σ) = x1, . . . , xn and that DOM(σ) ∩ V (t) = x1, . . . , xk. Fromσ = x1 ← t1, . . . , xn ← tn we get ρσ = x1 ← ρt1, . . . , xn ← ρtn.Furthermore by Lemma 4.9 we get V (ρti) ∩DOM(σ) = ∅.Hence ρσ = x1 ← ρt1x2 ← ρt2 . . . xn ← ρtn. This factorization im-plies ρσt = (ρσ)|V (t)t . Obviously the mapping (ρσ)|V (t) has the representationx1 ← ρt1, . . . , xk ← ρtk.Applying ρ− to the equation ρσt = (ρσ)|V (t)t gives ρ−ρσt = ρ−(ρσ)|V (t)t andthus ρ−σt = ρ−ρσt = ρ−(ρσ)|V (t)t = ρ−x1 ← ρt1, . . . , xk ← ρtkt = ρ−x1 ←t1, . . . , xk ← tkt = ρ−(σ)|V (t))t. Since DOM(ρ−) is disjoint from V (σt) andV ((σ|V (t))t), we get σt = ρ−σt = ρ−(σ|V (t))t = (σ|V (t))t . ut

Corollary 4.11. Let σ ∈ MAP and let t be an object such that V (t) ∩DOM(σ) = ∅. Then σt = t.

Corollary 4.12. Let σ, τ ∈MAP and let t ∈ T . Then σ = τ [V (t)]⇒ σt =τt.

Proof. Since σt = (σ|V (t))t ,τt = (τ|V (t))t and σ|V (t) = τ|V (t), we can concludeσt = τt. ut

Lemma 4.13. V (σt) ⊆⋃V (σx)|x ∈ V (t).

Proof. We can assume DOM(σ) = V (t), since σt = σ|V (t)t by Lemma 4.10.Note that

⋃V (σx)|x ∈ V (t) = I(σ) ∪ (V (t)−DOM(σ)).

Let y be a variable with y ∈ I(σ) ∪ (V (t) −DOM(σ)). That means y 6∈ I(σ).Furthermore either y 6∈ V (t) or y ∈ DOM(σ). Let y′ be a new variable thatis equivalent to y. If y 6∈ V (t), then y ← y′σt = σy ← y′t = σt, hencey 6∈ V (σt).If y ∈ DOM(σ), then y ← y′σ = σ, hence y 6∈ V (σt). This proves the lemma.

ut

Lemma 4.14. The union of mappings exists:Let σ, τ ∈MAP such that σ = τ [DOM(σ) ∩DOM(τ)].Then there exists a mapping µ, such that µ = σ[DOM(σ)] and µ = τ [DOM(τ)].

14

Page 15: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Proof. Let ρ be a renaming of I(τ) by new variables. Then let τ ′ :=(ρ−τ)|DOM(τ) and µ := ρστ ′.Let x ∈ DOM(τ). Then µx = ρστ ′x = ρσρ−τx = ρρ−τx = ρτx = τx usingLemma 4.10.If x ∈ DOM(σ) ∩ DOM(τ), then µx = τx = σx by the assumption of thelemma.If x ∈ DOM(σ)−DOM(τ), then µx = ρστ ′x = ρσx = σx. ut

For two mappings σ, τ with σ = τ [DOM(σ) ∩DOM(τ)] we define σ ∪ τ as themapping given in the lemma above restricted to DOM(σ) ∪ DOM(τ). Thisunion can be seen as a union of the representations of σ and τ .

Now we can prove some required lemmas concerning solvability of equa-tion systems.We can characterize OBJgr as the set of fixed points under MAP:

Lemma 4.15.OBJgr = t ∈ OBJ|∀σ ∈MAP : σt = t.

Proof. If t ∈ OBJgr, then V (t) = ∅, hence σt = t for all σ ∈MAP by Corollary4.11. On the other hand, if for some t ∈ OBJ is fixed under all σ ∈MAP, it isfixed under all mappings x← s, hence V (t) = ∅. ut

We show that the equation systems in solved form are solvable:

Lemma 4.16. Let A be an inhabited unification algebra and let σ be a map-ping with DOM(σ) ∩ I(σ) = ∅. Then σ is solvable.

Proof. For every x ∈ I(σ) there exists a ground term sx with x← sx ∈MAP.The union τ of all these mappings exists by Lemma 4.14. Then τσ is a solutionof 〈σ〉. For a component 〈x = σx〉, we have τσx = τσσx, since σ is idempotent.Furthermore τσ is ground on V (Γ ). ut

According to Definition 3.5, we define two subsumption relations on mappings.

Definition 4.17. Let σ, τ be mappings and W be a set of finite variables,

i) σ ⊇W τ , iff for all λ ∈ MAP, such that λτ is ground on W , there existsa λ′, such that λ′σ = λτ ′[W ]. Intuitively, σ ⊇W τ means that σ representsmore ground substitutions than τ .

ii) σ ≤ τ [W ], iff there exists a mapping λ such that λσ = τ [W ].

Obviously ≤ [W ] and ⊇W are quasi-orderings on MAP for a fixed W .

Lemma 4.18. σ ≤ τ [W ] implies σ ⊇W τ , but the converse may be false.

15

Page 16: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Proof. Let µ be such that µσ = τ [W ]. Let λ ∈MAP, such that λt is ground onW . Then λµσ is also ground on W and λµσ = λτ [W ]. Hence σ ⊇W τ .We give an example that the converse is false:Consider substitutions over the integers.Let σ = x ← y and let τ := x ← x2

1 + x22 + x2

3 + x24 − (y2

1 + y22 + y2

3 + y24)

Obviously we have σ ⊇W τ and τ ⊇W σ, since both substitutions range over thewhole set of integers as is well-known from the theory of numbers. The relationσ ≤ τ [W ] holds, but not σ ≥ τ [W ], since it is not possible to obtain y bysubstituting polynomials into the polynomial τx. ut

We show in paragraph 5 that for unification in free term algebras the tworelations ≤ τ [W ] and ⊇W are the same.

Example 4.19. Consider Pythagoras’ equation x2 + y2 = z2 over the naturals(including zero). This equations has infinitely many solutions. A minimal repre-sentation consists of the two unifiersx ← 2p(p + q), y ← q2 + 2pq, z ← p2 + (p + q)2 and x ← q2 + 2pq, y ←2p(p+ q), z ← p2 + (p+ q)2.

5 Homomorphisms and Congruences

In this paragraph we develop the algebraic tools that correspond to unificationalgebras like homomorphisms and quotients and show that the isomorphismtheorem holds. This makes the unification algebras to be a category with someadditional properties.

A the end of this paragraph we argue that every unification algebra is iso-morphic to the quotient of of an order-sorted term-algebra [SS89,SNMG89] (in-cluding ill-sorted terms), where the quotient is made with respect to a stablecongruence. At the first glance this appears to be a drawback, since we have ar-rived at what was to be generalized. However, there are several merits. Usuallyit is easier to prove that some problem can be formulated using unification alge-bras than to give a signature, a congruence and a sort-structure that describesthe problem domain, since there may be infinitely many symbols, equations andterm-sort declarations. A further advantage of unification algebras is the notionof isomorphism, which is superior to isomorphisms of universal algebras, since itincludes weak isomorphism of universal algebras (definitional equivalence, poly-nomial equivalence), [Gra79,BS81] isomorphisms or symmetries of signatures,and symmetries of the sort-structure.

Definition 5.1. Let A1 = (V1,OBJ1,MAP1) and A2 = (V2,OBJ2,MAP2)be unification algebras. A mapping ψ : A1 → A2 is a homomorphism, iff

i) ψ is a mapping ψ : OBJ1 → OBJ2 and ψ : MAP→MAP2

ii) ψ(στ) = ψ(σ)ψ(τ)iii) ∀σ ∈MAP1∀ t ∈ OBJ1 : ψ(σt) = (ψσ)(ψt).

16

Page 17: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

iv) V2 ⊆ ψ(V1).

Let ψ : A1 → A2 be a homomorphism. We say ψ is an isomorphism, iffit is a homomorphism that is a bijection on the set objects and mappings, suchthat the inverse is an homomorphism.Let range(ψ) := (Vψ, ψOBJ1, ψMAP1), where Vψ := x ∈ V2| there existsexactly one variable y ∈ V1 with ψy = x.

The unification algebras form a category with this notion of homomorphism.There is a final object, which is the trivial unification algebra (∅, a, Id)

We say A1 is embedded in A1 via ψ, iff ψ : A1 → A2 is an injectivehomomorphism.Let A,B be unification algebras, such thatVA = VB,OBJA ⊆ OBJB,MAPA ⊆ MAPB. Then A is called stronglyembedded in B.

Lemma 5.2. Let ψ : A1 → A2 be a homomorphism. Then:DOM(ψσ) ⊆ ψ DOM(σ) for all σ ∈MAP.

Proof. Let x2 ∈ DOM(ψσ). There exists a variable x1 ∈ V1 with ψx1 = x2.Assume x1 6∈DOM(σ). Then σx1 = x1, which implies x2 = ψ(x1) = ψ(σx1) =ψ(σ)ψ(x1) = ψ(σ)x2, which contradicts x2 ∈ DOM(ψσ). Hence x1 ∈ DOM(σ).

ut

Lemma 5.3. A homomorphism ψ : A1 → A2 that is bijective on objects andmappings, is an isomorphism.

Proof. Let ψ− be the inverse mapping of ψ. Condition i) of Definition 5.1is trivially satisfied. In order to prove ii), let σ2, τ2 be mappings in MAP2.There are mappings σ1, τ1 in MAP1 with ψσ1 = σ2 and ψτ1 = τ2. We haveψ−(σ2τ2) = ψ−((ψσ1)ψ(τ1)) = ψ−(ψ(σ1τ1)) = σ1τ1 = ψ−(σ2)ψ−(τ2). A similarcomputation shows that iii) also holds.

We have already V2 ⊆ ψ(V1), since ψ is a homomorphism. We have toshow that V1 ⊆ ψ−(V2). From V2 ⊆ ψ(V1) we get ψ−(V2) ⊆ V1. Assume forcontradiction, that there is a variable x ∈ V1 − ψ−(V2). That means ψx 6∈ V2.Let y be a variable equivalent to x. The mapping σ := x← y must be mappedto Id2, since DOM(ψσ) = V2 ∩ ψx = ∅. Since ψ is a bijection on MAP, thisimplies that σ = Id2, which is a contradiction. Hence V2 = ψ(V1). ut

The next lemma clarifies the effect of homomorphisms on variables.

Lemma 5.4. Let ψ : A1 → A2 be a homomorphism, and let x ∈ V1. Then

i) ψx 6∈ V2 implies that there exists a variable y 6= x with ψx = ψy.ii) If there exists a variable y 6= x with ψx = ψy, then

a) ψ is constant on the set s|x← s ∈ SUB ory ← s ∈ SUB

17

Page 18: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

b) ψx is fixed by every substitution in range(ψ).

Proof. i) Let ψx 6∈ V2. There exists a variable y 6= x that is equivalent to x.Consider the mapping x ← y. Since ψx 6∈ V2, we have DOM(ψ(x ←y) = ∅, hence ψx = ψy.

ii) Let y be a variable with y 6= x and ψx = ψy. Let s be a term such thatx ← s ∈ MAP or y ← s ∈ MAP. Without loss of generality we canassume that x← s ∈MAP. Then ψs = ψ(x← sx) = ψ(x← s)ψx =ψ(x ← s)ψy = ψ(x ← sy) = ψy. This proves part a). Let ψσ be amapping in range(ψ). Then x ← σx ∈ MAP, hence ψσψx = ψσx = ψxdue to a). This proves part b).

utWe give an example, that ψx = ψy for different variables x, y does not

preclude that ψx is a variable in V2. Let A1 be a unification algebra consistingonly of variables. The variables are partitioned in classes Si, i = 1, 2, . . . , suchthat x is equivalent to y, iff they belong to the same class. The mappings inMAP1 are the possible substitutions. Let A2 consist only of variables zi, i =1, 2, . . . that are all equivalent, and of all possible substitutions on these variables.

Let the homomorphism ψ : A1 → A2 be such that ψx = zi, iff x ∈ Si, andall mappings in MAP1 are mapped to the identity. Then ψ is a homomorphismand maps different variables in A1 to the same variable in A2.

Lemma 5.5. Let DOMψ(.) and Vψ(.) be that domain and variable operator,respectively, with respect to range(ψ). Then

i) DOMψ(ψσ) ⊆ ψDOM(σ) ∩Vψ, where Vψ = x ∈ V2| there exists exactlyone variable y ∈ V1 with ψy = x.

ii) Vψ(ψσ) ⊆ ψV(t)

Proof. i) Let σ ∈MAP. Lemma 5.2 shows that DOM(ψσ) ⊆ ψDOM(σ). Letz2 ∈ V2. Then there exists a variable z1 with ψz1 = z2. If there is anothervariable z′1 with ψz′1 = z2, then Lemma 5.4 ii.b) shows that ψσ does notchange z2, hence z2 6∈ DOM(ψσ). This means DOM(ψσ) ⊆ ψDOM(σ) ∩Vψ.

ii) Let x2 ∈ Vψ(ψσ). Then there exists a mapping x2 ← s2 ∈ ψMAP1

with x2 ← s2ψt 6= ψt. Hence there exists a mapping x1 ← s1 withψx1 ← s1 = x2 ← s2 and ψx1 = x2. This means ψx1 ← s1ψt =ψ(x1 ← s1t) 6= ψt, hence x1 ← s1t 6=t. Thus x1 ∈ V(t).

ut

Proposition 5.6. range(ψ) is a unification algebra.

Proof. MON) follows from the definition of a homomorphism and since A1 is aunification algebra.

V1) Let ψσ = ψτ [Vψ]. Lemma 5.4 shows that DOM(ψσ) ⊆ Vψ andDOM(ψτ) ⊆ Vψ. Hence ψσ = ψτ [V2] which implies ψσ = ψτ , since(V2, T2,SUB2) is a unification algebra.

18

Page 19: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

V2) Trivial.V3) Let W2 ⊆ Vψ be a finite set of variables. Since every variable in W2 is

the image of a (unique) variable in V1, there exists a finite set of variablesW1 ⊆ V1 with ψW1 = W2. Let ξ be a variable permutation that renames W1.The image of ξ is also variable-permutation:If DOM(ψξ) 6= ψDOM(ξ), then there exists a component x ← y ofξ such that ψx = ψy, which contradicts W2 ⊆ Vψ. Hence DOM(ψξ) =ψDOM(ξ). Since ψξ has as inverse ψξ−, it is a variable permutation. Nowthe set ψ(ξ)W2 is a set of variables that is disjoint with W2. Hence V3) holds.

V4) follows from Lemma 5.2.V5) follows, since A2 is a unification algebra.

Corollary 5.7. An embedding ψ : A1 → A2 is an isomorphism ψ : A1 →range(ψ).

Proof. Holds, since range(ψ) is a unification algebra by Proposition 5.6 and byLemma 5.3. ut

Definition 5.8. Let A = (V, OBJ,MAP ) be a unification algebra.

i) A equivalence relation ∼ on OBJ is a congruence, iff s ∼ t and σx ∼ τxfor all ∈ V implies σs ∼ τt.

ii) For a congruence ∼ we define the quotient A/∼ as (V∼, T/∼,SUB/∼),where V∼ := x/∼ |x ∈ V and x/∼ ∩V = x. The relation ∼ is extendedto mappings by σ ∼ τ iff σx ∼ τx for all variables x. The operations aredefined as (σ/∼)(τ/∼) := (στ)/∼ and (σ/∼)(τ/∼) := (στ)/∼.

Lemma 5.9. quotients are unification algebras.

Proof. Operations are well-defined: Let σ1 ∼ σ2 and τ1 ∼ τ2. Then we haveσ1τ1x ∼ σ2τ2x for all variables x, hence σ1τ1 ∼ σ2τ2. The other follows from thedefinition of congruence.The proofs are tedious, but exactly analogous to the proofs that show that therange of a homomorphism is a unification algebra, hence we omit them. ut

Proposition 5.10. Let A1 = (V1, T1,SUB1) and A2 = (V2, T2,SUB2) beunification algebras and let ψ : A1 → A2 be a homomorphism.Then the relation ∼ on T1 with s ∼ t :⇔ ψs = ψt is a congruence.Furthermore A1/∼ is isomorphic to range(ψ).

Proof. Let s, t ∈ T with ψs = ψt and let σ, τ ∈ SUB such that ψ(σx) = ψ(τx)for all x ∈ V. Then ψ(σ)(ψx) = ψ(τ)(ψx) for all x ∈ V. Since ψV ⊆ V′, wehave ψ(σ) = ψ(τ), hence ψ(σ)(ψσ) = ψ(τ)(ψt).In order to prove the isomorphism between A1/ ∼ and range(ψ), we have tocheck that ψ is a bijection, which is obvious. Then we can apply Lemma 5.3. ut

There are some natural isomorphisms on unification algebras:

19

Page 20: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Lemma 5.11. Variable permutations provide isomorphisms on unification al-gebras.For a variable permutation ξ, the corresponding isomorphism ϕξ on the unifica-tion algebra operates as follows: ϕξt := ξt for t ∈ OBJ and ϕξσ := ξσξ− forσ ∈MAP .

Lemma 5.12. Let A = (V,OBJ,MAP) be a unification algebra, and let V =V1 ∪ V2 be a partition of V , such that there is a bijection ϕ : V → V1 suchthat ϕx is equivalent to x for all x. Let A0 be the following unification algebra:A0 = (V1, T, σ ∈MAP|DOM(σ) ⊆ V1, then A is embeddable in A0.

Proof. The injective homomorphism ψ : A → A0 is defined as follows: Letψt = ϕt and let ψσ = ϕσϕ−, where ϕ− is the inverse of ϕ. These definitionare not quite correct as they stand. ϕt for example can be seen as the resultof applying the substitution ϕ|V (t) to t. Note that the mapping ϕσϕ− has afinite domain and hence is a mapping in MAP. Now all conditions can be easilyverified. ut

If in the construction above the partition V = V1 ∪ V2 is such that thereis also a bijection ϕ : V → V2, then we will call the unification algebraA0 = (V1, T, σ ∈ SUB | DOM(σ) ⊆ V1 the unification algebra extendedby constants. For these distinguished constants it makes sense to speak of con-stants occurring in a term. Let CONST(t) := VA(t)− V1.The usual notion of unification in the free term algebra as considered in[Sie86,Sie89] and for sorted signatures [Wal88,SS88,SNMG89] is a specializa-tion of unification in a unification algebra extended by free constants.In order to show that minimal representations for usual term unification areexactly minimal sets of unifiers in the usual sense, we use the unification algebraextended by constants. This is the same as viewing the variables in solutions asground and only the new variables in unifiers as variables in which somethingcan be substituted. The same effect can be achieved by adding an infinite set offree constants to a term-algebra.

Lemma 5.13. For a unification algebra extended by constants: σ ≤ τ [W ] isequivalent to σ ⊇W τ , for finite W .

Proof. Let A = (V, T,SUB) be a unification algebra, let V = V0 ∪V1 such thatA0 = (V0, T0,SUB0) has variables V0 and is the unification algebra extendedby constants. Now we refer elements of V1 as constants and to elements of V0 asvariables.Let σ, τ be substitutions with σ ⊇W τ . Without loss of generality we can assumethat DOM(σ) = DOM(τ) ⊆ W and that I(σ) ∩ I(τ) = ∅. Let x1, . . . , xnbe the variables in V(τW ) and let a1, . . . , an be constants not occurring inthe terms of COD(σ) ∪ COD(τ), such that xi is equivalent to ai in A. Thenτgr := xi ← aiτ is an instance of τ ground on W . There exists a substitutionλ, such that λσ is ground on W and λσ = τgr[W ]. Now we switch to A, the largerunification algebra: Then ai ← xi is a substitution in SUB. Applying it to the

20

Page 21: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

equation above gives ai ← xiλσ = ai ← xiτgr = ai ← xixi ← aiτ =τ [W ]. Furthermore ai ← xiλσ = (ai ← xiλ)|I(σ)σ[W ]. The substitution(ai ← xiλ)|I(σ) is in SUB0, hence σ ≤ τ [W ] in A0. ut

Corollary 5.14. For unification in a unification algebra extended by constants:σ ≤ τ [W ] is equivalent to σ ⊇W τ , for every finite set of variables W .

Proof. Follows from 5.13. ut

The following structure theorem holds:

Theorem 5.15. Every unification algebra is isomorphic to T /∼, where T is aset of terms with respect to some order-sorted signature, such that T is closed un-der well-sorted instantiation, T contains all well-sorted terms, but may containalso ill-sorted ones, and ∼ is a stable congruence on T .

Proof. Let A = (V,OBJ,MAP) . Then we construct the signature Σ asfollows:The set of sorts is the set of equivalence classes of variables and the ordering onsorts is [x] v [y], iff y ← x ∈MAP. For every object t ∈ OBJ−V there is afunction symbol ft ∈ Σ. We can assume that the operator V (.) gives a vector ofvariables instead of a set. Then if V (t) = (x1, . . . , xn), the function symbol fthas arity n. For every variable y such that y ← t ∈MAP, there is a functiondeclaration ft : [x1] × . . . × [xn] → [y]. Every variable y is considered to havesort [y] and all greater sorts.Let B0 := (V, T+(Σ,V),SUB(Σ,V)), where SUB(Σ,V) is the set of well-sorted substitutions on (the set of well-sorted terms) T (Σ,V). T+(Σ,V) isV ∪ σft(x1, . . . , xn(t))|σ ∈ SUB(Σ,V), t ∈ OBJ, V (t) = x1, . . . , xn(t). Theset T+(Σ,V) contains T (Σ,V), but is in general not equal to the set of allsyntactic possible terms over Σ.

Let ϕ : B → A be defined as follows:

i) ϕ(x) := x for x ∈ V.ii) ϕft(x1, . . . , xn) := t, where t is an object, and V (t) = (x1, . . . , xn).iii) ϕ(x1 ← y1, . . . , xn ← yn) := x1 ← y1, . . . , xn ← yn for variables xi, yiiv) ϕft(t1, . . . , tn) := x1 ← ϕt1, . . . , xn ← ϕtnt, where t is an object, and

V (t) = (x1, . . . , xn).iv) ϕx1 ← t1, . . . , xn ← tn := x1 ← ϕt1, . . . , xn ← ϕtn.

We have to show that the definition of ϕ makes sense and that ϕ is a homomor-phism.

1) if s is of sort [x], then x← ϕs is a mapping in MAP:

21

Page 22: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Proof. By induction on the term depth.If y is of sort [x], then x← y is in MAP by definition.If s is of sort [x], then s = ft(s1, . . . , sn), and x ← y is in MAP. Bythe definition of T+(Σ,V), si is a term of sort [xi] for all i = 1, . . . , n.By induction hypothesis,xi ← ϕsi is a mapping in MAP for all i =1, . . . , n. Since the union of mappings exists, we have also that σ := x1 ←ϕs1, . . . , xn ← ϕsn is a mapping. Composition and restriction gives thatx ← σt is in MAP. By definition x ← σt = x ← ϕft(s1, . . . , sn) =x← ϕs. ut

2) ϕ is surjective on V,OBJ,MAP:ϕ is obviously surjective on V. ϕ is also surjective on OBJ, since for everyt ∈ OBJ, there exists a term ft(x1, . . . , xn(t)) with ϕft(x1, . . . , xn(t)) = t. Itis surjective on MAP, since for every mapping x1 ← t1, . . . , xn ← tn thereexists terms ϕ−1ti of sort [xi] , such that xi ← ϕ−1ti is a substitution.

3) ϕ is a homomorphism:Definition 5.1.iii holds by the definition of ϕ. That 5.1 iii) can be shown byan easy computation using ϕ(σt) = ϕ(σ)ϕt. Definition of ϕ implies that 5.1iv) holds.

Proposition 5.10 now implies that A is isomorphic to a quotient of B. ut

Note that this structure theorem allows some ill-sorted terms without well-sortedinstances. Such terms could have been also considered as literals. For the sakeof simplicity, we have treated them as ill-sorted terms.

For unsorted unification algebras, from Definition 2.4 and Theorem 5.15 it iseasy to deduce that 5.15 can be sharpened to:

Proposition 5.16. Every unsorted unification algebra is isomorphic to T ∪AT / ∼, where T is a set of terms with respect to some unsorted signature,AT is the set of atoms, and ∼ is a stable congruence on T ∪ AT , such thatterms and atoms are never congruent.

6 Nondeterministic Transformations

In this paragraph we give transformation rules for constructing unification algo-rithms and show that they apply universally.As basic datastructure we use systems of multi-equations Γ , where Γ isa multiset Mi|i ∈ I, Mi are multisets of objects in OBJ also called multi-equations, such that V(Γ ) is finite. The set of solutions of Γ is denotedby SOL(Γ ) is the set of substitutions ground on V(Γ ), such that for everyσ ∈ SOL(Γ ), M ∈ Γ and for all s, t ∈ M we have σs = σt. Every unificationproblem Γ can be considered as a system of multi-equations. Let V AR(Γ ) bethe set of variables that occur as elements in some multi-equation in Γ and letOBJ(Γ ) be the set of nonvariable objects that occur in some multi-equationfrom Γ .Multisets [DM79] are like sets but allow multiple occurrences of the same ele-ment. We use the set-theoretic operators ∪,∩,−,∈ for multisets in their obvious

22

Page 23: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

meaning.We compare two sets of solutions as follows: S1 ⊆ WS2, iff S1|W ⊆ S2|W andS1 =WS2 iff S1 ⊆WS2 and S1 ⊇WS2.Assume given a unification problem Γ0 for which we want to know all solutions.Since in general there is an infinite number of such solutions it is useful eitherto have a finite representation for all solutions or at least to compute furtherconstraints on the solutions. We use the method of applying transformations tomulti-equation systems. Such a transformation is denoted as Γ ⇒W ∆, whereΓ,∆ are systems of multi-equations and W is a finite set of variables. In the fol-lowing we give rules that specify classes of transformations. We will define solvedforms of multi-equations. As solution for a system Γ we will accept a transforma-tion Γ ⇒V (Γ ) ∆, where∆ is a system in solved form with SOL(Γ ) =W SOL(∆).Usually, a set of solved forms may be necessary to represent the solutions of Γadequately.

Definition 6.1. We say a specific transformation Γ ⇒W ∆ is complete, iffSOL(Γ ) =W SOL(∆).We say a rule is complete, iff every application provides a complete transforma-tion.

Obviously, the application of transformations is transitive: If Γ1 ⇒W Γ2 iscomplete and Γ2 ⇒W Γ3 is complete, then Γ1 ⇒W Γ3 is complete.

We use the following conventions for denoting the rules:⇒W denotes the transformation relation with respect to W .M denotes a multi-equation and Γ denotes a system of multi-equations.

Definition 6.2.The basic rule set BRS is defined as follows:Rule: Equal objects. M ∪ Γ ⇒W M − s ∪ Γif M contains s more than once.

Rule: Trivial multi-equation. Γ ⇒Γ −M,if M is a singleton.

Rule: Merging. M1 ∪ M2 ∪ Γ ⇒W M1 ∪M2 ∪ Γ ,if M1 ∩M2 6= ∅

Rule: Auxiliary variables M ∪ Γ ⇒W M − x ∪ Γ ,if x is a variable with x 6∈ W and x does nor occur elsewhere in Γ and M andthere exists a term t ∈M − x, such that x← t ∈MAP.

Rule: Unfolding. t ∪M ∪ Γ ⇒W s ∪M ∪ Γ ∪ 〈τ〉if τs = t and V(s) consists of new variables, DOM(τ) = V(s), andDOM(τ) ∩ I(τ) = ∅.

23

Page 24: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Rule: Replacement.s2 ∪M2 ∪ s1, t1 ∪M1 ⇒W x← t1s ∪M2 ∪ s1, t1 ∪ M1if s is an object, x a variable,x← s1 a mapping, such that x← s1s = s2

Rule: Application of substitution:x, t ∪M ∪ Γ ⇒W x, t ∪M ∪ x← tΓ ,if x← t ∈MAP.

Rule: Partial solution. Γ1 ∪∆⇒ Γ2 ∪∆if Γ1 ⇒V (Γ1) Γ2 is complete and all variables in V (Γ2)−V (Γ1) are new variables.

Theorem 6.3. All the rules in BRS are complete.

Proof. The completeness of the equal-objects rules, the trivial multi-equationsrule and the merging rule is trivial.Auxiliary variables :Obviously SOL(M ∪ Γ,W ) ⊆W SOL(M − x ∪ Γ ). Let σ ∈ SOL(M −x ∪ Γ ). Without loss of generality we can assume that x 6∈ DOM(σ). Let tbe the term in M − x such that x ← t ∈ MAP. Construct σ′ such thatDOM(σ′) = DOM(σ) ∪ x, σ′ = σ[DOM(σ)] and σ′x := σt. Then σ′ is amapping, since x ← σt = (σx ← t)|x. σ′ is also a solution of M ∪ Γwith σ = σ′[W ], since x 6∈W .Unfolding:Let σ be a solution of t ∪ M ∪ Γ with DOM(σ) ⊆ V(t ∪ M ∪ Γ ).Then στ is a solution of s ∪ M ∪ Γ ∪ 〈τ〉: we have στs = σt, and σ =στ [V(t ∪M ∪ Γ )], hence στ solves s ∪M ∪ Γ . For x ∈ DOM(τ) wehave στ(τx) = σ(ττ)x = στx, hence στ solves 〈τ〉.Let σ be a solution of s∪M∪Γ ∪〈τ〉. Then σx = στx for all x ∈ DOM(τ),hence σs = στs = σt.Replacement:We can assume that x ∈ V(s). Let σ be a solution of s2∪M2∪s1, t1∪M1. Then σs1 = σt1, hence σx ← t1s = σx ← s1s = σs2. This shows onedirection, the other direction is a symmetric case.Application of substitution:Follows from repeated application of the replacement rule.Partial solution: If Γ1 ⇒V(Γ1) Γ2 is complete and all variables in V(Γ2)−V(Γ1)are new variables.Let σ be a solution of Γ1 ∪ ∆. Since Γ1 ⇒V(Γ1) Γ2 is complete, there exists asolution τ of Γ2 with σ = τ [V(Γ1)]. Since DOM(σ) ∩DOM(τ) = V(Γ1), wecan define θ := τ ∪ σ. Obviously, this is a solution of Γ2 ∪∆.Let σ be a solution of Γ2 ∪ ∆. Since Γ1 ⇒V(Γ1) Γ2 is complete, there exists asolution τ of Γ1 with σ = τ [V(Γ1)]. Since DOM(σ) ∩DOM(τ) = V(Γ1), wecan define θ := τ ∪ σ.Obviously, this is a solution of Γ1 ∪∆. ut

24

Page 25: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Proposition 6.4. The equal terms rule, the trivial multi-equations rule and themerging rule can be applied only a finite number of times.

Proof. Obvious, since the number of multi-equations and the number of termsin Γ is decreased. ut

A system of multi-equations, where none of the rules ’equal terms’, ’Trivial multi-equations’ and merging can be applied, is called merged.This generally applicable rules have the practical advantage that a unificationalgorithm can solve partially a unification problem and that the variables intro-duced by unifiers may contain some “old” variables.To obtain a similar proof for this fact within the framework of [Gog88] wouldbe hard, since his substitution systems behave as if all codomains are renamedaway.

Definition 6.5. Let Γ be a system of multi-equations.A set of pairs (xi, ti)|i = 1, . . . , n is called a cycle, iff xi, ti are in the samemulti-equation of Γ , where the x′is are variables and the t′is are nonvariableobjects, and xi ∈ V (ti+1) for i = 1, . . . , n− 1 and xn ∈ V (t1).

Definition 6.6. Let Γ be a merged system of multi-equations.

i) a multi-equation M is in solved form, iff M contains a term t, such thatM − t is a set of variables x1, . . . , xn (t maybe a variable), such thatτM := x1 ← t, . . . , xn ← t is a mapping and V(t) ∩V(M − t) = ∅.

ii) Γ is called solved, if every multi-equation M in Γ is in solved form and Γcontains no cycles.

Proposition 6.7. Every solved system is solvable and has a unitary represen-tation.

Proof. Let Γ be sequentially solved system. We partition every multi-equationMi into Mi := Mi0ti, where Mi0 is a multiset of variables, such that x← tis a substitution for every x ∈Mi0.We can assume that in the case that ti is a variable, the variables Mi0 do notoccur elsewhere in Γ (by applying the appropriate substitution).We introduce a transitive ordering < on multi-sets generated by the pairsMi < Mj , iff Mi0 ∩ V (tj) 6= ∅.This ordering is cycle-free, since Γ contains no cycles.Let Mi be minimal with respect to this ordering and let Mj be direct suc-cessor of Mi, then by applying the substitution x1 ← ti, . . . , xn ← t forMi0 = x1, . . . , xn, we obtain a system Γ ′ that is smaller in the sense thatthere is a smaller number of generating pairs for the ordering. Note that theapplication has an effect only on the terms tk and that Γ ′ is a solved system.Hence Γ can be brought into a form such that it is solved and the ordering < isempty.Now the substitution σ that represents all solutions is the union of all substitu-tions for every multi-equation.

25

Page 26: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

It remains to show that this substitution is indeed a representation.Assume there is a solution θ of (Γ,W ). Then θσ = θ : Consider an Mi =Mi0 ∪ ti and x ∈Mi0.Then θσx = θti by definition of σ and θti = θx since θ is a solution. For variablesy ∈ V (ti) we have θσy = θy, since y 6∈ DOM(σ).Let λ be such that λσ is ground on V (Γ ) ∪W . Then λσ is a solution, since forx, y ∈Mi0 we have λσx = λσy, since σx = σy. Furthermore we have λσx = λtiby definition of σ and λσti = λti, since DOM(σ) ∩ V (ti) = ∅. ut

A unification algorithm can now be described as a set of rules that describetransformations of equation systems. These rules are in general considered asnondeterministic, where the nondeterminism has two instances: “don’t-know”and “don’t care” nondeterminism. “Don’t know” means that we have to choosebetween several alternatives and that for a complete algorithm, all alternativeshave to be explored, whereas “don’t care” means that we can choose onealternative and forget the other without loosing completeness.We haven’t said what completeness means:

A unification algorithm is complete, ifffor every Γ and every solution σ of Γ , there exists a system of multi-equations∆ that can be reached from Γ using correct transformations specified by thealgorithm, the transformations are with respect to V (Γ ), ∆ is in solved form,and σ is a solution of ∆.

Given a system of multi-equations Γ , every complete unification algorithmcan be used to enumerate a set of representatives for Γ , if a breadth-first-likemethod is exploited to search for all reachable solved systems.

The advantage of describing an algorithm by nondeterministic rules overa description using a disjunction of systems of multi-equations is that for thenondeterministic approach it is easier to handle cases, where an infinite set ofalternatives has to be explored.

In order to handle such sets of alternatives, we introduce the notion of acomplete sets of alternatives:

Definition 6.8. Let Γ, Γi, i ∈ I be systems of multi-equations and let W be aset of variables, such that Γ ⇒W Γi is a correct transformation for all i ∈ I.Then Γ ⇒W Γi|i ∈ I is a complete set of alternatives, iff

SOL(Γ ) =W

⋃SOL(Γi)|i ∈ I.

Complete sets of alternatives can be combined:

Lemma 6.9. If Γ ⇒W Γi|i ∈ I and Γi0 ⇒W ∆j |j ∈ J are complete sets ofalternatives, where i0 ∈ I ,then also Γ ⇒W Γi|i ∈ I−i0∪Γ ⇒W ∆j |j ∈ Jis a complete set of alternatives.

On the basis of a complete (nondeterministic) algorithm Ssing for solving theequation s = t, i.e., for solving systems s, t it is easy to construct a complete

26

Page 27: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

algorithm for arbitrary systems of equations Γ . For this purpose we can assume(w.l.o.g.) that Γ is a system of multi-equations, where every multi-equationcontains exactly two terms. Furthermore we can assume that Ssing has asresult a system 〈τ〉 that comes from a unifier τ with DOM(τ) ⊆ V (s, t) andV COD(τ) consists only of new variables.The algorithm Ssing works as follows:

Input: Γ∆ := ∅while Γ 6= ∅ do

Let s, t be a multi-equation in Γ .Let σs,t be some output of Ssing(s, t)Let ∆ := ∆ ∪ 〈σs,t〉 and let Γ := σs,t(Γ − s, t)

endwhileOutput: ∆

Proposition 6.10. Given a complete algorithm Ssing for single equations, thealgorithm Ssys is a complete unification algorithm for systems of equations.

Proof. Obviously, Ssys terminates, since Γ is reduced in every step. Furthermore,∆ is solved, since it has no cycles due to the condition that σs,t introduces onlynew variables.The completeness is shown by induction.Let θ be a solution of Γ . Since Ssing(s, t) is complete, there is a nondeterministicexecution of Ssing, such that σs,t is the output, such that there is a solution θ′ of〈σs,t〉 and θ = θ[V (s, t)]. Theorem 6.3 shows that application of σs,t is a completestep. Hence no solution is lost. ut

Now we consider solution methods for strongly embedded unification alge-bras. Note that the notion of strong embedding can be applied to the embeddingof the theory of AC into AC1 [HS87], for restricted unification and matching[BHMS87,Bur86] and for unification in sorted equational theories as consideredin [SS88,SS86a].

Lemma 6.11. If A is strongly embedded in B, then for all equation systems Γcontaining only objects from A : SOLA(Γ ) = SOLB(Γ ) ∩MAPA.

Let A be strongly embedded in B, and let Γ be an equation systems containingonly objects from A.Suppose, there is a complete algorithm SB for solving equation systems in B anda complete algorithm WB→A that takes a mapping in MAPB and generates aninstance in MAPA. Then we can use the combined algorithm WB→A SB asunification algorithm for A. WB→A SB works as follows: first it computes aunifier with respect to B and afterwards instantiates it such that the instance isan A-mapping. We give a condition for completeness of WB→A SB.We say the “weakening-algorithm”WB→A is A−B−complete, iff the followingholds: for input σ, and every B-instance θ ∈ MAPA , it can generate a B-instance τ of σ, such that τ ∈MAPA and θ is a MAPA-instance of τ .

27

Page 28: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Theorem 6.12. Under the conditions above, and if WB→A is A−B-complete,then WB→A SB is a complete unification algorithm for A.

Proof. Let Γ be a system of equations with respect to A, and let θ ∈ SOLA(Γ ).Then θ ∈ SOLB(Γ ) and SB gives a B-unifier σ, such that θ is a B-instance ofσ. WB→A now generates a B-instance τ of σ with τ ∈MAPA, such that θ is aA-instance of τ . Hence WB→A SB is complete. ut

The hard part for such a strong embedding is to show that there exists such anA−B-complete weakening algorithm. Once this is shown, we can apply Theorem6.12. Such A−B-complete weakening algorithms exist for the embedding of ACinto AC1, for the case of restricted unification, and for unification in some specialsorted equational theories.

7 Unification Algebras with Dimension

In this section we assume that all equation systems have only multi-equationswith exactly two elements.

We define the rank of a system of equations Γ as the number of equa-tions in it and denote it by |Γ | [LMM87]. The number of variables in Γ isdenoted by |V (Γ )|.A single equation s = t in Γ is redundant, iff SOL(Γ ) = SOL(Γ ) − s =t[V (Γ )]. A system of equations Γ is called redundant, iff it contains aredundant equation, otherwise it is called irredundant.

Definition 7.1. We say a unification algebra A has a (linear) dimension,iff for every solvable system of equations Γ : |Γ | > |V (Γ )| implies that Γ isredundant.As extension we say a unification algebra A has a f(n)-dimension, iff for everysolvable system of equations Γ : |Γ | > f(|V (Γ )|) implies that Γ is redundant.

Abelian groups [LBB84], the empty theory [Rob65,LMM87] and vectorspaces have a dimension (as defined above). Below we will show that Abeliansemigroups and Abelian monoids also have a dimension.The theory of associativity with only axiom f(x, f(y, z)) = f(f(x, y), z) doesnot have a linear dimension: Consider the system 〈abx = xba, abax = xaba〉,which has only x ← aba as solution, but the first equation has also x ← aas solution, which is not a solution to the second one, and the second one hasx← abaaba as solution, which in turn is not a solution to the first one.The theory of commutativity with only axiom f(x, y) = f(y, x) doesnot have a linear dimension: Consider the system 〈f(f(x, x), f(a, b)) =f(f(x, a), f(x, b)), f(f(x, x), f(b, c)) = f(f(x, b), f(x, c))〉, which has only x = bas solution, but the first equation has as solutions:x ← a, x ← b and thesecond equation has as solutions: x← b, x← c.The theory of Boolean rings does not have an n-dimension for the function n: the

28

Page 29: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

proposition below shows, that f(n) is exactly 2kn − 1, where k is the number offree constants in the signature, since unification in Boolean algebras is a specialcase of solving equations in a term algebra generated by a primal, finite algebra.

More generally, if we consider unification in primal algebras [BS81,Nip90]we have the following:

Proposition 7.2. If A is the term algebra generated by a finite algebra A with|A| ≥ 2, then the corresponding dimension function f(n) is |A|n − 1, whichcan easily be verified. If A is in addition primal, then the dimension function isexactly |A|n − 1.

Proof. Let Γ be an irredundant, solvable system of equations with |V (Γ |) = n.Then there are at most |A|n possible different solutions to |Γ |. The possible so-lutions can be seen as vectors of length n over A. The difference An − SOL(Γ )is the same as

⋃An − SOL(si = ti)|si, ti ∈ Γ.

Furthermore, the set An−SOL(Γ ) is not empty. Were there more than |A|n−1different equations in Γ , then one set in the union above is redundant, henceone equation is redundant.If A is primal, then every function is a term. This means that for two elements0, 1 in A we can construct the following terms: a (ground) term t0 that is equalto 0 (and contains at most one variable), and terms tv, where v is a vector inAn, such that tv(w) = 0 for v 6= w and tv(v) = 1.The system Γ := t0, tv|v ∈ An − (0, . . . , 0) contains no redundant equa-tion, has at most n variables in V (Γ ) and Γ contains |A|n − 1 equations. ut

Proposition 7.3. Let A be a unification algebra with dimension. Let Γ be asolvable system of equations, such that |Γ | > |V (Γ )|. Then there are at least|Γ | − |V (Γ )| redundant equations in Γ .

Recall that A is called strongly embedded in B, iff VA = VB,OBJA ⊆ OBJBand MAPA ⊆MAPB.

Lemma 7.4. If A is strongly embedded in B, then for all equation systems Γ :SOLA(Γ ) = SOLB(Γ ) ∩MAPA.

Lemma 7.5. Let A,B be unification algebras, such that A is strongly embeddedin B.Then: If B has a dimension, then A has a dimension.

Proof. Let Γ be an equation system containing only objects from OBJA, suchthat Γ is solvable with respect to A and let |Γ | > |V (Γ )|. Then Γ is alsosolvable with respect to B. Hence there exists a proper subsystem Γ ′ of Γ ,such that SOLB(Γ ′) = SOLB(Γ )[V (Γ )]. By Lemma 7.4 we have SOLA(Γ ′) =SOLB(Γ ′)∩MAPA and SOLA(Γ ) = SOLB(Γ )∩MAPA. Hence SOLA(Γ ′) =SOLA(Γ )[V (Γ )]. This means that Γ is redundant. ut

We can give a sufficient criterion for A has a dimension:

29

Page 30: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Theorem 7.6. Let A be unitary. If for every equation s = t there exists a mostgeneral unifier σ with |V COD(σ)| < |V (s, t)|, then A has a dimension.

Proof. Let Γ := 〈s1 = t1, . . . , sn = tn〉 be a solvable system of equations with|V (s1, t1, . . . , sn, tn)| < n.If n = 1, then |V (s1, t1)| = 0, hence s1 = t1 holds and 〈s1 = t1〉 is redundant.In order to prove the induction step, first assume that s1 = t1 is not redundant,otherwise we are ready. Let σ be a most general unifier of s1 = t1 that introducesonly new variables and less than |V (s1, t1)|. Then the system 〈σ〉 ∪ 〈σs2 =σt2, . . . , σsn = σtn〉 is equivalent to Γ due to Theorem 6.3 on the variablesV (Γ ). The induction hypothesis applies to 〈σs2 = σt2, . . . , σsn = σtn〉, since|〈σs2 = σt2, . . . , σsn = σtn〉| < n−1. This yields that one equation is redundant,say σsj = σtj . But then sj = tj is redundant in Γ . ut

Theorem 7.7. Let A be unitary such that for every equation s = t there existsa most general unifier σ with |V COD(σ)| < |V (s, t)|. Let Γ be a solvable, irre-dundant system of equations.Then there exists a most general unifier σ of Γ such that |V COD(σ)| <|V (Γ )| − |Γ | − 1.

Proof. Let Γ := 〈s1 = t1, . . . , sn = tn〉 be a solvable, irredundant system ofequations.Consider one step of solving this system sequentially. A general situation is that〈τ〉 ∪ 〈s1 = t1, . . . , sn = tn〉 has to be solved.Let σ be a most general unifier of s1 = t1 that introduces only new variablesand less than |V (s1, t1)|. Then the system 〈στ〉 ∪ 〈σs2 = σt2, . . . , σsn = σtn〉 isequivalent to Γ due to Theorem 6.3 on the variables V (Γ ). Obviously, |V (〈σs2 =σt2, . . . , σsn = σtn〉 ∪ V COD(στ)| < |V (Γ )|.Since no equation in Γ is redundant, the same holds for the derived system,and hence every step reduces the number of variables by 1. Thus the equation|V COD(σ)| < |V (Γ )| − |Γ | − 1 holds for the finally constructed most generalunifier σ of Γ . ut

Proposition 7.8. Abelian monoids and Abelian semigroups have a dimension.

Proof. Follows, since Abelian monoids and Abelian semigroups can be stronglyembedded into Abelian groups, and Abelian groups have a dimension [LBB84].

ut

As mentioned above, the theories of associativity and commutativity don’t havea linear dimension. However, a defect lemma holds for both theories, stating thatfor every Γ there exists a complete set of unifiers that use at most |V (Γ )| − 1variables in their codomains. Similarly, for Boolean rings it is well-known thatthe most general unifier requires at most |V (Γ )| variables in its codomain. Nev-ertheless, the impact of such a defect to the redundancy of systems of equationsis unclear and should be investigated in the future.

30

Page 31: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

8 Minimal and Optimal Representations

Unification theory has as an important notion the definition of what it meansfor a complete set to be minimal, and a unification hierarchy for equationaltheories depending on the existence and cardinality of minimal complete sets. Weshow that for unification algebras extended by constants such a usual notion isavailable, i.e. in particular for term algebras. Furthermore some counterexamplesare given that in the general case there is no satisfactory definition of minimality.

Definition 8.1. Let cU be a representation of solutions of the unification prob-lem Γ .

i) We say cU is in addition minimal, iff no proper subset of cU is complete.ii) Let U1 and U2 be minimal representations.

Then U1 is more general than U2 (modulo V (Γ )), iff ∀σ ∈ U2 ∃τ ∈U1 andτ ⊇V (|Γ ) σ.We say U1 is properly more general than U2, if U2 is not more generalthan U1.We say U1 and U2 are equivalent representations, iff U1 is more generalthan U2 and vice versa.

iii) A minimal representation cU is in addition an optimal representation, iffthere is no properly more general minimal representation.

iv) A unifier σ is maximal, if for every unifier τ with τ ⊇V (|Γ ) σ. we have alsoσ ⊇V (|Γ ) τ

In several theories and fields one has a measure for the set of solutions. Forexample for linear systems of equations of a field the set of solution is a vectorspace and has a dimension. A translation of this in terms of unification theorywould be the number of variables (or parameters) in the codomain of a a com-plete representation. There are a lot of interesting theories where the number ofparameters depends in a fixed way from the number of variables in the problem.For Boolean rings, Abelian groups, the empty theory and linear equations thenumber of parameters is not greater than the number of variables in the originalproblem. In [LMM87] such a notion of dimension is considered for the free termalgebra.

Lemma 8.2. Let U be an minimal representation of the solutions of Γ . Then Uis optimal iff there is no other properly (not necessarily minimal) more generalrepresentation.

Proof.”⇐” is trivial.”⇒”: Let U be an optimal representation and let U0 be a representation that

is properly more general than U . Since U0 is properly more general, thereexists a substitution τ ∈ U0, such that σ ⊇V (Γ ) τ is false for all σ ∈ U .On the other hand there exists a σ0 ∈ U , such that σ0 ⊆V (Γ ) τ . Let U ′ :=(U −σ0)∪t. This is a representation that is properly more general thanU . Let U ′′ := U ′−λ ∈ U |λ ⊆V (Γ ) τ. This is a minimal representation thatis properly more general than U , which is a contradiction.

ut

31

Page 32: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Lemma 8.3. Let U be an minimal representation of the solutions of Γ . ThenU is optimal iff it consists only of maximal unifiers.

Proof.”⇒”: Let U be optimal and let σ be a unifier in U that is not maximal.Then there exists a unifier τ such that τ ⊇V (Γ ) σ but not σ ⊇V (Γ ) τ . LetU ′ be (U − σ) ∪ τ. Then U ′ is a properly more general representation,a contradiction to Lemma 8.2.

”⇐”: trivial.ut

We show below that for sets of unifiers in term algebras modulo an equationaltheory the two notions collapse to the notion of minimality with respect tounification in term algebras. Hence we can use the usual examples to show thatminimal and optimal sets may not exist [FH83].In general, minimal sets of unifiers are not elementwise equivalent nor have afixed cardinality, since for example the set of all ground solutions is minimal inthis sense. Unfortunately, the same holds for optimal sets of unifiers, as the nextexample shows.

Example 8.4. The following part of the constructions is always the same in thefour parts of this lemma.We construct a term-algebra, such that the initial algebra consists of the set ofnaturals IN including zero. There is a unary function symbol f with f(0) = 0and f(n) = 1 for all n ≥ 1. Let IP := n ∈ IN|n ≥ 1.For every example we select a fixed set S of subsets of IP, such that for everyA ∈ S there is a unary function symbol gA, such that gA(IN) = A and such that⋃S = IP. We assume that an appropriate set of ground equations is given.

The unification problem is 〈f(x) = 1〉, which has as solution the set x← n|n ∈IP.It is obvious that every maximal unifier has the form x ← gA(y). Now theproblem to find optimal sets is equivalent to find “optimal” coverings of IP usingsets in S. So in the following we give only the set-theoretic part of the arguments

i) Optimal representations of the same size may be incomparable.Let S := IP− 1, IP− 2, IP− 3.Then IP − 1 ∪ IP − 2 = IP − 1 ∪ IP − 3 = IP, but the coverings arenot comparable.

ii) There exists a unification problem such that for every n = 2, 3, . . . and evenfor n =∞ there exist optimal representations.Let the following sets be in S:a) Every set 2n− 1, 2n for n ≥ 1.b) Every set 2n ∪ k|k ≥ 2n+ 1 and k is odd for n ≥ 1.c) Every set 2n− 1 ∪ k|k ≥ 2n+ 2 and k is even for n ≥ 1.

These sets are all maximal in the sense that they cannot be compared by ⊆.The finite coverings of IP are:For every m ≥ 2 we have the covering f IP with m elements from SThe m−2 smallest sets of a), 2m−2)∪k|k ≥ 2m−1) and k is odd and

32

Page 33: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

2m− 3 ∪ k|k ≥ 2m and k is even.For the infinite covering take all sets of type a).

iii) There may exist a Γ with a minimal representation consisting of two ele-ments. But no optimal representation exists.Let S consist of the following sets:a) The set of positive odd numbersb) for n ≥ 1 the sets An := k|1 ≤ k ≤ 2n− 1 ∪ k ∈ IP|k is even .Then the sets An are an ascending chain with respect to ⊆ without maximalelement in S. There is no optimal covering, since the sets An are necessary,but not maximal. A minimal complete covering of cardinality 2 is A1 andthe odd numbers.

Lemma 8.5. For a unitary unification problem, all optimal representations areequivalent.

Proof. Trivial. ut

In the following we show that for unification in unification algebras extendedby free constants (in particular in free term algebras) the notion of minimalrepresentation and optimal representation are the same and that all minimalsets are equivalent [FH83].

Theorem 8.6. Let A be a unification algebra extended by constants and let Γbe a unification problem

i) Every minimal representation is optimal.ii) All minimal representations are equivalent and of the same cardinality.

Proof. Follows by standard arguments [FH83]. ut

Now we can define a special unification type (extended by constants), whichcorresponds exactly to the usual one: [Sie75,Sie89].

Definition 8.7. Let A be a unification algebra extended by constants.

i) Let Γ be a solvable unification problem .Γ is called unitary, if an optimal representation exists that is a singleton.Γ is called finitary, if a finite optimal representation exists.Γ is called infinitary, if an infinite optimal representation exists.Γ is called nullary, if no optimal representation exists.

ii) A is called unification based, iff no solvable Γ is nullaryA is called unitary, if all solvable Γ are unitary.A is called finitary, if all solvable Γ are finitary.A is called infinitary, if A is unification based and some Γ is infinitary.A is called nullary, if some Γ is nullary.

33

Page 34: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

9 Classes of Unification Algebras:How to Obtain the Martelli-Montanari Algorithm

In this section we investigate some classes of unification algebras and give uni-fication procedures for these classes. In particular we show how an algorithmin the Martelli-Montanari style can be used for solving unification problems inunification algebras corresponding to free term algebras and the term algebra ofrational terms.The first part is a preliminary and provides the required notions and some con-nections between them. Throughout the whole section we assume that unificationalgebras are unsorted and nontrivial and that TERM = OBJ, hence we canspeak of terms instead of objects.

9.1 Properties of Unification Algebras.

In the following we define some typical properties of free term algebras and showhow to use them to construct complete unification steps.

Definition 9.1. Let A = (V,T,SUB) be a unification algebra.

i) A term t ∈ T is Ω-free, iff for all s, t ∈ SUB : σt = τt⇒ σ = τ [V(t)].ii) A unification algebra A is Ω-free, iff all terms are Ω-free.iii) A unification algebra A is decomposable, if for all nonvariable objects s, t :

if 〈s = t〉 is solvable, then there exists a nonvariable object r and σ, τ ∈ SUB,such that σr = s and τr = t.

An Ω-free term algebra [Sza82] (see also [BHMS87]) and in particular the freeterm-algebra are Ω-free in this sense.

We need a notion of subterms in order to characterize properties of unifi-cation algebras.

Definition 9.2. A term s is a subterm of t, if there exists a nonvariable termr, such that x ∈ V (r) and x← sr = t.We denote this by s sub t.

Definition 9.3. Let A be a unification algebra.

i) A is called subterm-cycle-free, if sub does not contain cycles.ii) A is called subterm-finite, if every term contains at most finitely many

subterms.Accordingly we say a term t is subterm-finite, if t has a finite number ofsubterms.

iii) A is called collapsing, iff there is a nonvariable term t with x ∈ V(t) and aterm s such that x← st is a variable. Otherwise A is called collapse-free.

iv) A is called regular, iff for all σ ∈ SUB and all t ∈ T : V(σt) =∪V(σx)|x ∈ V(t).

34

Page 35: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

If we consider usual term algebras modulo an equational theory, then we havethe following analogies. A simple theory has a subterm-cycle-free term-algebraas unification algebra. However, simplicity depends not only on the “structure”of the equational theory, but also on the signature. An almost collapse-freetheory has a collapse-free term-algebra (modulo theory) as unification algebra,and vice versa. Regular equational theories provide regular unification algebras,but since regularity of equational theory depends also on syntax, there areexamples of nonregular equational theories, which provide regular unificationalgebras. An example is the theory axiomatized by E := f(x, y) = f(x, z).This theory is not regular. However, the provided unification algebra is regular,since y does not count as variable in f(x y) due to our definition.

We investigate some properties of the subterm relation.

Lemma 9.4. i) In Definition 9.2, we can assume that x is a new variable.ii) x ∈ V (t)⇒ x sub t

Proof. i) Let x← sr = t. Then with a new variable x′, we have x← sr =x← sx′ ← xx← x′r = t . The term r′ = x← x′r is not a variable,furthermore x′ ∈ V (r′). Hence x′ ← sr′ = t

ii) If x ∈ V (t), we have x′ ← xx′ ← xt = t, where x′ is a new variable andt′ := x′ ← xt is a nonvariable term with x′ ∈ V (t′).

ut

The converse of Lemma 9.4ii) may be false:Consider the theory E := f(x, x) = a. Then V (f(x, y)) = x, y. Thus x ←yf(x, y) = a. This means y sub a, but y 6∈ V (a).

Lemma 9.5. Let A be a regular, collapse-free unification algebra. Then

i) s sub t⇒ V (s) ⊆ V (t)ii) s sub t iff x ∈ V (t).iii) the relation sub is transitive.iv) s sub t⇒ σs sub σt

Proof. i) Holds, since A is regular.ii) If x ∈ V (t), then x′ ← x(x← x′t) = t, where x′ is a new variable, hence

x sub t. The other direction follows from i)iii) Let r sub s sub t. There exist terms r′, s′, with x ∈ V (r′) and y ∈ V (s′)

such that x ← rr′ = s and y ← ss′ = t. We can assume that x andy are new variables. We have x ← ry ← r′s′ = y ← x ← rr′s′ =y ← ss′ = t. Since A is regular, x ∈ V (y ← r′s′), and since A iscollapse-free,y ← r′s′ is not a variable. Hence r sub t.

iv) s sub t means x ← ss′ = t for some s′ with x ∈ V (s′). We can assumethat x is a new variable. We can assume that DOM(σ) ⊆ V (t), due to i).Applying σ gives σt = σx← ss′ = (σx← σs)s′ = x← σs(σs′). SinceA is regular x ∈ V (σs′), and since A is collapse-free σs′ is not a variable,thus σs is a subterm of σt.

ut

35

Page 36: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Example 9.6. i) The relation sub may be transitive for a nonregular unificationalgebra: An example is the theory E := f(x a) = f(a x) = b.

ii) Consider the theory E axiomatized by E = f(f(x)) = x. The theory E isregular,Ω-free, decomposable, subterm-finite, and collapsing. In this theory,terms are equal, iff they contain the same variable and the same number off ′s modulo 2. Ω-freeness holds since f(s) =E f(t) implies that the numberof f ′s in s and t is equal modulo 2. E is decomposable, since every term isan instance of f(x). The relation sub is not transitive: We have f(x) sub xsub f(x), but not f(x) sub f(x), since y ← f(x)t = f(x) with y ∈ V (t)implies t = y.

Lemma 9.7. A is regular, iff for all x← s ∈ SUB, t ∈ T with x ∈ V(t):V(x← st) = (V(t)− x) ∪V(s).

Proof. Follows by a renaming technique. Rename all variables in I(σ) by newvariables. Then the renamed σ is a product of its components. Use induction onthe number of components. ut

Lemma 9.8. Every Ω-free theory is also regular.

Proof. Suppose there is a σ ∈ SUB and a t ∈ T such that V (σt) ⊂⋃V(σx)|x ∈

V(t).Let y be a variable in

⋃V(σx)|x ∈ V(t) − V(σt). Let x and z be two new

different variables, such that y ← x and y ← z are substitutions. Theny ← xσt = y ← zσt , since y is not a variable in σt. Since A is Ω-free, weget y ← xσ = y ← zσ[V(t)]. This is not possible due to Lemma 4.12. Wehave reached a contradiction. ut

Lemma 9.9. Let A be an Ω-free unification algebra.Then for variables x, y, nonvariable terms s, t with x ∈ V(t): the collapse-equation x← st = y implies that V(t) = x,V(s) = y and s 6= y.

Proof. Assume V(t) ⊂ x. Since A is regular by Lemma 9.8, V(t) = x, y.Now y ← tx ← st = IDT t, hence by Ω-freeness, we have y ← tx ←s = IDT [x, y], and finally the contradiction t = y. We conclude V(t) = x.V(s) = y holds, since A is regular.Assume for contradiction that s = y. Then x ← yt = y. If y 6∈ V(t), thenx = y ← xx ← yt = t, which is not possible. If y ∈ V(t), we get the samecontradiction as above. ut

Lemma 9.10. If A is Ω-free and subterm-cycle-free, then A is collapse-free.

Proof. Assume, A is not collapse-free. Then there exists a term s and a non-variable term t with x ∈ V(t), such that x ← st = y for some variable y.If y 6∈ V(x ← st), then all terms in A are equal, which contradicts our as-sumption that A is nontrivial. Hence y ∈ V (x ← st). Lemma 9.9 shows thatV(t) = x,V(s) = y and s 6= y. Now y ← tx ← st = y ← ty = t andy ← tx ← st = x ← y ← tst imply that y ← ts is a subterm of t.Since s is not a variable, we have t sub y ← ts sub t, which is a cycle in thesubterm relation. This contradicts our assumption. ut

36

Page 37: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Lemma 9.11. Let A be Ω-free and subterm-cycle-free. Then for equivalentterms s, t there always exists a renaming ρ with ρs = t.

Proof. There exists σ, τ with DOM(σ) = V(s),DOM(τ) = V(t) and σs = tand τt = s. Hence στt = t and τσs = s. Ω-freeness implies στ = IDA[V(t)] andτσ = IDA[V(s)]. SinceA is collapse-free by Lemma 9.10, COD(σ) and COD(τ)consist of variables. The substitution σ is invertible,hence it is a renaming. ut

We denote by 〈σ = τ〉 the equation system 〈s1 = t1, . . . , sn = tn〉, for sub-stitutions σ = xi ← si|i = 1, . . . , n and τ = xi ← ti|i = 1, . . . , n, whereDOM(σ) = DOM(τ) = xi|i = 1, . . . , n.

Now we can give rules that are sufficient for the empty theory:

Definition 9.12.Rule : Decomposition.s, t ∪M ⇒W s ∪M ∪ 〈σ = τ〉,iff there is a nonvariable term r such that σr = s and τr = t andDOM(σ) = DOM(τ) = V(r).

Rule : Occur− check.Γ ⇒W FAIL,if Γ contains a cycle.

Rule : Clashs, t ∪M ⇒W FAIL,if s and t are nonvariable terms and decomposition is not applicable.

Proposition 9.13. Let A be a unification algebra extended by constants.

i) If A is Ω-free, then decomposition is complete.ii) If A is subterm-cycle-free, then the occur-check is complete.iii) If A is decomposable, then the clash-rule is complete.

Proof. i) Let A be Ω-free.”⇐W ”: Let θ be a solution of s ∪M ∪ 〈σ = τ〉. Then θ is also a unifierof s = t, as θσr = θτr. Hence θ is a solution of s, t ∪M .”⇒W ”: Let θ be a solution of s, t ∪ M, let σ, τ ∈ SUB with σr = sand τr = t and DOM(σ) = DOM(τ) = V(r). Since A is Ω-free, we haveθσ = θτ [V(r)], hence θ is a solution of 〈σ = τ〉.

ii) Let A be subterm-cycle-free. It is sufficient to show that a Γ with a cycle hasno solution. Assume there is a solution θ of Γ . There exists a cycle (xi, ti)in Γ . Since θ unifies the cycle and t1 is not a variable, we have that θt1 is asubterm of itself, which is a contradiction.

iii) LetA be decomposable. It is sufficient to show that s, t∪M has no solution.Assume there is a solution θ of s = t. Since A is decomposable, there existssubstitutions σ, τ and a nonvariable term r, such that σr = s and τr = t.But then decomposition would be applicable.

ut

37

Page 38: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

If a unification algebra is regular, collapse-free, subterm-cycle-free, then we candefine the depth of terms for all terms that have a finite number of subterms asfollows depth(x) := 0 for x ∈ V , and depth(t) := 1 +maxdepth(s)|s sub t.

Lemma 9.14. If A is regular, collapse-free, and subterm-cycle-free, then thedefinition of depths of terms is sensible for subterm-finite terms t for a subterm-finite term t we have sub t implies depth(s) < depth(t).

Proof. If A is regular and collapse-free, variables have no subterms, hencedepth(x) := 0 is compatible with the definition of depth. Transitivity of subyields that for sub t , the r|r sub s is a subset of r|r sub t. Subterm-cycle-freeness implies that the subset relation is proper. For subterm-finite t thesesubsets are finite by assumption, hence depth is a natural number and sub timplies depth(s) < depth(t). ut

Note that since A is unsorted, solved systems of equations are exactly those,which are merged, have no cycles and in every multi-equation there is at mostone nonvariable term.

Now we can show termination of decomposition-merge for a class of uni-fication algebras:

Theorem 9.15. Let A be Ω-free, subterm-cycle-free and decomposable and letΓ be a unification problem, such that all all terms in Γ have only a finite num-ber of subterms. Then decomposition, merge, occur-check and clash provide aterminating, complete unification algorithm for Γ .

Proof. Proposition 9.13 and Theorem 6.3 show that the rules preserve the solu-tion space.We show that the the application of rules terminates. Therefore we need a slightvariation of the decomposition rule: In the multi-equation s, t ∪M , we deletethe term with greater depth and keep the one with a smaller depth.The measure for showing termination is µ(Γ ) = (µ1, µ2, µ3), ordered lexico-graphically, where µ1 is the multiset depth(t)|t ∈ OBJ(Γ ) and the orderingon these multisets is inherited from the ordering on natural numbers, and µ2 isthe number of multi-equations in Γ .Decomposition strictly decreases µ1, since the terms in 〈σ = τ〉 are subtermsof either s or t, hence the depth of all terms in 〈σ = τ〉 is strictly smaller thanmaxdepth(s), depth(t) by Lemma 9.14.The merge rule leaves µ1 invariant and strictly decreases µ2.Since µ is well-founded, the procedure terminates.It remains to be shown that the returned system is in solved form, if Γ is unifi-able. If no rule is applicable, then the system has no cycles. Furthermore, everymulti-equation contains at most one nonvariable term, since otherwise either de-composition or clash is applicable. This means that Γ is solved. (Note that wehave assumed that A is unsorted) ut

38

Page 39: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Corollary 9.16. Let A be Ω-free, subterm-cycle-free, decomposable andsubterm-finite. Then decomposition, merge, occur-check and clash provide a ter-minating, complete unification algorithm for Γ . Moreover, A is unitary and hasa dimension in the sense of 7.1

9.2 Unification of Free Terms.

Definition 9.17. i) A substitution σ is Noetherian (modulo W ), if there isno properly decreasing infinite chain σ0 >W σ1 >W σ2 >W . . .

ii) A term t is Noetherian (modulo W ), if there is no properly decreasinginfinite chain t0 > t1 > t2 > . . .

iii) A unification algebra is Noetherian, if every term is Noetherian and forevery finite set of variables W every substitution is Noetherian.

Theorem 9.18. Let A be a unification algebra, such that A is Ω-free, subterm-cycle-free, decomposable, subterm-finite and Noetherian.Then A is isomorphic to the terms over a free signature.

Proof. 1) For every term t there is a term t0, with t0 ≤ t, t0 has only variablesas subterms, and t0 is minimal with respect to ≤.This term is unique up to ≡:Since t is Noetherian, there exists a ≤-minimal nonvariable term t0 with t0 ≤t. Assume, t0 has a nonvariable subterm s. Then there exists a nonvariableterm s′ such that x ← ss′ = t0.This means s′ ≤ t0. Since t0 is minimal,there exists a σ such that σt0 = s′. Thus σx ← ss′ = s′, and hence byΩ-freeness we obtain σx ← s = IDA. Now σs = x implies that A is notcollapse-free, which contradicts Lemma 9.10.Assume, there is another minimal term t1 with the described properties.Without loss of generality we can assume that t0 and t1 are variable disjoint,by applying a variable permutation if necessary. Then t0 and t1 are unifiable,and hence we can use decomposition. There exists a term r and substitutionsσ, τ with σr = t0 and τr = t1. By minimality, we have r ≡ t0 and r ≡ t1,hence t0 ≡ t1.

2) Now we can define the signature Σ:We can assume that the set of variables is ordered by a total partial ordering.For every equivalence class EC of ≤-minimal nonvariable terms, we selecta representative tEC . Due to Lemma 9.8, all terms in EC have the samenumber of variables, say nEC . We select a nEC-ary function symbol fEC .The signature Σ then exactly consists of all function symbols fEC for allsuch equivalence classes. We assume that the variables are exactly the setV.We define the generating terms tΣ,EC := fEC(x1, . . . , xnEC), wherex1, . . . , xnEC = V(tEC) and the variables are ascending with respect tothe ordering on variables.The set of all terms T (Σ,V) can be constructed from the generating termstΣ,EC .

39

Page 40: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Every term in T (Σ,V) is either a variable or of the form x1 ← t1, , xnEC ←xnECtΣ,EC for some terms ti. This representation is unique for terms inT (Σ,V).

3) T (Σ,V) and A are isomorphic:We define a mapping ϕ : T (Σ,V)→ A, and show that ϕ is an isomorphismof unification algebras.ϕ(x) := x for variables x ∈ V.ϕ(x1 ← t1, . . . , xnEC ← tnECtΣ,EC := x1 ← ϕt1, . . . , xnEC ←ϕtnECtEC .For substitutions σ = x1 ← t1, . . . , xn ← tn we define ϕ(σ) := x1 ←ϕt1, . . . , xn ← ϕtn

i) ϕ : T (Σ,V)→ TA is injective:ϕ(x1 ← t1, . . . , xnEC ← tnECtΣ,EC) = ϕ(x1 ← s1, . . . , xnEC′ ←snEC′tΣ,EC′) implies x1 ← ϕt1, . . . , xnEC ← ϕtnECtEC = x1 ←ϕt1, . . . , xnEC ← ϕtnECtEC′ . Hence tEC and tEC′ are unifiable in A,which is only possible if tEC = tEC′ by (1). Now Ω-freeness of A impliesϕti = ϕsi for all i, and by induction on the depth of terms in A weconclude that ϕ injective.

ii) ϕ : T (Σ,V)→ TA is a surjective:Let s be a term in A. If s is a variable, then σ is in the image of ϕ. Lets be a nonvariable term.Then s = x1 ← s1, . . . , xn ← sns0,EC , where s0,EC is the minimalnonvariable term that is more general than s. Ω-freeness of A impliesthat si are unique, and subterm-cycle-freeness of A implies that the A-depths of the si’s are strictly smaller than the depth of s. Now inductionon the A-depth shows that there are terms si,T with ϕsi,T = si. Henceϕ(x1 ← s1,T , . . . , xn ← sn,T sΣ,0,EC) = s.

iii) ϕ is also a bijection ϕ := SUBΣ → SUBA.iv) ϕ(στ) = ϕ(σ)ϕ(τ):

If t is a variable, then the equations holds by definition.If t is not a variable, then t can be represented as t = x1 ←t1, . . . , xnEC ← tnECtΣ,EC , where the ti’s have smaller term depthsthan t. By definition, we have ϕ(στ) = x1 ← ϕ(σt1), . . . , xnEC ←ϕ(σtnEC)tEC . Induction on the term depth shows that this expres-sion is equal to x1 ← ϕ(σ)ϕ(t1), . . . , xnEC ← ϕ(σ)ϕ(tnEC)tEC . SinceV(tEC) = x1, . . . , xnEC, this expression is equal to ϕ(σ)(x1 ←ϕ(t1), . . . , xnEC ← ϕ(tnEC)tEC). This is exactly ϕ(σ)ϕ(τ).

v) ϕ(στ) = ϕ(σ)ϕ(τ):Follows easy from part iv).

vi) ϕ is an isomorphism:Using Definition 5.1, we have shown that ϕ is a bijection on terms andsubstitutions and is a homomorphism of unification algebras. That ϕ isan isomorphism follows from Lemma 5.3.

ut

40

Page 41: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

The following example gives a theory that is unitary due to Corollary 9.16 butcannot be equivalent to a free term algebra, since it is not Noetherian.

Example 9.19. Consider the following theory. The theory can be viewed as atheory of infinite sequences s, such that for every sequence s, there exists anumber n such that sm becomes constant for all m ≤ n. The signature hasfor every n > 0 a n-ary function symbol fn. The theory E is defined by the(infinite) canonical term rewriting system:R := fn(x1, . . . , xn−2, x, x)→ fn−1(x1, . . . , xn−2, x)|n ≥ 2.E is Ω-free: Assume fn(s1, . . . , sn) =E fn(t1, . . . , tn) for some fn, si and ti andassume that for some j ∈ 1, . . . , n, we have sj 6=E tj . We can assume that allsi and ti are in normal form. Furthermore,we can assume that n is the smallestnumber, which violates Ω-freeness. Since fn(s1, . . . , sn) =E fn(t1, . . . , tn), oneof them must be reducible, say fn(s1, . . . , sn), hence n ≥ 2. Reducibility offn(s1, . . . , sn) implies sn = sn−1. Now fn(t1, . . . , tn) must be reducible, too,hence tn = tn−1. Thus we have fn−1(s1, . . . , sn−1) =E fn−1(t1, . . . , tn−1), whichcontradicts the minimal choice of n.E is subterm-cycle-free: Holds, since the (usual) term depth is invariant inequivalence classes with respect to E .E is subterm-finite: The equations show, that application of rewrite rules doesnot change equivalence classes of subterms, hence a term has only a finitenumber of subterms modulo E .E is decomposable: Let s, t be nonvariable, unifiable terms. By applying rewriterules backwards, we can assume that s = fn(s1, . . . , sn) and t = fn(t1, . . . , tn)for some n. Then we can choose r = f(x1, . . . , xn), where x1, . . . , xn are newvariables, and σ := xi ← si|i = 1, . . . , n and τ := xi ← ti|i = 1, . . . , n.E is not Noetherian: the following chain f1(x1) > f2(x1, x2) > f3(x1, x2, x3) >. . . shows this:We have xn ← xn−1fn(x1, . . . , xn) = fn−1(x1, . . . , xn−1). In order to showthat fn−1(x1, . . . , xn−1) is a proper E-instance of fn(x1, . . . , xn), assumefn−1(t1, . . . , tn−1) =E fn(x1, . . . , xn). The term fn(x1, . . . , xn) is in normalform, thus fn−1(t1, . . . , tn−1) must be reducible. However, it is not possible toreduce it to a term starting with fn. We have reached a contradiction.

Now Corollary 9.16 shows that for this theory the algorithm consisting ofthe rules decomposition, merge is a unification algorithm and that it is ofunification type unitary.

9.3 Unification of Rational Terms.

In order to give unification rules that are able to deal with the algebra of rationalterms [Col82a], we need more properties of unification algebras.

Definition 9.20. Let A be a unification algebra.A solves cycles uniquely, iff for every nonvariable term r with x ∈ V (r), and

41

Page 42: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

two termss, t : x← sr = s and x← tr = t implies s = t.

Definition 9.21.Rule: Rational-Unfolding:

t = M ⇒W x = t′ = M,if t contains a nonvariable subterm s, x← st′ = t,where t′ is a nonvariable term with x ∈ V(t′), and x is a new variable.

Proposition 9.22. If A is Ω-free, collapse-free, and solves cycles uniquely, thenrational-unfolding is a complete step.

Proof. The transformation is complete.”⇒”: Let θ be a solution of t = M . Then define θ′ such that θ′ = θ[V (t,M)],and θ′x := θt.Obviously θ′ = θ′x← t. This implies θ′t′ = θ′x← tt′ = θ′t = θt.”⇒”: Let θ be a solution of x = t′ = M . Without loss of generality we canassume that DOM(θ) ∩ I(θ) = ∅. With θ′ := θ|V (t′)−x, we can partition θ asfollows: θ = θ′ ∪ x← θt′. Then we have θx = θt′ = x← θt′(θ′t′).θ′t′ is not a variable, since A is collapse-free. We have θt = (θ′∪x← θt′)x←tt′ = x ← θt′θ′x ← θ′tt′ = x ← θ′tθ′t′ = x ← θtθ′t′. A solves cyclesuniquely, hence θt = θt′.This means, θ is a unifier of t = M . ut

Proposition 9.23. If A is Ω-free, collapse-free, and Noetherian, then therational-unfolding rule terminates with a Γ , such that all terms in OBJ(Γ )have only variables as subterms.

Proof. We show that the transformation terminates:Let the measure be the multiset of all nonvariable terms that have nonvariablesubterms, ordered by the ordering that comes from the instance relation. Since Ais Noetherian, the multi-set ordering is well-founded. We have to show that t′ < t.Obviously t′ ≤ t. Assume σt = t′ for some substitution σ with DOM(σ) = V(t).Then x ← sσt = t. Furthermore t 6= t′, which implies V(t) 6= ∅. Now Ω-freeness implies x ← sσ = IDT [V(t)], which is impossible, since A is regularand collapse-free.We have shown that rational-unfolding terminates.If rational-unfolding stops, then there is no term with a nonvariable subterm,hence the last claim holds. ut

Cyclically solved systems of equations are exactly those, which are mergedand in every multi-equation there is at most one nonvariable term.

Theorem 9.24. If A is Ω-free, collapse-free, decomposable, Noetherian, andsolves cycles uniquely, then the following procedure is complete and terminates.

1) first use rational-unfolding until this is no longer possible,2) use decomposition, merge and clash.

If it terminates, then Γ is in cyclically solved form.

42

Page 43: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

Proof. Proposition 9.23 shows that step 1 yields a Γ , which contains only vari-ables or terms that have no nonvariable subterms.Let s = t be in a multi-equation and nonvariable terms. If they are unifiable, thendecomposition is applicable. Let σr = s, τr = t with DOM(σ) = DOM(τ) =V(r). We have that COD(σ) and COD(τ) consist of variables, since otherwise sor t have nonvariable subterms as A is regular and collapse-free. Hence every de-composition removes a nonvariable term. This means, the merge-decompositionprocess terminates. Furthermore it is complete due to Proposition 9.13. ut

All the above properties hold for rational terms [Col82a], hence our algorithmcan be applied to them.

References

[Baa86] F. Baader. The theory of idempotent semigroups is of unification type zero.In Proceedings of the 2nd International Conference on Rewriting Techniquesand Applications, volume 256 of Lecture Notes in Computer Science, pages283–286. Springer-Verlag, 1986.

[Baa89] F. Baader. Unifikation und Reduktionssysteme fur Halbgruppenvarietaten.Dissertation, Universitat Erlangen-Nurnberg, Germany, 1989.

[BHMS87] H.-J. Burckert, A. Herold, and M.Schmidt-Schauß. On equational theories,unification and decidability. In Proceedings of the 2nd International Con-ference on Rewriting Techniques and Applications, volume 256 of LectureNotes in Computer Science, pages 204–215. Springer-Verlag, 1987.

[Bir35] G. Birkhoff. On the structure of abstract algebras. In Proceedings of theCambridge Philosophical Society, volume 31, pages 433–454, 1935.

[BS81] S. Burris and H.P. Sankappanavar. A course in universal algebra. Springer-Verlag, 1981.

[Bur86] H.-J. Burckert. Some relationships between unification, restricted unifica-tion and matching. In Proceedings of the 8th International Conference onAutomated Deduction, volume 230 of Lecture Notes in Computer Science,pages 514–524. Springer-Verlag, 1986.

[Bur88] H.-J. Burckert. Solving disequations in equational theories. In Proceedings ofthe 9th International Conference on Automated Deduction, volume 3100 ofLecture Notes in Computer Science, pages 517–526. Springer-Verlag, 1988.

[CL73] C. Chang and R. C. Lee. Symbolic Logic and Mechanical Theorem Proving.Academic Press, London, 1973.

[Col82a] A. Colmerauer. Prolog and infinite trees. In K. Clark and S.-A. Tarnlund,editors, Logic Programming, pages 231–251. Academic Press, London, 1982.

[Col82b] A. Colmerauer. Prolog II reference manual & theoretical models. Internalreport, groupe intelligence artificielle, universite Aix - Marseille II, 1982.

[Col84] A. Colmerauer. Equations and inequations on finite and infinite trees. InProc. of Int. Conf. FGCS, ICOT, pages 85–99, 1984.

[Com88] H. Comon. Unification et Disunification, Theorie et Applications. Thesis(in french), Universite de Grenoble, France, 1988.

[DM79] N. Dershowitz and Z. Manna. Proving termination with multiset orderings.CACM, 22(1):465–476, 1979.

[DSvH87] M. Dincbas, H. Simonis, and P. van Hentenryck. Extending equations solv-ing and constraint handling in logic programming. In Proc. CREAS work-shop, MCC, Austin, Texas, 1987.

43

Page 44: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

[Fag84] F. Fages. Associative-commutative unification. In Proceedings of the 7thInternational Conference on Automated Deduction, volume 170 of LectureNotes in Computer Science, pages 194–208. Springer-Verlag, 1984.

[Fay79] M. Fay. First order unification in an equational theory. In W.H.Joyner, ed-itor, Proc. 4th Workshop on Automated Deduction, pages 161–167, London,1979. Academic Press.

[FH83] F. Fages and G. Huet. Complete sets of unifiers and matchers in equationaltheories. In Proc. CAAP-83, volume 159 of Lecture Notes in ComputerScience. Springer-Verlag, 1983.

[Gal86] J.H. Gallier. Logic for Computer Science: Foundations of Automatic Theo-rem Proving. Harper and Row, New York, 1986.

[Gog88] J.A. Goguen. What is unification?, a categorical view of substitution, equa-tion and solution. Technical report SRI-CSL-88-2, SRI, 1988.

[Gra79] G. Gratzer. Universal Algebra. Springer-Verlag, 1979.[GS87] J. Gallier and W. Snyder. A general complete E-unification procedure. In

Proceedings of the 2nd International Conference on Rewriting Techniquesand Applications, volume 256 of Lecture Notes in Computer Science, pages216–227. Springer-Verlag, 1987.

[Her30] J. Herbrand. Recherches sur la theory de la demonstration. In Travaux dela Soc. des Sciences et des Lettre de Varsovie, volume 33(128), 1930.

[HO80] G. Huet and D.C. Oppen. Equations and Rewrite Rules: A Survey. Aca-demic Press, London, 1980.

[HS87] Alexander Herold and Jorg H. Siekmann. Unification in abelian semigroups.Journal of Automated Reasoning, 3:247–283, 1987.

[Hue75] Gerard Huet. A unification algorithm for typed λ-calculus. TheoreticalComputer Science, 1:27–57, 1975.

[Hue76] Gerard Huet. Resolution d’equations dans des langages d’ordre 1,2,. . .ω.These de doctorat d‘etat, Universite Paris VII, 1976. In French.

[Hue80] G. Huet. Confluent reductions: Abstract properties and applications to termrewriting systems. J. of the ACM, 27(4):797–821, 1980.

[Hul80] J.M. Hullot. Canonical forms and unification. In W. Bibel and R. Kowalski,editors, Proceedings of the 5th International Conference on Automated De-duction, volume 87 of Lecture Notes in Computer Science, pages 318–334.Springer-Verlag, 1980.

[JL86] J. Jaffar and J.-L. Lassez. Constraint logic programming. In 4th IEEESymposium on Logic Programming, San Francisco, 1986.

[Kir84] Claude Kirchner. A new equational unification method: A generalizationof martelli- montanari’s algorithm. In Proceedings of the 7th InternationalConference on Automated Deduction, volume 170 of Lecture Notes in Com-puter Science, pages 224–247. Springer-Verlag, 1984.

[Law68] F.W.C. Lawvere. Some algebraic problems in the context of functorial se-mantics of algebraic theories. In Lecture Notes in mathematics, volume 61,pages 41–61, 1968.

[LBB84] D. Lankford, G. Butler, and B. Brady. Abelian group unification algorithmsfor elementary terms. Contemporary Mathematics, 29, 1984.

[LMM87] J.-L. Lassez, M.J. Maher, and K. Marriot. Unification revisited. Kauffman,1987.

[Lov78] D. Loveland. Automated theorem proving: A logical basis, 1978.[LS78] M. Livesey and Jorg H. Siekmann. Unification of sets and multisets. Seki

technical report, Universitat Karlsruhe, 1978.

44

Page 45: Unification Algebras: An Axiomatic Approach to Unification, … · 2005-05-21 · An Axiomatic Approach to Unification, Equation Solving and ... an algebra given an explicit construction

[McN76] G. McNulty. The decision problem for equational bases of algebras. InAnnals of Mathematical Logic, volume 10, pages 193–259, 1976.

[MM82] A. Martelli and U. Montanari. An efficient unification algorithm. In ACMTrans. of Programming Languages and Systems, volume 4 of 2, pages 258–282, 1982.

[Nip90] Tobias Nipkow. Unification in primal algebras, their powers and their vari-eties. Journal of the ACM, 37(4):742–776, 1990.

[NRS89] Werner Nutt, Pierre Rety, and Gert Smolka. Basic narrowing revisited.Journal of Symbolic Computation, 7:295–317, 1989. also Technical reportSR-87-07, Universitat Kaiserslautern, (1987).

[Plo72] Gordon Plotkin. Building in equational theories. Machine Intelligence,7:73–90, 1972.

[PW78] M.S. Paterson and M.N. Wegman. Linear unification. Journal of Computerand System Sciences, 16:158–167, 1978.

[RB85] D.E. Rydeheard and R.M. Burstall. A categorical unification algorithm.In Summer workshop on category theory & computer programming, volume240 of Lecture Notes in Computer Science, 1985.

[Rob65] J.A. Robinson. A machine-oriented logic based on the resolution principle.In JACM 12,1, volume 12 of Lecture Notes in Computer Science, pages23–41, 1965.

[RS87] D.E. Rydeheard and J.G. Stell. Foundations of equational deduction: Acategorical treatment of equational proofs and unification algorithms, 1987.

[SG89] Wayne Snyder and Jean Gallier. Higher-order unification revisited: Com-plete sets of transformations. J. Symbolic Computation, 8:101–140, 1989.

[Sie75] Jorg H. Siekmann. Stringunification, 1975.[Sie86] Jorg H. Siekmann. Unification theory. In Proc. of ECAI,Brighton, volume II,

pages p. vi–xxxv, 1986.[Sie89] Jorg H. Siekmann. Unification theory: A survey. J. Symbolic Computation,

7(3,4):207–274, 1989.[SNMG89] Gert Smolka, Werner Nutt, Jose Meseguer, and Joseph A. Goguen. Order-

sorted equational computation. J. Symbolic Computation, 8:383–413, 1989.[SS86a] Manfred Schmidt-Schauß. Unification in many-sorted equational theories.

In Proceedings of the 8th International Conference on Automated Deduction,volume 230 of Lecture Notes in Computer Science, pages 538–552, 1986.

[SS86b] Manfred Schmidt-Schauß. Unification under associativity and idempotenceis of type nullary. J. Automated Reasoning, 2(3):227–281, 1986.

[SS88] Manfred Schmidt-Schauß. Computational aspects of an order-sorted logicwith term declarations. doctoral dissertation, Universitat Kaiserslautern,Germany, 1988.

[SS89] Manfred Schmidt-Schauß. Computational Aspects of an Order-sorted Logicwith Term Declarations. Number 395 in Lecture Notes in Computer Science.Springer-Verlag, 1989.

[Sza82] P. Szabo. Theory of first order unification,. Thesis, University of Karlsruhe,Germany, 1982. (in German).

[Wal88] C. Walther. Many-sorted unification. In JACM, volume 35, pages 1–17,1988.

45