module Founif (B : Terms.Blob) = struct
module Subst = Subst.Subst(B)
+ module U = Terms.Utils(B)
let unification vars locked_vars t1 t2 =
let lookup = Subst.lookup_subst in
| Terms.Var i when i = what -> true
| Terms.Var _ ->
let t = lookup where subst in
- if t <> where then occurs_check subst what t else false
+ if not (U.eq_foterm t where) then occurs_check subst what t else false
| Terms.Node l -> List.exists (occurs_check subst what) l
| _ -> false
in
in
match s, t with
- | s, t when s = t -> subst, vars
+ | s, t when U.eq_foterm s t -> subst, vars
| Terms.Var i, Terms.Var j
when (List.mem i locked_vars) &&(List.mem j locked_vars) ->
raise
let subst = Subst.buildsubst i t subst in
subst, vars
| _, Terms.Var _ -> unif subst vars t s
- | Terms.Node (hds::_), Terms.Node (hdt::_) when hds <> hdt ->
+ | Terms.Node (hds::_),Terms.Node (hdt::_) when not(U.eq_foterm hds hdt)->
raise (UnificationFailure (lazy "Inference.unification.unif"))
| Terms.Node (hds::tls), Terms.Node (hdt::tlt) -> (
try