raise (MetaSubstFailure ("Weak head reduction failure: " ^
Printexc.to_string e))
+let are_convertible subst context t1 t2 =
+ let context = apply_subst_context subst context in
+ let (t1, t2) = (apply_subst subst t1, apply_subst subst t2) in
+ CicReduction.are_convertible context t1 t2
+
let type_of_aux' metasenv subst context term =
let term = apply_subst subst term in
let context = apply_subst_context subst context in
* the calculus *)
val whd: substitution -> Cic.context -> Cic.term -> Cic.term
+val are_convertible:
+ substitution -> Cic.context -> Cic.term -> Cic.term ->
+ bool
val type_of_aux':
- Cic.metasenv -> substitution -> Cic.context -> Cic.term -> Cic.term
+ Cic.metasenv -> substitution -> Cic.context -> Cic.term ->
+ Cic.term
let rec fo_unif_subst subst context metasenv t1 t2 =
let module C = Cic in
- let module R = CicReduction in
+ let module R = CicMetaSubst in
let module S = CicSubstitution in
match (t1, t2) with
(C.Meta (n,ln), C.Meta (m,lm)) when n=m ->
(* First possibility: restriction *)
(* Second possibility: unification *)
(* Third possibility: convertibility *)
- R.are_convertible context t1' t2'
+ R.are_convertible subst context t1' t2'
) true ln lm
in
if ok then
| (C.MutConstruct _, _) | (_, C.MutConstruct _)
| (C.Fix _, _) | (_, C.Fix _)
| (C.CoFix _, _) | (_, C.CoFix _) ->
- if R.are_convertible context t1 t2 then
+ if R.are_convertible 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 context t1 t2 then
+ if R.are_convertible subst context t1 t2 then
subst, metasenv
else
raise (UnificationFailure (sprintf