From 15b6c9b6fa268a9af6dd4f05961e469545e92a6f Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Mon, 24 Feb 2014 20:46:32 +0100 Subject: Lazyconstr -> Opaqueproof Make this module deal only with opaque proofs. Make discharging/substitution invariant more explicit via a third constructor. --- kernel/opaqueproof.mli | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 kernel/opaqueproof.mli (limited to 'kernel/opaqueproof.mli') diff --git a/kernel/opaqueproof.mli b/kernel/opaqueproof.mli new file mode 100644 index 000000000..957889aa9 --- /dev/null +++ b/kernel/opaqueproof.mli @@ -0,0 +1,68 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* opaque + +(** Turn a direct [opaque] into an indirect one, also hashconses constr *) +val turn_indirect : opaque -> opaque + +(** From a [opaque] back to a [constr]. This might use the + indirect opaque accessor configured below. *) +val force_proof : opaque -> constr +val force_constraints : opaque -> Univ.constraints +val get_proof : opaque -> Term.constr Future.computation +val get_constraints : opaque -> Univ.constraints Future.computation option + +val subst_opaque : substitution -> opaque -> opaque +val iter_direct_opaque : (constr -> unit) -> opaque -> opaque + +type work_list = Id.t array Cmap.t * Id.t array Mindmap.t +type cooking_info = { modlist : work_list; abstract : Context.named_context } + +(* The type has two caveats: + 1) cook_constr is defined after + 2) we have to store the input in the [opaque] in order to be able to + discharge it when turning a .vi into a .vo *) +val discharge_direct_opaque : + cook_constr:(constr -> constr) -> cooking_info -> opaque -> opaque + +val join_opaque : opaque -> unit + +(** When stored indirectly, opaque terms are indexed by their library + dirpath and an integer index. The following two functions activate + this indirect storage, by telling how to store and retrieve terms. + Default creator always returns [None], preventing the creation of + any indirect link, and default accessor always raises an error. +*) + +val set_indirect_creator : + (cooking_info list * proofterm -> (DirPath.t * int) option) -> unit +val set_indirect_opaque_accessor : + (DirPath.t -> int -> Term.constr Future.computation) -> unit +val set_indirect_univ_accessor : + (DirPath.t -> int -> Univ.constraints Future.computation option) -> unit +val set_join_indirect_local_opaque : (DirPath.t -> int -> unit) -> unit +val set_join_indirect_local_univ : (DirPath.t -> int -> unit) -> unit +val reset_indirect_creator : unit -> unit -- cgit v1.2.3