aboutsummaryrefslogtreecommitdiff
path: root/plugins/extraction/table.ml
diff options
context:
space:
mode:
authoraspiwack2012-08-24 17:36:32 +0000
committeraspiwack2012-08-24 17:36:32 +0000
commit6a2f9c59ea44d754050b4a2ccb624adcc846924d (patch)
tree7194d6d7e3a30853a914ae8c5f806c31b80c3931 /plugins/extraction/table.ml
parentc0b484e5ea6118b43e459190c02cc5a4261d0328 (diff)
Add option Set/Unset Extraction Conservative Types.
Extracted code need not preserve typing relations (e:t) from the source code. This may be a problem as the extracted code may not implement the intented interface. This option disables the optimisations which would prevent an extracted term's type to be its extracted source term's type. At this point the only such optimization is (I think) removing some dummy λ-abstractions in constant definitions. Extraction Implicit is still honored in this mode, and it's mostly necessary to produce reasonable types. So in the conservative type mode, which abstractions can be removed and which can'tt is entirely under the user's control. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15762 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/extraction/table.ml')
-rw-r--r--plugins/extraction/table.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/extraction/table.ml b/plugins/extraction/table.ml
index d785fdde92..3fb183995d 100644
--- a/plugins/extraction/table.ml
+++ b/plugins/extraction/table.ml
@@ -533,6 +533,19 @@ let _ = declare_int_option
| None -> chg_flag 0
| Some i -> chg_flag (max i 0))}
+(* This option controls whether "dummy lambda" are removed when a
+ toplevel constant is defined. *)
+let conservative_types_ref = ref false
+let conservative_types () = !conservative_types_ref
+
+let _ = declare_bool_option
+ {optsync = true;
+ optdepr = false;
+ optname = "Extraction Conservative Types";
+ optkey = ["Extraction"; "Conservative"; "Types"];
+ optread = (fun () -> !conservative_types_ref);
+ optwrite = (fun b -> conservative_types_ref := b) }
+
(*s Extraction Lang *)