<s>
In	O
logic	O
and	O
computer	B-General_Concept
science	I-General_Concept
,	O
unification	B-Algorithm
is	O
an	O
algorithmic	O
process	O
of	O
solving	O
equations	O
between	O
symbolic	O
expressions	O
.	O
</s>
<s>
Depending	O
on	O
which	O
expressions	O
(	O
also	O
called	O
terms	O
)	O
are	O
allowed	O
to	O
occur	O
in	O
an	O
equation	O
set	O
(	O
also	O
called	O
unification	B-Algorithm
problem	O
)	O
,	O
and	O
which	O
expressions	O
are	O
considered	O
equal	O
,	O
several	O
frameworks	O
of	O
unification	B-Algorithm
are	O
distinguished	O
.	O
</s>
<s>
If	O
higher-order	O
variables	O
,	O
that	O
is	O
,	O
variables	O
representing	O
functions	O
,	O
are	O
allowed	O
in	O
an	O
expression	O
,	O
the	O
process	O
is	O
called	O
higher-order	O
unification	B-Algorithm
,	O
otherwise	O
first-order	O
unification	B-Algorithm
.	O
</s>
<s>
If	O
a	O
solution	O
is	O
required	O
to	O
make	O
both	O
sides	O
of	O
each	O
equation	O
literally	O
equal	O
,	O
the	O
process	O
is	O
called	O
syntactic	O
or	O
free	O
unification	B-Algorithm
,	O
otherwise	O
semantic	O
or	O
equational	O
unification	B-Algorithm
,	O
or	O
E-unification	O
,	O
or	O
unification	B-Algorithm
modulo	O
theory	O
.	O
</s>
<s>
A	O
solution	O
of	O
a	O
unification	B-Algorithm
problem	O
is	O
denoted	O
as	O
a	O
substitution	O
,	O
that	O
is	O
,	O
a	O
mapping	O
assigning	O
a	O
symbolic	O
value	O
to	O
each	O
variable	O
of	O
the	O
problem	O
's	O
expressions	O
.	O
</s>
<s>
A	O
unification	B-Algorithm
algorithm	O
should	O
compute	O
for	O
a	O
given	O
problem	O
a	O
complete	O
and	O
minimal	O
substitution	O
set	O
,	O
i.e.	O
,	O
a	O
set	O
containing	O
all	O
of	O
the	O
problem	O
's	O
solutions	O
and	O
no	O
redundant	O
members	O
.	O
</s>
<s>
For	O
first-order	O
syntactical	O
unification	B-Algorithm
,	O
Martelli	O
and	O
Montanari	O
gave	O
an	O
algorithm	O
that	O
reports	O
unsolvability	O
or	O
computes	O
a	O
complete	O
and	O
minimal	O
singleton	O
substitution	O
set	O
containing	O
the	O
so-called	O
most	B-Algorithm
general	I-Algorithm
unifier	I-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
using	O
x	O
,	O
y	O
,	O
z	O
as	O
variables	O
,	O
the	O
singleton	O
equation	O
set	O
{	O
cons( x	O
,	O
cons(x,nil )	O
)	O
=	O
cons(2,y )	O
}	O
is	O
a	O
syntactic	O
first-order	O
unification	B-Algorithm
problem	O
that	O
has	O
the	O
substitution	O
{	O
x	O
↦	O
2	O
,	O
y	O
↦	O
cons(2,nil )	O
}	O
as	O
its	O
only	O
solution	O
.	O
</s>
<s>
The	O
syntactic	O
first-order	O
unification	B-Algorithm
problem	O
{	O
y	O
=	O
cons(2,y )	O
}	O
has	O
no	O
solution	O
over	O
the	O
set	O
of	O
finite	O
terms	O
;	O
however	O
,	O
it	O
has	O
the	O
single	O
solution	O
{	O
y	O
↦	O
cons( 2	O
,	O
cons( 2	O
,	O
cons( 2	O
,...	O
)	O
)	O
)	O
}	O
over	O
the	O
set	O
of	O
infinite	O
trees	O
.	O
</s>
<s>
The	O
semantic	O
first-order	O
unification	B-Algorithm
problem	O
{	O
a⋅x	O
=	O
x⋅a	O
}	O
has	O
each	O
substitution	O
of	O
the	O
form	O
{	O
x	O
↦	O
a⋅	O
...	O
⋅a	O
}	O
as	O
a	O
solution	O
in	O
a	O
semigroup	O
,	O
i.e.	O
</s>
<s>
The	O
singleton	O
set	O
{	O
a	O
=	O
y(x )	O
}	O
is	O
a	O
syntactic	O
second-order	O
unification	B-Algorithm
problem	O
,	O
since	O
y	O
is	O
a	O
function	O
variable	O
.	O
</s>
<s>
A	O
unification	B-Algorithm
algorithm	O
was	O
first	O
discovered	O
by	O
Jacques	O
Herbrand	O
,	O
while	O
a	O
first	O
formal	O
investigation	O
can	O
be	O
attributed	O
to	O
John	O
Alan	O
Robinson	O
,	O
who	O
used	O
first-order	O
syntactical	O
unification	B-Algorithm
as	O
a	O
basic	O
building	O
block	O
of	O
his	O
resolution	O
procedure	O
for	O
first-order	O
logic	O
,	O
a	O
great	O
step	O
forward	O
in	O
automated	O
reasoning	O
technology	O
,	O
as	O
it	O
eliminated	O
one	O
source	O
of	O
combinatorial	O
explosion	O
:	O
searching	O
for	O
instantiation	O
of	O
terms	O
.	O
</s>
<s>
Today	O
,	O
automated	O
reasoning	O
is	O
still	O
the	O
main	O
application	O
area	O
of	O
unification	B-Algorithm
.	O
</s>
<s>
Syntactical	O
first-order	O
unification	B-Algorithm
is	O
used	O
in	O
logic	B-Language
programming	I-Language
and	O
programming	O
language	O
type	O
system	O
implementation	O
,	O
especially	O
in	O
Hindley	B-Algorithm
–	I-Algorithm
Milner	I-Algorithm
based	O
type	O
inference	O
algorithms	O
.	O
</s>
<s>
Semantic	O
unification	B-Algorithm
is	O
used	O
in	O
SMT	B-Application
solvers	I-Application
,	O
term	O
rewriting	O
algorithms	O
and	O
cryptographic	B-Protocol
protocol	I-Protocol
analysis	I-Protocol
.	O
</s>
<s>
Higher-order	O
unification	B-Algorithm
is	O
used	O
in	O
proof	O
assistants	O
,	O
for	O
example	O
Isabelle	B-Application
and	O
Twelf	B-Application
,	O
and	O
restricted	O
forms	O
of	O
higher-order	O
unification	B-Algorithm
(	O
higher-order	O
pattern	O
unification	B-Algorithm
)	O
are	O
used	O
in	O
some	O
programming	O
language	O
implementations	O
,	O
such	O
as	O
lambdaProlog	B-Language
,	O
as	O
higher-order	O
patterns	O
are	O
expressive	O
,	O
yet	O
their	O
associated	O
unification	B-Algorithm
procedure	O
retains	O
theoretical	O
properties	O
closer	O
to	O
first-order	O
unification	B-Algorithm
.	O
</s>
<s>
For	O
higher-order	O
unification	B-Algorithm
,	O
it	O
is	O
convenient	O
to	O
choose	O
disjoint	O
from	O
the	O
set	O
of	O
lambda-term	O
bound	O
variables	O
.	O
</s>
<s>
For	O
first-order	O
unification	B-Algorithm
,	O
is	O
usually	O
the	O
set	O
of	O
first-order	O
terms	O
(	O
terms	O
built	O
from	O
variable	O
and	O
function	B-Language
symbols	I-Language
)	O
.	O
</s>
<s>
For	O
higher-order	O
unification	B-Algorithm
consists	O
of	O
first-order	O
terms	O
and	O
lambda	O
terms	O
(	O
terms	O
containing	O
some	O
higher-order	O
variables	O
)	O
.	O
</s>
<s>
For	O
first-order	O
E-unification	O
,	O
reflects	O
the	O
background	O
knowledge	O
about	O
certain	O
function	B-Language
symbols	I-Language
;	O
for	O
example	O
,	O
if	O
is	O
considered	O
commutative	O
,	O
if	O
results	O
from	O
by	O
swapping	O
the	O
arguments	O
of	O
at	O
some	O
(	O
possibly	O
all	O
)	O
occurrences	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
≡	O
is	O
called	O
the	O
free	B-Language
theory	I-Language
(	O
because	O
it	O
is	O
a	O
free	O
object	O
)	O
,	O
the	O
empty	B-Language
theory	I-Language
(	O
because	O
the	O
set	O
of	O
equational	O
sentences	O
,	O
or	O
the	O
background	O
knowledge	O
,	O
is	O
empty	O
)	O
,	O
the	O
theory	O
of	O
uninterpreted	B-Language
functions	I-Language
(	O
because	O
unification	B-Algorithm
is	O
done	O
on	O
uninterpreted	B-Language
terms	I-Language
)	O
,	O
or	O
the	O
theory	O
of	O
constructors	B-Application
(	O
because	O
all	O
function	B-Language
symbols	I-Language
just	O
build	O
up	O
data	O
terms	O
,	O
rather	O
than	O
operating	O
on	O
them	O
)	O
.	O
</s>
<s>
For	O
higher-order	O
unification	B-Algorithm
,	O
usually	O
if	O
and	O
are	O
alpha	O
equivalent	O
.	O
</s>
<s>
A	O
unification	B-Algorithm
problem	O
is	O
a	O
finite	O
set	O
of	O
potential	O
equations	O
,	O
where	O
.	O
</s>
<s>
Such	O
a	O
substitution	O
is	O
also	O
called	O
a	O
unifier	O
of	O
the	O
unification	B-Algorithm
problem	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
⊕	O
is	O
associative	O
,	O
the	O
unification	B-Algorithm
problem	O
{	O
x	O
⊕	O
a	O
≐	O
a	O
⊕	O
x	O
}	O
has	O
the	O
solutions	O
{	O
x	O
↦	O
a}	O
,	O
{	O
x	O
↦	O
a	O
⊕	O
a}	O
,	O
{	O
x	O
↦	O
a	O
⊕	O
a	O
⊕	O
a}	O
,	O
etc.	O
,	O
while	O
the	O
problem	O
{	O
x	O
⊕	O
a	O
≐	O
a	O
}	O
has	O
no	O
solution	O
.	O
</s>
<s>
For	O
a	O
given	O
unification	B-Algorithm
problem	O
,	O
a	O
set	O
S	O
of	O
unifiers	O
is	O
called	O
complete	O
if	O
each	O
solution	O
substitution	O
is	O
subsumed	O
by	O
some	O
substitution	O
σ	O
∈	O
S	O
;	O
the	O
set	O
S	O
is	O
called	O
minimal	O
if	O
none	O
of	O
its	O
members	O
subsumes	O
another	O
one	O
.	O
</s>
<s>
Syntactic	O
unification	B-Algorithm
of	O
first-order	O
terms	O
is	O
the	O
most	O
widely	O
used	O
unification	B-Algorithm
framework	O
.	O
</s>
<s>
It	O
is	O
based	O
on	O
T	O
being	O
the	O
set	O
of	O
first-order	O
terms	O
(	O
over	O
some	O
given	O
set	O
V	O
of	O
variables	O
,	O
C	O
of	O
constants	O
and	O
Fn	O
of	O
n-ary	O
function	B-Language
symbols	I-Language
)	O
and	O
on	O
≡	O
being	O
syntactic	O
equality	O
.	O
</s>
<s>
In	O
this	O
framework	O
,	O
each	O
solvable	O
unification	B-Algorithm
problem	O
has	O
a	O
complete	O
,	O
and	O
obviously	O
minimal	O
,	O
singleton	O
solution	O
set	O
.	O
</s>
<s>
Its	O
member	O
is	O
called	O
the	O
most	B-Algorithm
general	I-Algorithm
unifier	I-Algorithm
(	O
mgu	O
)	O
of	O
the	O
problem	O
.	O
</s>
<s>
The	O
mgu	O
is	O
unique	O
up	O
to	O
variants	O
:	O
if	O
S1	O
and	O
S2	O
are	O
both	O
complete	O
and	O
minimal	O
solution	O
sets	O
of	O
the	O
same	O
syntactical	O
unification	B-Algorithm
problem	O
,	O
then	O
S1	O
=	O
{	O
σ1	O
}	O
and	O
S2	O
=	O
{	O
σ2	O
}	O
for	O
some	O
substitutions	O
and	O
and	O
is	O
a	O
variant	O
of	O
for	O
each	O
variable	O
x	O
occurring	O
in	O
the	O
problem	O
.	O
</s>
<s>
This	O
is	O
also	O
the	O
most	B-Algorithm
general	I-Algorithm
unifier	I-Algorithm
.	O
</s>
<s>
As	O
another	O
example	O
,	O
the	O
problem	O
g(x,x )	O
≐	O
f(y )	O
has	O
no	O
solution	O
with	O
respect	O
to	O
≡	O
being	O
literal	O
identity	O
,	O
since	O
any	O
substitution	O
applied	O
to	O
the	O
left	O
and	O
right	O
hand	O
side	O
will	O
keep	O
the	O
outermost	O
g	O
and	O
f	O
,	O
respectively	O
,	O
and	O
terms	O
with	O
different	O
outermost	O
function	B-Language
symbols	I-Language
are	O
syntactically	O
different	O
.	O
</s>
<s>
This	O
paper	O
also	O
lists	O
preceding	O
attempts	O
to	O
find	O
an	O
efficient	O
syntactical	O
unification	B-Algorithm
algorithm	O
,	O
and	O
states	O
that	O
linear-time	O
algorithms	O
were	O
discovered	O
independently	O
by	O
Martelli	O
,	O
Montanari	O
(	O
1976	O
)	O
and	O
Paterson	O
,	O
Wegman	O
(	O
1976	O
,	O
1978	O
)	O
.	O
</s>
<s>
For	O
simplicity	O
,	O
constant	O
symbols	O
are	O
regarded	O
as	O
function	B-Language
symbols	I-Language
having	O
zero	O
arguments	O
.	O
</s>
<s>
Since	O
that	O
additional	O
check	O
,	O
called	O
occurs	B-Application
check	I-Application
,	O
slows	O
down	O
the	O
algorithm	O
,	O
it	O
is	O
omitted	O
e.g.	O
</s>
<s>
in	O
most	O
Prolog	B-Language
systems	O
.	O
</s>
<s>
From	O
a	O
theoretical	O
point	O
of	O
view	O
,	O
omitting	O
the	O
check	O
amounts	O
to	O
solving	O
equations	O
over	O
infinite	O
trees	O
,	O
see	O
#Unification	O
of	O
infinite	O
terms	O
below	O
.	O
</s>
<s>
Conor	O
McBride	O
observes	O
that	O
"	O
by	O
expressing	O
the	O
structure	O
which	O
unification	B-Algorithm
exploits	O
"	O
in	O
a	O
dependently	O
typed	O
language	O
such	O
as	O
Epigram	B-Language
,	O
Robinson	O
's	O
unification	B-Algorithm
algorithm	O
can	O
be	O
made	O
recursive	B-Algorithm
on	I-Algorithm
the	I-Algorithm
number	I-Algorithm
of	I-Algorithm
variables	I-Algorithm
,	O
in	O
which	O
case	O
a	O
separate	O
termination	O
proof	O
becomes	O
unnecessary	O
.	O
</s>
<s>
In	O
the	O
Prolog	B-Language
syntactical	O
convention	O
a	O
symbol	O
starting	O
with	O
an	O
upper	O
case	O
letter	O
is	O
a	O
variable	O
name	O
;	O
a	O
symbol	O
that	O
starts	O
with	O
a	O
lowercase	O
letter	O
is	O
a	O
function	B-Language
symbol	I-Language
;	O
the	O
comma	O
is	O
used	O
as	O
the	O
logical	O
and	O
operator	O
.	O
</s>
<s>
For	O
mathematical	O
notation	O
,	O
x	O
,	O
y	O
,	O
z	O
are	O
used	O
as	O
variables	O
,	O
f	O
,	O
g	O
as	O
function	B-Language
symbols	I-Language
,	O
and	O
a	O
,	O
b	O
as	O
constants	O
.	O
</s>
<s>
Prolog	B-Language
notation	O
Mathematical	O
notation	O
Unifying	O
substitution	O
Explanation	O
a	O
=	O
a	O
{	O
a	O
=	O
a	O
}	O
 {  } 	O
Succeeds	O
.	O
</s>
<s>
The	O
f	O
function	B-Language
symbols	I-Language
have	O
different	O
arity	O
f(g(X )	O
)	O
=	O
f(Y )	O
{	O
f(g(x )	O
)	O
=	O
f(y )	O
}	O
{	O
y	O
↦	O
g(x )	O
}	O
Unifies	O
y	O
with	O
the	O
term	O
f(g(X )	O
,	O
X	O
)	O
=	O
f(Y,a )	O
{	O
f(g(x )	O
,	O
x	O
)	O
=	O
f(y,a )	O
}	O
{	O
x	O
↦	O
a	O
,	O
y	O
↦	O
g(a )	O
}	O
Unifies	O
x	O
with	O
constant	O
a	O
,	O
and	O
y	O
with	O
the	O
term	O
X	O
=	O
f(X )	O
{	O
x	O
=	O
f(x )	O
}	O
should	O
be	O
⊥	O
Returns	O
⊥	O
in	O
first-order	O
logic	O
and	O
many	O
modern	O
Prolog	B-Language
dialects	O
(	O
enforced	O
by	O
the	O
occurs	B-Application
check	I-Application
)	O
.	O
</s>
<s>
Succeeds	O
in	O
traditional	O
Prolog	B-Language
and	O
in	O
Prolog	B-Language
II	I-Language
,	O
unifying	O
x	O
with	O
infinite	O
term	O
x	O
=	O
f( f( f( f( 	O
...	O
)	O
)	O
)	O
)	O
.	O
</s>
<s>
The	O
most	B-Algorithm
general	I-Algorithm
unifier	I-Algorithm
of	O
a	O
syntactic	O
first-order	O
unification	B-Algorithm
problem	O
of	O
size	O
may	O
have	O
a	O
size	O
of	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
problem	O
has	O
the	O
most	B-Algorithm
general	I-Algorithm
unifier	I-Algorithm
,	O
cf	O
.	O
</s>
<s>
In	O
order	O
to	O
avoid	O
exponential	O
time	O
complexity	O
caused	O
by	O
such	O
blow-up	O
,	O
advanced	O
unification	B-Algorithm
algorithms	O
work	O
on	O
directed	O
acyclic	O
graphs	O
(	O
dags	O
)	O
rather	O
than	O
trees	O
.	O
</s>
<s>
The	O
concept	O
of	O
unification	B-Algorithm
is	O
one	O
of	O
the	O
main	O
ideas	O
behind	O
logic	B-Language
programming	I-Language
,	O
best	O
known	O
through	O
the	O
language	O
Prolog	B-Language
.	O
</s>
<s>
In	O
Prolog	B-Language
,	O
this	O
operation	O
is	O
denoted	O
by	O
the	O
equality	O
symbol	O
=	O
,	O
but	O
is	O
also	O
done	O
when	O
instantiating	O
variables	O
(	O
see	O
below	O
)	O
.	O
</s>
<s>
Type	O
inference	O
algorithms	O
are	O
typically	O
based	O
on	O
unification	B-Algorithm
.	O
</s>
<s>
In	O
Prolog	B-Language
:	O
</s>
<s>
no	O
previous	O
unifications	B-Algorithm
were	O
performed	O
on	O
it	O
—	O
can	O
be	O
unified	O
with	O
an	O
atom	O
,	O
a	O
term	O
,	O
or	O
another	O
uninstantiated	O
variable	O
,	O
thus	O
effectively	O
becoming	O
its	O
alias	O
.	O
</s>
<s>
In	O
many	O
modern	O
Prolog	B-Language
dialects	O
and	O
in	O
first-order	O
logic	O
,	O
a	O
variable	O
cannot	O
be	O
unified	O
with	O
a	O
term	O
that	O
contains	O
it	O
;	O
this	O
is	O
the	O
so-called	O
occurs	B-Application
check	I-Application
.	O
</s>
<s>
Similarly	O
,	O
a	O
term	O
can	O
be	O
unified	O
with	O
another	O
term	O
if	O
the	O
top	O
function	B-Language
symbols	I-Language
and	O
arities	O
of	O
the	O
terms	O
are	O
identical	O
and	O
if	O
the	O
parameters	O
can	O
be	O
unified	O
simultaneously	O
.	O
</s>
<s>
Unification	B-Algorithm
is	O
used	O
during	O
type	O
inference	O
for	O
languages	O
with	O
type	O
systems	O
based	O
on	O
Hindley-Milner	B-Algorithm
,	O
including	O
the	O
functional	O
languages	O
Haskell	B-Language
and	O
ML	B-Language
.	O
</s>
<s>
The	O
Haskell	B-Language
expression	O
True	O
:	O
[ 	O
 '	O
x	O
 '	O
,	O
'	O
y	O
 '	O
,	O
'	O
z' ]	O
is	O
not	O
correctly	O
typed	O
.	O
</s>
<s>
The	O
list	O
construction	O
function	O
(	O
:	O
)	O
is	O
of	O
type	O
a	O
->	O
 [ a ] 	O
->	O
[a],	O
and	O
for	O
the	O
first	O
argument	O
True	O
the	O
polymorphic	B-Application
type	O
variable	O
a	O
has	O
to	O
be	O
unified	O
with	O
True	O
's	O
type	O
,	O
Bool	O
.	O
</s>
<s>
Like	O
for	O
Prolog	B-Language
,	O
an	O
algorithm	O
for	O
type	O
inference	O
can	O
be	O
given	O
:	O
</s>
<s>
A	O
specific	O
theory	O
might	O
restrict	O
this	O
rule	O
with	O
an	O
occurs	B-Application
check	I-Application
.	O
</s>
<s>
Due	O
to	O
its	O
declarative	O
nature	O
,	O
the	O
order	O
in	O
a	O
sequence	O
of	O
unifications	B-Algorithm
is	O
(	O
usually	O
)	O
unimportant	O
.	O
</s>
<s>
Note	O
that	O
in	O
the	O
terminology	O
of	O
first-order	O
logic	O
,	O
an	O
atom	O
is	O
a	O
basic	O
proposition	O
and	O
is	O
unified	O
similarly	O
to	O
a	O
Prolog	B-Language
term	O
.	O
</s>
<s>
Unification	B-Algorithm
has	O
been	O
used	O
in	O
different	O
research	O
areas	O
of	O
computational	O
linguistics	O
.	O
</s>
<s>
In	O
order	O
to	O
supply	O
the	O
information	O
that	O
the	O
mother	O
of	O
a	O
dog	O
is	O
a	O
dog	O
in	O
turn	O
,	O
another	O
declaration	O
mother	O
:	O
dog	O
→	O
dog	O
may	O
be	O
issued	O
;	O
this	O
is	O
called	O
function	O
overloading	B-Application
,	O
similar	O
to	O
overloading	B-Application
in	I-Application
programming	I-Application
languages	I-Application
.	O
</s>
<s>
Walther	O
gave	O
a	O
unification	B-Algorithm
algorithm	O
for	O
terms	O
in	O
order-sorted	O
logic	O
,	O
requiring	O
for	O
any	O
two	O
declared	O
sorts	O
s1	O
,	O
s2	O
their	O
intersection	O
s1	O
∩	O
s2	O
to	O
be	O
declared	O
,	O
too	O
:	O
if	O
x1	O
and	O
x2	O
is	O
a	O
variable	O
of	O
sort	O
s1	O
and	O
s2	O
,	O
respectively	O
,	O
the	O
equation	O
x1	O
≐	O
x2	O
has	O
the	O
solution	O
{	O
x1	O
=	O
x	O
,	O
x2	O
=	O
x	O
}	O
,	O
where	O
x	O
:	O
s1	O
∩	O
s2	O
.	O
</s>
<s>
Smolka	O
generalized	O
order-sorted	O
logic	O
to	O
allow	O
for	O
parametric	O
polymorphism	B-Application
.	O
</s>
<s>
(	O
i	O
+	O
i	O
)	O
:	O
even	O
allows	O
to	O
declare	O
a	O
property	O
of	O
integer	O
addition	O
that	O
could	O
not	O
be	O
expressed	O
by	O
ordinary	O
overloading	B-Application
.	O
</s>
<s>
Unification	B-Algorithm
algorithm	O
,	O
Prolog	B-Language
II	I-Language
:	O
</s>
<s>
E-unification	O
is	O
the	O
problem	O
of	O
finding	O
solutions	O
to	O
a	O
given	O
set	O
of	O
equations	O
,	O
</s>
<s>
E-unification	O
algorithms	O
)	O
have	O
been	O
devised	O
;	O
</s>
<s>
with	O
respect	O
to	O
purely	O
syntactic	O
unification	B-Algorithm
,	O
</s>
<s>
It	O
is	O
said	O
that	O
unification	B-Algorithm
is	O
decidable	O
for	O
a	O
theory	O
,	O
if	O
a	O
unification	B-Algorithm
algorithm	O
has	O
been	O
devised	O
for	O
it	O
that	O
terminates	O
for	O
any	O
input	O
problem	O
.	O
</s>
<s>
It	O
is	O
said	O
that	O
unification	B-Algorithm
is	O
semi-decidable	O
for	O
a	O
theory	O
,	O
if	O
a	O
unification	B-Algorithm
algorithm	O
has	O
been	O
devised	O
for	O
it	O
that	O
terminates	O
for	O
any	O
solvable	O
input	O
problem	O
,	O
but	O
may	O
keep	O
searching	O
forever	O
for	O
solutions	O
of	O
an	O
unsolvable	O
input	O
problem	O
.	O
</s>
<s>
Unification	B-Algorithm
is	O
decidable	O
for	O
the	O
following	O
theories	O
:	O
</s>
<s>
Unification	B-Algorithm
is	O
semi-decidable	O
for	O
the	O
following	O
theories	O
:	O
</s>
<s>
Starting	O
with	O
G	O
being	O
the	O
unification	B-Algorithm
problem	O
to	O
be	O
solved	O
and	O
S	O
being	O
the	O
identity	O
substitution	O
,	O
rules	O
are	O
applied	O
nondeterministically	O
until	O
the	O
empty	O
set	O
appears	O
as	O
the	O
actual	O
G	O
,	O
in	O
which	O
case	O
the	O
actual	O
S	O
is	O
a	O
unifying	O
substitution	O
.	O
</s>
<s>
For	O
an	O
example	O
,	O
a	O
term	O
rewrite	O
system	O
R	O
is	O
used	O
defining	O
the	O
append	O
operator	O
of	O
lists	O
built	O
from	O
cons	B-Protocol
and	O
nil	O
;	O
where	O
cons(x,y )	O
is	O
written	O
in	O
infix	O
notation	O
as	O
x.y	O
for	O
brevity	O
;	O
e.g.	O
</s>
<s>
A	O
successful	O
example	O
computation	O
path	O
for	O
the	O
unification	B-Algorithm
problem	O
{	O
app( x	O
,	O
app(y,x )	O
)	O
≐	O
a.a.nil	O
}	O
is	O
shown	O
below	O
.	O
</s>
<s>
Many	O
applications	O
require	O
one	O
to	O
consider	O
the	O
unification	B-Algorithm
of	O
typed	O
lambda-terms	O
instead	O
of	O
first-order	O
terms	O
.	O
</s>
<s>
Such	O
unification	B-Algorithm
is	O
often	O
called	O
higher-order	O
unification	B-Algorithm
.	O
</s>
<s>
Higher-order	O
unification	B-Algorithm
is	O
undecidable	O
,	O
Claudio	O
Lucchesi	O
:	O
The	O
Undecidability	O
of	O
the	O
Unification	B-Algorithm
Problem	O
for	O
Third	O
Order	O
Languages	O
(	O
Research	O
Report	O
CSRR	O
2059	O
;	O
Department	B-General_Concept
of	I-General_Concept
Computer	I-General_Concept
Science	I-General_Concept
,	O
University	O
of	O
Waterloo	O
,	O
1972	O
)	O
and	O
such	O
unification	B-Algorithm
problems	O
do	O
not	O
have	O
most	O
general	O
unifiers	O
.	O
</s>
<s>
solutions	O
{	O
f	O
↦	O
λx.λy.λz.d(y, x, c )	O
}	O
,	O
{	O
f	O
↦	O
λx.λy.λz.d(y, z, c )	O
}	O
,	O
</s>
<s>
{	O
f	O
↦	O
λx.λy.λz.d(y, a, c )	O
}	O
,	O
{	O
f	O
↦	O
λx.λy.λz.d(b, x, c )	O
}	O
,	O
</s>
<s>
{	O
f	O
↦	O
λx.λy.λz.d(b, z, c )	O
}	O
and	O
{	O
f	O
↦	O
λx.λy.λz.d(b, a, c )	O
}	O
.	O
</s>
<s>
A	O
well	O
studied	O
branch	O
of	O
higher-order	O
unification	B-Algorithm
is	O
the	O
problem	O
of	O
unifying	O
simply	O
typed	O
lambda	O
terms	O
modulo	O
the	O
equality	O
determined	O
by	O
αβη	O
conversions	O
.	O
</s>
<s>
Gérard	O
Huet	O
gave	O
a	O
semi-decidable	O
(	O
pre	O
-	O
)	O
unification	B-Algorithm
algorithmGérard	O
Huet	O
:	O
A	O
Unification	B-Algorithm
Algorithm	O
for	O
typed	O
Lambda-Calculus	B-Language
 [  ] 	O
that	O
allows	O
a	O
systematic	O
search	O
of	O
the	O
space	O
of	O
unifiers	O
(	O
generalizing	O
the	O
unification	B-Algorithm
algorithm	O
of	O
Martelli-Montanari	O
with	O
rules	O
for	O
terms	O
containing	O
higher-order	O
variables	O
)	O
that	O
seems	O
to	O
work	O
sufficiently	O
well	O
in	O
practice	O
.	O
</s>
<s>
HuetGérard	O
Huet	O
:	O
Higher	O
Order	O
Unification	B-Algorithm
30	O
Years	O
Later	O
and	O
Gilles	O
DowekGilles	O
Dowek	O
:	O
Higher-Order	O
Unification	B-Algorithm
and	O
Matching	O
.	O
</s>
<s>
Several	O
subsets	O
of	O
higher-order	O
unification	B-Algorithm
are	O
well-behaved	O
,	O
in	O
that	O
they	O
are	O
decidable	O
and	O
have	O
a	O
most-general	O
unifier	O
for	O
solvable	O
problems	O
.	O
</s>
<s>
Higher-order	O
pattern	O
unification	B-Algorithm
,	O
due	O
to	O
Dale	O
Miller	O
,	O
is	O
another	O
such	O
subset	O
.	O
</s>
<s>
The	O
higher-order	O
logic	B-Language
programming	I-Language
languages	I-Language
λProlog	B-Language
and	O
Twelf	B-Application
have	O
switched	O
from	O
full	O
higher-order	O
unification	B-Algorithm
to	O
implementing	O
only	O
the	O
pattern	O
fragment	O
;	O
surprisingly	O
pattern	O
unification	B-Algorithm
is	O
sufficient	O
for	O
almost	O
all	O
programs	O
,	O
if	O
each	O
non-pattern	O
unification	B-Algorithm
problem	O
is	O
suspended	O
until	O
a	O
subsequent	O
substitution	O
puts	O
the	O
unification	B-Algorithm
into	O
the	O
pattern	O
fragment	O
.	O
</s>
<s>
A	O
superset	O
of	O
pattern	O
unification	B-Algorithm
called	O
functions-as-constructors	O
unification	B-Algorithm
is	O
also	O
well-behaved	O
.	O
</s>
<s>
The	O
Zipperposition	O
theorem	O
prover	O
has	O
an	O
algorithm	O
integrating	O
these	O
well-behaved	O
subsets	O
into	O
a	O
full	O
higher-order	O
unification	B-Algorithm
algorithm	O
.	O
</s>
<s>
In	O
computational	O
linguistics	O
,	O
one	O
of	O
the	O
most	O
influential	O
theories	O
of	O
elliptical	O
construction	O
is	O
that	O
ellipses	O
are	O
represented	O
by	O
free	O
variables	O
whose	O
values	O
are	O
then	O
determined	O
using	O
Higher-Order	O
Unification	B-Algorithm
(	O
HOU	O
)	O
.	O
</s>
<s>
The	O
process	O
of	O
solving	O
such	O
equations	O
is	O
called	O
Higher-Order	O
Unification	B-Algorithm
.	O
</s>
<s>
Wayne	O
Snyder	O
gave	O
a	O
generalization	O
of	O
both	O
higher-order	O
unification	B-Algorithm
and	O
E-unification	O
,	O
i.e.	O
</s>
<s>
"	O
Unification	B-Algorithm
Theory	O
"	O
.	O
</s>
<s>
"	O
Higher-order	O
Unification	B-Algorithm
and	O
Matching	O
"	O
.	O
</s>
<s>
"	O
Unification	B-Algorithm
Theory	O
"	O
.	O
</s>
<s>
In	O
Handbook	O
of	O
Logic	O
in	O
Artificial	O
Intelligence	O
and	O
Logic	B-Language
Programming	I-Language
.	O
</s>
<s>
"	O
Solving	O
Equations	O
in	O
Abstract	O
Algebras	O
:	O
A	O
Rule-Based	B-Language
Survey	O
of	O
Unification	B-Algorithm
"	O
.	O
</s>
<s>
)	O
,	O
Handbook	O
of	O
Theoretical	O
Computer	B-General_Concept
Science	I-General_Concept
,	O
volume	O
B	O
Formal	O
Models	O
and	O
Semantics	O
,	O
Elsevier	O
,	O
1990	O
,	O
pp	O
.	O
</s>
<s>
"	O
Unification	B-Algorithm
Theory	O
"	O
.	O
</s>
<s>
In	O
Claude	O
Kirchner	O
(	O
editor	O
)	O
Unification	B-Algorithm
.	O
</s>
