else
ug,ul,obj
| None ->
- CicUnivUtils.clean_and_fill uri obj inferred_ugraph
+ CicUnivUtils.clean_and_fill uri obj inferred_ugraph
;;
let debrujin_constructor ?(cb=fun _ _ -> ()) ?(check_exp_named_subst=true) uri number_of_types context =
exception CicEnvironmentError;;
-let rec type_of_constant ~logger uri ugraph =
+let rec type_of_constant ~logger uri (ugraph as orig_ugraph) =
let module C = Cic in
let module R = CicReduction in
let module U = UriManager in
let ugraph, ul, obj = check_and_clean_ugraph inferred_ugraph unchecked_ugraph uri uobj in
CicEnvironment.set_type_checking_info uri (obj, ugraph, ul);
logger#log (`Type_checking_completed uri) ;
- match CicEnvironment.is_type_checked ~trust:false ugraph uri with
+ match CicEnvironment.is_type_checked ~trust:false orig_ugraph uri with
CicEnvironment.CheckedObj (cobj,ugraph') -> cobj,ugraph'
| CicEnvironment.UncheckedObj _ -> raise CicEnvironmentError
in
| _ ->
raise (TypeCheckerFailure (lazy ("Unknown constant:" ^ U.string_of_uri uri)))
-and type_of_variable ~logger uri ugraph =
+and type_of_variable ~logger uri (ugraph as orig_ugraph) =
let module C = Cic in
let module R = CicReduction in
let module U = UriManager in
let ugraph, ul, obj = check_and_clean_ugraph inferred_ugraph unchecked_ugraph uri uobj in
CicEnvironment.set_type_checking_info uri (obj, ugraph, ul);
logger#log (`Type_checking_completed uri) ;
- (match CicEnvironment.is_type_checked ~trust:false ugraph uri with
+ (match CicEnvironment.is_type_checked ~trust:false orig_ugraph uri with
CicEnvironment.CheckedObj((C.Variable(_,_,ty,_,_)),ugraph)->ty,ugraph
| CicEnvironment.CheckedObj _
| CicEnvironment.UncheckedObj _ -> raise CicEnvironmentError)
lazy ("Unknown mutual inductive definition:" ^
UriManager.string_of_uri uri)))
-and type_of_mutual_inductive_defs ~logger uri i ugraph =
+and type_of_mutual_inductive_defs ~logger uri i (ugraph as orig_ugraph) =
let module C = Cic in
let module R = CicReduction in
let module U = UriManager in
let ugraph, ul, obj = check_and_clean_ugraph inferred_ugraph unchecked_ugraph uri uobj in
CicEnvironment.set_type_checking_info uri (obj,ugraph,ul);
logger#log (`Type_checking_completed uri) ;
- (match CicEnvironment.is_type_checked ~trust:false ugraph uri with
+ (match CicEnvironment.is_type_checked ~trust:false orig_ugraph uri with
CicEnvironment.CheckedObj (cobj,ugraph') -> (cobj,ugraph')
| CicEnvironment.UncheckedObj _ -> raise CicEnvironmentError
)
raise (TypeCheckerFailure
(lazy ("Unknown mutual inductive definition:" ^ U.string_of_uri uri)))
-and type_of_mutual_inductive_constr ~logger uri i j ugraph =
+and type_of_mutual_inductive_constr ~logger uri i j (ugraph as orig_ugraph) =
let module C = Cic in
let module R = CicReduction in
let module U = UriManager in
CicEnvironment.set_type_checking_info uri (obj, ugraph, ul);
logger#log (`Type_checking_completed uri) ;
(match
- CicEnvironment.is_type_checked ~trust:false ugraph uri
+ CicEnvironment.is_type_checked ~trust:false orig_ugraph uri
with
CicEnvironment.CheckedObj (cobj,ugraph') -> cobj,ugraph'
| CicEnvironment.UncheckedObj _ ->
let ugraph, ul, obj = typecheck_obj0 ~logger uri (uobj,unchecked_ugraph) in
CicEnvironment.set_type_checking_info uri (obj,ugraph,ul);
logger#log (`Type_checking_completed uri);
- match CicEnvironment.is_type_checked ~trust:false ugraph uri with
+ match CicEnvironment.is_type_checked ~trust:false CicUniv.empty_ugraph uri with
| CicEnvironment.CheckedObj (cobj,ugraph') -> cobj,ugraph'
| _ -> raise CicEnvironmentError
;;