Katana VentraIP

Unification (computer science)

In logic and computer science, specifically automated reasoning, unification is an algorithmic process of solving equations between symbolic expressions, each of the form Left-hand side = Right-hand side. For example, using x,y,z as variables, and taking f to be an uninterpreted function, the singleton equation set { f(1,y) = f(x,2) } is a syntactic first-order unification problem that has the substitution { x 1, y ↦ 2 } as its only solution.

Conventions differ on what values variables may assume and which expressions are considered equivalent. In first-order syntactic unification, variables range over first-order terms and equivalence is syntactic. This version of unification has a unique "best" answer and is used in logic programming and programming language type system implementation, especially in Hindley–Milner based type inference algorithms. In higher-order unification, possibly restricted to higher-order pattern unification, terms may include lambda expressions, and equivalence is up to beta-reduction. This version is used in proof assistants and higher-order logic programming, for example Isabelle, Twelf, and lambdaProlog. Finally, in semantic unification or E-unification, equality is subject to background knowledge and variables range over a variety of domains. This version is used in SMT solvers, term rewriting algorithms, and cryptographic protocol analysis.

An infinite set of variables. For higher-order unification, it is convenient to choose disjoint from the set of .

lambda-term bound variables

A set of terms such that . For first-order unification, is usually the set of (terms built from variable and function symbols). For higher-order unification consists of first-order terms and lambda terms (terms containing some higher-order variables).

first-order terms

A mapping , assigning to each term the set of free variables occurring in .

A theory or on , indicating which terms are considered equal. For first-order E-unification, reflects the background knowledge about certain function symbols; for example, if is considered commutative, if results from by swapping the arguments of at some (possibly all) occurrences. [note 1] In the most typical case that there is no background knowledge at all, then only literally, or syntactically, identical terms are considered equal. In this case, ≡ is called the free theory (because it is a free object), the empty theory (because the set of equational sentences, or the background knowledge, is empty), the theory of uninterpreted functions (because unification is done on uninterpreted terms), or the theory of constructors (because all function symbols just build up data terms, rather than operating on them). For higher-order unification, usually if and are alpha equivalent.

equivalence relation

Order-sorted unification[edit]

Order-sorted logic allows one to assign a sort, or type, to each term, and to declare a sort s1 a subsort of another sort s2, commonly written as s1s2. For example, when reаsoning about biological creatures, it is useful to declare a sort dog to be a subsort of a sort animal. Wherever a term of some sort s is required, a term of any subsort of s may be supplied instead. For example, assuming a function declaration mother: animalanimal, and a constant declaration lassie: dog, the term mother(lassie) is perfectly valid and has the sort animal. In order to supply the information that the mother of a dog is a dog in turn, another declaration mother: dogdog may be issued; this is called function overloading, similar to overloading in programming languages.


Walther gave a unification algorithm for terms in order-sorted logic, requiring for any two declared sorts s1, s2 their intersection s1s2 to be declared, too: if x1 and x2 is a variable of sort s1 and s2, respectively, the equation x1x2 has the solution { x1 = x, x2 = x }, where x: s1s2. [23] After incorporating this algorithm into a clause-based automated theorem prover, he could solve a benchmark problem by translating it into order-sorted logic, thereby boiling it down an order of magnitude, as many unary predicates turned into sorts.


Smolka generalized order-sorted logic to allow for parametric polymorphism. [24] In his framework, subsort declarations are propagated to complex type expressions. As a programming example, a parametric sort list(X) may be declared (with X being a type parameter as in a C++ template), and from a subsort declaration intfloat the relation list(int) ⊆ list(float) is automatically inferred, meaning that each list of integers is also a list of floats.


Schmidt-Schauß generalized order-sorted logic to allow for term declarations. [25] As an example, assuming subsort declarations evenint and oddint, a term declaration like ∀ i : int. (i + i) : even allows to declare a property of integer addition that could not be expressed by ordinary overloading.

(1983). "Fundamental Properties of Infinite Trees". Theoret. Comput. Sci. 25 (2): 95–169. doi:10.1016/0304-3975(83)90059-2.

B. Courcelle

Michael J. Maher (Jul 1988). "Complete Axiomatizations of the Algebras of Finite, Rational and Infinite Trees". Proc. IEEE 3rd Annual Symp. on Logic in Computer Science, Edinburgh. pp. 348–357.

Joxan Jaffar; Peter J. Stuckey (1986). . Theoretical Computer Science. 46: 141–158. doi:10.1016/0304-3975(86)90027-7.

"Semantics of Infinite Tree Logic Programming"

Background on infinite trees:


Unification algorithm, Prolog II:


Applications:

A

[26]

A,C

[27]

A,C,I

[28]

A,C,Nl[28]

[note 9]

A,I

[29]

A,Nl,Nr (monoid)

[30]

C

[31]

[32][33]

Boolean rings

even if the signature is expanded by arbitrary additional symbols (but not axioms)[34]

Abelian groups

Rewriting

Admissible rule

in lambda calculus

Explicit substitution

Mathematical

equation solving

: solving inequations between symbolic expression

Dis-unification

: computing a least general generalization (lgg) of two terms, dual to computing a most general instance (mgu)

Anti-unification

a lattice having unification as meet and anti-unification as join

Subsumption lattice

(use unification with semantic equivalence)

Ontology alignment

and Wayne Snyder (2001). "Unification Theory" Archived 2015-06-08 at the Wayback Machine. In John Alan Robinson and Andrei Voronkov, editors, Handbook of Automated Reasoning, volume I, pages 447–533. Elsevier Science Publishers.

Franz Baader

(2001). "Higher-order Unification and Matching" Archived 2019-05-15 at the Wayback Machine. In Handbook of Automated Reasoning.

Gilles Dowek

Franz Baader and (1998). Term Rewriting and All That. Cambridge University Press.

Tobias Nipkow

Franz Baader and (1993). "Unification Theory". In Handbook of Logic in Artificial Intelligence and Logic Programming.

Jörg H. Siekmann

Jean-Pierre Jouannaud and (1991). "Solving Equations in Abstract Algebras: A Rule-Based Survey of Unification". In Computational Logic: Essays in Honor of Alan Robinson.

Claude Kirchner

and Jean-Pierre Jouannaud, Rewrite Systems, in: Jan van Leeuwen (ed.), Handbook of Theoretical Computer Science, volume B Formal Models and Semantics, Elsevier, 1990, pp. 243–320

Nachum Dershowitz

Jörg H. Siekmann (1990). "Unification Theory". In (editor) Unification. Academic Press.

Claude Kirchner

Kevin Knight (Mar 1989). (PDF). ACM Computing Surveys. 21 (1): 93–124. CiteSeerX 10.1.1.64.8967. doi:10.1145/62029.62030. S2CID 14619034.

"Unification: A Multidisciplinary Survey"

and Derek C. Oppen (1980). "Equations and Rewrite Rules: A Survey". Technical report. Stanford University.

Gérard Huet

Raulefs, Peter; Siekmann, Jörg; Szabó, P.; Unvericht, E. (1979). "A short survey on the state of the art in matching and unification problems". ACM SIGSAM Bulletin. 13 (2): 14–20. :10.1145/1089208.1089210. S2CID 17033087.

doi

Claude Kirchner and Hélène Kirchner. Rewriting, Solving, Proving. In preparation.