[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Apr 5 11:38:03 1993 
Subject:Re: **** looking for implementation of unification algorithm **** 
From:Jonas Barklund 
Volume-ID:930405.01 

> > I'm just curious, but is there a difference between the Martinelli and
> > Montanari unification algorithm and the unification algorithm seen
> > in Prolog?
> 
> In short, the Martelli/Montanari algorithm includes the occurs check and always
> runs in linear time. The vanilla unification algorithm used in many Prolog
> systems omits the occurs check, which makes it faster when processing most
> terms (those on which it, too, can run in linear time), but it can take
> exponential running time in some situations.

Moreover, Martelli-Montanari's algorithm, as well as all proposed
unification _algorithms_ always terminates. Prolog's unification procedure
does not necessarily terminate. But when it works it is usually much
more efficient than, e.g., Martelli-Montanari, or Huet's or basically
any other algorithm. A bit like the difference between applicative-order
and normal-order in functional programming, really.

-- Jonas B.

--
Jonas Barklund, Ph.D., lecturer, Uppsala University, Computing Science Dept.
Email jonas@csd.uu.se, phone +46-18-181050, fax +46-18-521270