check_and_clean_ugraph inferred_ugraph unchecked_ugraph uri obj
;;
-let typecheck uri =
+let typecheck ?(trust=true) uri =
let module C = Cic in
let module R = CicReduction in
let module U = UriManager in
let logger = new CicLogger.logger in
- match CicEnvironment.is_type_checked ~trust:false CicUniv.empty_ugraph uri with
+ match CicEnvironment.is_type_checked ~trust CicUniv.empty_ugraph uri with
| CicEnvironment.CheckedObj (cobj,ugraph') -> cobj,ugraph'
| CicEnvironment.UncheckedObj (uobj,unchecked_ugraph) ->
(* let's typecheck the uncooked object *)
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 CicUniv.empty_ugraph uri with
+ match CicEnvironment.is_type_checked ~trust CicUniv.empty_ugraph uri with
| CicEnvironment.CheckedObj (cobj,ugraph') -> cobj,ugraph'
| _ -> raise CicEnvironmentError
;;
?check_exp_named_subst: bool ->
UriManager.uri -> int -> Cic.context -> Cic.term -> Cic.term
-val typecheck : UriManager.uri -> Cic.obj * CicUniv.universe_graph
+ (* defaults to true *)
+val typecheck :
+ ?trust:bool -> UriManager.uri -> Cic.obj * CicUniv.universe_graph
(* FUNCTIONS USED ONLY IN THE TOPLEVEL *)
BIN_DIR = /usr/local/bin
REQUIRES = helm-cic_proof_checking http
PREDICATES =
-OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread
+OCAMLOPTIONS = -package "$(REQUIRES)" -predicates "$(PREDICATES)" -thread -rectypes
ifeq ($(origin OCAMLPATH), undefined)
OCAMLFIND = OCAMLPATH=../../components/METAS ocamlfind
else
fprintf outchan' "%s" (html_preamble uri);
flush outchan';
(try
- ignore (CicTypeChecker.typecheck (UriManager.uri_of_string uri));
+ ignore (CicTypeChecker.typecheck ~trust:false
+ (UriManager.uri_of_string uri));
with e ->
fprintf outchan' "%s\n" (Printexc.to_string e);
flush outchan');