let unopt exc = function None -> raise exc | Some x -> x ;;
-let fix (status:#NCic.status) metasenv subst is_sup test_eq_only exc t =
+let fix (status:#NCicEnvironment.status) metasenv subst is_sup test_eq_only exc t =
(*D*) inside 'f'; try let rc =
pp (lazy (status#ppterm ~metasenv ~subst ~context:[] t));
let rec aux test_eq_only metasenv = function
metasenv,orig
| NCic.Sort (NCic.Type _) when test_eq_only -> raise exc
| NCic.Sort (NCic.Type u) when is_sup ->
- metasenv, NCic.Sort (NCic.Type (unopt exc (NCicEnvironment.sup u)))
+ metasenv, NCic.Sort (NCic.Type (unopt exc (NCicEnvironment.sup status u)))
| NCic.Sort (NCic.Type u) ->
metasenv, NCic.Sort (NCic.Type
- (unopt exc (NCicEnvironment.inf ~strict:false u)))
+ (unopt exc (NCicEnvironment.inf status ~strict:false u)))
| NCic.Meta (n,_) as orig ->
(try
let _,_,_,_ = NCicUtils.lookup_subst n subst in metasenv,orig
match s,swap with
NCic.Type u2, false ->
NCic.Sort (NCic.Type
- (unopt exc (NCicEnvironment.inf ~strict:false
- (unopt exc (NCicEnvironment.inf ~strict:true u1) @ u2))))
+ (unopt exc (NCicEnvironment.inf status ~strict:false
+ (unopt exc (NCicEnvironment.inf status ~strict:true u1) @ u2))))
| NCic.Type u2, true ->
- if NCicEnvironment.universe_lt u2 u1 then
+ if NCicEnvironment.universe_lt status u2 u1 then
NCic.Sort (NCic.Type u2)
else (raise exc)
| NCic.Prop,_ -> NCic.Sort NCic.Prop
assert false
| (C.Sort (C.Type a), C.Sort (C.Type b)) when not test_eq_only ->
let a, b = if swap then b,a else a,b in
- if NCicEnvironment.universe_leq a b then metasenv, subst
+ if NCicEnvironment.universe_leq status a b then metasenv, subst
else raise (UnificationFailure (mk_msg status metasenv subst context t1 t2))
| (C.Sort (C.Type a), C.Sort (C.Type b)) ->
if NCicEnvironment.universe_eq a b then metasenv, subst
let tym = NCicSubstitution.subst_meta status lc tym in
match tyn,tym with
NCic.Sort NCic.Type u1, NCic.Sort NCic.Type u2 ->
- NCicEnvironment.universe_lt u1 u2
+ NCicEnvironment.universe_lt status u1 u2
| _,_ -> false ->
instantiate status test_eq_only metasenv subst context m lc'
(NCicReduction.head_beta_reduce status ~subst t1) (not swap)