val frozen_to_cooked :
uri:UriManager.uri -> unit
val find_cooked : key:UriManager.uri -> Cic.obj
+ val add_cooked : key:UriManager.uri -> Cic.obj -> unit
end
=
struct
Not_found -> raise (CouldNotUnfreeze (UriManager.string_of_uri uri))
;;
let find_cooked ~key:uri = CacheOfCookedObjects.find uri;;
+ let add_cooked ~key:uri obj = CacheOfCookedObjects.add uri obj;;
end
;;
Not_found ->
find_or_add_unchecked_to_cache uri
;;
+
+exception OnlyPutOfInductiveDefinitionsIsAllowed
+
+let put_inductive_definition uri obj =
+ match obj with
+ Cic.InductiveDefinition _ -> Cache.add_cooked uri obj
+ | _ -> raise OnlyPutOfInductiveDefinitionsIsAllowed
+;;
(* again in the future (is_type_checked will return true) *)
val set_type_checking_info : UriManager.uri -> unit
-(* get_cooked_obj ~trust uri *)
+(* get_cooked_obj ~trust uri *)
(* returns the object if it is already type-checked or if it can be *)
(* trusted (if [trust] = true and the trusting function accepts it) *)
(* Otherwise it raises Not_found *)
val get_cooked_obj : ?trust:bool -> UriManager.uri -> Cic.obj
+
+(* FUNCTIONS USED ONLY IN THE TOPLEVEL/PROOF-ENGINE *)
+
+exception OnlyPutOfInductiveDefinitionsIsAllowed
+
+(* put_inductive_definition uri obj *)
+(* put [obj] (that must be an InductiveDefinition and show URI is [uri]) *)
+(* in the environment. *)
+(* WARNING: VERY UNSAFE. *)
+(* This function should be called only on a well-typed definition. *)
+val put_inductive_definition : UriManager.uri -> Cic.obj -> unit