Unification Article Index for
Unification
Articles about
Unification
Website Links For
Unification
 

Information About

Unification




  • ≤ ''t'' means that ''t''--- is obtained from ''t'' by substituting some term(s) for one or more Free Variable s 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 Polynomial s, ''X''2 and ''Y''3 can be unified to ''Z''6 by taking ''X'' = ''Z''3 and ''Y'' = ''Z''2.


UNIFICATION IN LOGIC PROGRAMMING


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 symbol "=".

# In traditional Prolog, a Variable ''X'' 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 ''.
# Two Prolog atoms can only be unified if they are identical.
# 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 behaviour.

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.


EXAMPLES OF UNIFICATION


  • ''A'' = ''A'' : Succeeds ( Tautology )

  • ''A'' = ''B'', ''B'' = ''abc'' : Both ''A'' and ''B'' are unified with the atom ''abc''

  • ''xyz'' = ''C'', ''C'' = ''D'' : 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