aboutsummaryrefslogtreecommitdiff
path: root/plugins/extraction
diff options
context:
space:
mode:
authorletouzey2013-10-24 21:29:41 +0000
committerletouzey2013-10-24 21:29:41 +0000
commit6da011a8677676462b24940a6171fb22615c3fbb (patch)
tree0df385cc8b8d72b3465d7745d2b97283245c7ed5 /plugins/extraction
parent133a2143413a723d1d4e3dead5ffa8458f61afa8 (diff)
More monomorphic List.mem + List.assoc + ...
To reduce the amount of syntactic noise, we now provide a few inner modules Int.List, Id.List, String.List, Sorts.List which contain some monomorphic (or semi-monomorphic) functions such as mem, assoc, ... NB: for Int.List.mem and co we reuse List.memq and so on. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16936 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/extraction')
-rw-r--r--plugins/extraction/extraction.ml8
-rw-r--r--plugins/extraction/mlutil.ml2
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/extraction/extraction.ml b/plugins/extraction/extraction.ml
index 947a1a482d..c6bb9faa06 100644
--- a/plugins/extraction/extraction.ml
+++ b/plugins/extraction/extraction.ml
@@ -141,7 +141,8 @@ let sign_with_implicits r s nb_params =
| [] -> []
| sign::s ->
let sign' =
- if sign == Keep && List.mem i implicits then Kill Kother else sign
+ if sign == Keep && Int.List.mem i implicits
+ then Kill Kother else sign
in sign' :: add_impl (succ i) s
in
add_impl (1+nb_params) s
@@ -657,7 +658,8 @@ and extract_cst_app env mle mlt kn args =
(* Can we instantiate types variables for this constant ? *)
(* In Ocaml, inside the definition of this constant, the answer is no. *)
let instantiated =
- if lang () == Ocaml && List.mem kn !current_fixpoints then var2var' (snd schema)
+ if lang () == Ocaml && List.mem_f Constant.equal kn !current_fixpoints
+ then var2var' (snd schema)
else instantiation schema
in
(* Then the expected type of this constant. *)
@@ -1048,7 +1050,7 @@ let extract_inductive env kn =
| [] -> []
| t::l ->
let l' = filter (succ i) l in
- if isDummy (expand env t) || List.mem i implicits then l'
+ if isDummy (expand env t) || Int.List.mem i implicits then l'
else t::l'
in filter (1+ind.ind_nparams) l
in
diff --git a/plugins/extraction/mlutil.ml b/plugins/extraction/mlutil.ml
index 1e6a1fffcc..22e7080e14 100644
--- a/plugins/extraction/mlutil.ml
+++ b/plugins/extraction/mlutil.ml
@@ -1005,7 +1005,7 @@ let kill_some_lams bl (ids,c) =
let kill_dummy_lams c =
let ids,c = collect_lams c in
let bl = List.map sign_of_id ids in
- if not (List.mem Keep bl) then raise Impossible;
+ if not (List.memq Keep bl) then raise Impossible;
let rec fst_kill n = function
| [] -> raise Impossible
| Kill _ :: bl -> n