Unification

Unification

In mathematical logic, in particular as applied to computer science, a unification of two terms is a "join" (in the lattice sense) with respect to a specialisation order. That is, we suppose a preorder on a set of terms, for which "t"* ≤ "t" means that "t"* is obtained from "t" by substituting some term(s) for one or more free variables in "t". The unification "u" of "s" and "t", if it exists, is a term that is a substitution instance of both "s" and "t". If any common substitution instance of "s" and "t" is also an instance of "u", "u" is called "minimal unification".

For example, with polynomials, "X" 2 and "Y" 3 can be unified to "Z"6 by taking "X" = "Z"3 and "Y" = "Z"2.

Definition of unification for first-order logic [Russell, Norvig: Artificial Intelligence, A Modern Approach, p. 277]

Let p and q be sentences in first-order logic.

:UNIFY(p,q) = U where subst(U,p) = subst(U,q)

Where subst(U,p) means the result of applying substitution U on the sentence p. Then U is called a unifier for p and q. The unification of p and q is the result of applying U to both of them.

Let L be a set of sentences, for example, L = {p,q}. A unifier U is called a most general unifier for L if, for all unifiers U' of L, there exists a substitution s such that applying s to the result of applying U to L gives the same result as applying U' to L: :subst(U',L) = subst(s,subst(U,L)).

Unification in logic programming and type theory

The concept of unification is one of the main ideas behind logic programming, best known through the language Prolog. It represents the mechanism of binding the contents of variables and can be viewed as a kind of one-time assignment. In Prolog, this operation is denoted by the equality symbol =, but is also done when instantiating variables (see below). It is also used in other languages by the use of the equality symbol =, but also in conjunction with many operations including +, -, *, /. Unification is also the method used to perform type inference.

# In traditional Prolog, a variable which is uninstantiated—i.e. no previous unifications were performed on it—can be unified with an atom, a term, or another uninstantiated variable, thus effectively becoming its alias. In many modern Prolog dialects and in first-order logic, a variable cannot be unified with a term that contains it; this is the so called "occurs check". (In type theory, any type variable unifies with any type expression and is instantiated to that expression (subject to the occurs check where the theory specifies it).)
# Two Prolog atoms can only be unified if they are identical. (In type theory, any two type constants unify only if they are the same type.)
# Similarly, a term can be unified with another term if the top function symbols and arities of the terms are identical and if the parameters can be unified simultaneously. Note that this is a recursive behavior. (In type theory, any two type constructions unify only if they are applications of the same type constructor and all of their component types also recursively unify.)

Due to its declarative nature, the order in a sequence of unifications is (usually) unimportant.

Note that in the terminology of first-order logic, an atom is a basic proposition and is unified similarly to a Prolog term.

French computer scientist Gérard Huet gave an algorithm for unification in typed lambda calculus in 1973. [ [http://mathgate.info/cebrown/notes/huet75.php "A Unification Algorithm for Typed Lambda-Calculus", Gerard P. Huet, Theoretical Computer Science 1 (1975), 27-57] ] There have been many developments in unification theory since then. [ [http://pauillac.inria.fr/~huet/PUBLIC/Hampton.pdf "30 Years of Higher-Order Unification", Gérard Huet, TPHOL 2002, INRIA] ]

Examples of unification

"In the convention of Prolog, atoms begin with lowercase letters."

*"A" = "A" : Succeeds (tautology)
*"A" = "B", "B" = "abc" : Both "A" and "B" are unified with the atom "abc"
*"abc" = "B", "B" = "A" : As above (unification is symmetric)
*"abc" = "abc" : Unification succeeds
*"abc" = "xyz" : Fails to unify because the atoms are different
*"f"("A") = "f"("B") : "A" is unified with "B"
*"f"("A") = "g"("B") : Fails because the heads of the terms are different
*"f"("A") = "f"("B", "C") : Fails to unify because the terms have different arity
*"f"("g"("A")) = "f"("B") : Unifies "B" with the term "g"("A")
*"f"("g"("A"), "A") = "f"("B", "xyz") : Unifies "A" with the atom "xyz" and "B" with the term "g"("xyz")
*"A" = "f"("A") : Infinite unification, "A" is unified with "f"("f"("f"("f"(...)))). In proper first-order logic and many modern Prolog dialects this is forbidden (and enforced by the "occurs check")
*"A" = "abc", "xyz" = "X", "A" = "X" : Fails to unify; effectively "abc" = "xyz"

References

* F. Baader and T. Nipkow, " [http://www4.informatik.tu-muenchen.de/~nipkow/TRaAT/ "Term Rewriting and All That"] ." Cambridge University Press, 1998.
* F. Baader and W. Snyder, " [http://lat.inf.tu-dresden.de/research/papers/2001/BaaderSnyderHandbook.ps.gz "Unification Theory"] ." In J.A. Robinson and A. Voronkov, editors, Handbook of Automated Reasoning, volume I, pages 447–533. Elsevier Science Publishers, 2001.
* Joseph Goguen, " [http://www-cse.ucsd.edu/~goguen/projs/sem.html "What is Unification?"] ."
*

ee also

*admissible rule


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?
Synonyms:
, (so as to become one),


Look at other dictionaries:

  • unification — [ ynifikasjɔ̃ ] n. f. • 1838; de unifier ♦ Le fait d unifier (plusieurs éléments; un ensemble d éléments), de rendre unique et uniforme; le fait de s unifier. ⇒ intégration. Unification d un pays. L unification de l Allemagne. « Jusqu à la… …   Encyclopédie Universelle

  • Unification — Студийный альбом …   Википедия

  • unification — 1851, noun of action from UNIFY (Cf. unify). UNIFICATION CHURCH (Cf. Unification Church) was founded 1954 …   Etymology dictionary

  • Unification — U ni*fi*ca tion, n. [See {Unify}.] The act of unifying, or the state of being unified. [1913 Webster] Unification with God was the final aim of the Neoplatonicians. Fleming. [1913 Webster] …   The Collaborative International Dictionary of English

  • unification — index accession (annexation), affiliation (amalgamation), centralization, coalescence, coalition, combination …   Law dictionary

  • unification — [n] joining together affinity, alliance, amalgamation, coalescence, coalition, combination, concurrence, confederation, connection, consolidation, coupling, federation, fusion, hookup, interlocking, linkage, melding, merger, merging, union,… …   New thesaurus

  • unification — ► NOUN ▪ the process of being unified …   English terms dictionary

  • unification — [yo͞o΄nə fi kā′shən] n. the act of unifying or the state of being unified …   English World dictionary

  • Unification — Pour les articles homonymes, voir Unification (homonymie). Le concept d unification est une notion centrale de la logique des prédicats ainsi que d autres systèmes de logique et est sans doute ce qui distingue le plus Prolog des autres langages… …   Wikipédia en Français

  • unification — /yooh neuh fi kay sheuhn/, n. 1. the process of unifying or uniting; union: the unification of the 13 original colonies. 2. the state or condition of being unified: The unification of the manufacturing and distribution functions under one… …   Universalium

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”