(* First possibility: restriction *)
(* Second possibility: unification *)
(* Third possibility: convertibility *)
- R.are_convertible subst context t1' t2'
+ R.are_convertible metasenv subst context t1' t2'
) true ln lm
in
if ok then
let lifted_oldt = S.lift_meta l oldt in
fo_unif_subst subst context metasenv lifted_oldt t
with Not_found ->
- let t',metasenv' = CicMetaSubst.delift context metasenv l t in
+ let t',metasenv' = CicMetaSubst.delift n subst context metasenv l t in
(n, t')::subst, metasenv'
in
- let (_,_,meta_type) =
- List.find (function (m,_,_) -> m=n) metasenv' in
+ let (_,_,meta_type) = CicUtil.lookup_meta n metasenv' in
let tyt = type_of_aux' metasenv' subst' context t in
fo_unif_subst subst' context metasenv' (S.lift_meta l meta_type) tyt
| (C.Var (uri1,exp_named_subst1),C.Var (uri2,exp_named_subst2))
| (C.MutConstruct _, _) | (_, C.MutConstruct _)
| (C.Fix _, _) | (_, C.Fix _)
| (C.CoFix _, _) | (_, C.CoFix _) ->
- if R.are_convertible subst context t1 t2 then
+ if R.are_convertible metasenv subst context t1 t2 then
subst, metasenv
else
raise (UnificationFailure (sprintf
"Can't unify %s with %s because they are not convertible"
(CicPp.ppterm t1) (CicPp.ppterm t2)))
| (_,_) ->
- if R.are_convertible subst context t1 t2 then
+ if R.are_convertible metasenv subst context t1 t2 then
subst, metasenv
else
raise (UnificationFailure (sprintf