From a0cfa4f118023d35b767a999d5a2ac4b082857b4 Mon Sep 17 00:00:00 2001 From: Samuel Mimram Date: Fri, 25 Jul 2008 15:12:53 +0200 Subject: Imported Upstream version 8.2~beta3+dfsg --- kernel/retroknowledge.mli | 154 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 kernel/retroknowledge.mli (limited to 'kernel/retroknowledge.mli') diff --git a/kernel/retroknowledge.mli b/kernel/retroknowledge.mli new file mode 100644 index 00000000..ee3fccd5 --- /dev/null +++ b/kernel/retroknowledge.mli @@ -0,0 +1,154 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* entry -> Cbytecodes.comp_env -> + constr array -> + int -> Cbytecodes.bytecodes-> Cbytecodes.bytecodes +(*Given an identifier id (usually Construct _) + and its argument array, returns a function that tries an ad-hoc optimisated + compilation (in the case of the 31-bit integers it means compiling them + directly into an integer) + raises Not_found if id should be compiled as usual, and expectingly + CBytecodes.NotClosed if the term is not a closed constructor pattern + (a constant for the compiler) *) +val get_vm_constant_static_info : retroknowledge -> entry -> + constr array -> + Cbytecodes.structured_constant + +(*Given an identifier id (usually Construct _ ) + its argument array and a continuation, returns the compiled version + of id+args+cont when id has a specific treatment (in the case of + 31-bit integers, that would be the dynamic compilation into integers) + or raises Not_found if id should be compiled as usual *) +val get_vm_constant_dynamic_info : retroknowledge -> entry -> + Cbytecodes.comp_env -> + Cbytecodes.block array -> + int -> Cbytecodes.bytecodes -> Cbytecodes.bytecodes +(* Given a type identifier, this function is used before compiling a match + over this type. In the case of 31-bit integers for instance, it is used + to add the instruction sequence which would perform a dynamic decompilation + in case the argument of the match is not in coq representation *) +val get_vm_before_match_info : retroknowledge -> entry -> Cbytecodes.bytecodes + -> Cbytecodes.bytecodes + +(* Given a type identifier, this function is used by pretyping/vnorm.ml to + recover the elements of that type from their compiled form if it's non + standard (it is used (and can be used) only when the compiled form + is not a block *) +val get_vm_decompile_constant_info : retroknowledge -> entry -> int -> Term.constr + + +(* the following functions are solely used in Pre_env and Environ to implement + the functions register and unregister (and mem) of Environ *) +val add_field : retroknowledge -> field -> entry -> retroknowledge +val mem : retroknowledge -> field -> bool +val remove : retroknowledge -> field -> retroknowledge +val find : retroknowledge -> field -> entry + +(* the following function manipulate the reactive information of values + they are only used by the functions of Pre_env, and Environ to implement + the functions register and unregister of Environ *) +val add_vm_compiling_info : retroknowledge-> entry -> + (bool -> Cbytecodes.comp_env -> constr array -> int -> + Cbytecodes.bytecodes -> Cbytecodes.bytecodes) -> + retroknowledge +val add_vm_constant_static_info : retroknowledge-> entry -> + (bool->constr array-> + Cbytecodes.structured_constant) -> + retroknowledge +val add_vm_constant_dynamic_info : retroknowledge-> entry -> + (bool -> Cbytecodes.comp_env -> + Cbytecodes.block array -> int -> + Cbytecodes.bytecodes -> Cbytecodes.bytecodes) -> + retroknowledge +val add_vm_before_match_info : retroknowledge -> entry -> + (bool->Cbytecodes.bytecodes->Cbytecodes.bytecodes) -> + retroknowledge + +val add_vm_decompile_constant_info : retroknowledge -> entry -> + (int -> constr) -> retroknowledge + + +val clear_info : retroknowledge-> entry -> retroknowledge + + + -- cgit v1.2.3