aboutsummaryrefslogtreecommitdiff
path: root/plugins/extraction
diff options
context:
space:
mode:
authorppedrot2012-12-14 10:56:41 +0000
committerppedrot2012-12-14 10:56:41 +0000
commit9a0c61b81a2d9c0024b20a6c7ad8af01026739b0 (patch)
tree36d6f581d692180f12d52f872da4d35662aee2ab /plugins/extraction
parent9330bf650ca602884c5c4c69c2fb3e94ee32838b (diff)
Moved Intset and Intmap to Int namespace.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16067 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/extraction')
-rw-r--r--plugins/extraction/extraction.ml8
-rw-r--r--plugins/extraction/mlutil.ml20
2 files changed, 14 insertions, 14 deletions
diff --git a/plugins/extraction/extraction.ml b/plugins/extraction/extraction.ml
index cc2ef96dd5..6645f1d5d3 100644
--- a/plugins/extraction/extraction.ml
+++ b/plugins/extraction/extraction.ml
@@ -169,7 +169,7 @@ let db_from_sign s =
let rec db_from_ind dbmap i =
if i = 0 then []
- else (try Intmap.find i dbmap with Not_found -> 0)::(db_from_ind dbmap (i-1))
+ else (try Int.Map.find i dbmap with Not_found -> 0)::(db_from_ind dbmap (i-1))
(*s [parse_ind_args] builds a map: [i->j] iff the i-th Coq argument
of a constructor corresponds to the j-th type var of the ML inductive. *)
@@ -183,11 +183,11 @@ let rec db_from_ind dbmap i =
let parse_ind_args si args relmax =
let rec parse i j = function
- | [] -> Intmap.empty
+ | [] -> Int.Map.empty
| Kill _ :: s -> parse (i+1) j s
| Keep :: s ->
(match kind_of_term args.(i-1) with
- | Rel k -> Intmap.add (relmax+1-k) j (parse (i+1) (j+1) s)
+ | Rel k -> Int.Map.add (relmax+1-k) j (parse (i+1) (j+1) s)
| _ -> parse (i+1) (j+1) s)
in parse 1 1 si
@@ -493,7 +493,7 @@ and extract_type_cons env db dbmap c i =
match kind_of_term (whd_betadeltaiota env none c) with
| Prod (n,t,d) ->
let env' = push_rel_assum (n,t) env in
- let db' = (try Intmap.find i dbmap with Not_found -> 0) :: db in
+ let db' = (try Int.Map.find i dbmap with Not_found -> 0) :: db in
let l = extract_type_cons env' db' dbmap d (i+1) in
(extract_type env db 0 t []) :: l
| _ -> []
diff --git a/plugins/extraction/mlutil.ml b/plugins/extraction/mlutil.ml
index b53fec23e5..18c3f840ee 100644
--- a/plugins/extraction/mlutil.ml
+++ b/plugins/extraction/mlutil.ml
@@ -171,12 +171,12 @@ module Mlenv = struct
let generalization mle t =
let c = ref 0 in
- let map = ref (Intmap.empty : int Intmap.t) in
- let add_new i = incr c; map := Intmap.add i !c !map; !c in
+ let map = ref (Int.Map.empty : int Int.Map.t) in
+ let add_new i = incr c; map := Int.Map.add i !c !map; !c in
let rec meta2var t = match t with
| Tmeta {contents=Some u} -> meta2var u
| Tmeta ({id=i} as m) ->
- (try Tvar (Intmap.find i !map)
+ (try Tvar (Int.Map.find i !map)
with Not_found ->
if Metaset.mem m mle.free then t
else Tvar (add_new i))
@@ -731,14 +731,14 @@ let census_add, census_max, census_clean =
let h = Hashtbl.create 13 in
let clear () = Hashtbl.clear h in
let add e i =
- let s = try Hashtbl.find h e with Not_found -> Intset.empty in
- Hashtbl.replace h e (Intset.add i s)
+ let s = try Hashtbl.find h e with Not_found -> Int.Set.empty in
+ Hashtbl.replace h e (Int.Set.add i s)
in
let max e0 =
- let len = ref 0 and lst = ref Intset.empty and elm = ref e0 in
+ let len = ref 0 and lst = ref Int.Set.empty and elm = ref e0 in
Hashtbl.iter
(fun e s ->
- let n = Intset.cardinal s in
+ let n = Int.Set.cardinal s in
if n > !len then begin len := n; lst := s; elm := e end)
h;
(!elm,!lst)
@@ -766,7 +766,7 @@ let factor_branches o typ br =
done;
let br_factor, br_set = census_max MLdummy in
census_clean ();
- let n = Intset.cardinal br_set in
+ let n = Int.Set.cardinal br_set in
if n = 0 then None
else if Array.length br >= 2 && n < 2 then None
else Some (br_factor, br_set)
@@ -945,7 +945,7 @@ and simpl_case o typ br e =
if lang() = Scheme || is_custom_match br
then MLcase (typ, e, br)
else match factor_branches o typ br with
- | Some (f,ints) when Intset.cardinal ints = Array.length br ->
+ | Some (f,ints) when Int.Set.cardinal ints = Array.length br ->
(* If all branches have been factorized, we remove the match *)
simpl o (MLletin (Tmp anonymous_name, e, f))
| Some (f,ints) ->
@@ -954,7 +954,7 @@ and simpl_case o typ br e =
else ([], Pwild, ast_pop f)
in
let brl = Array.to_list br in
- let brl_opt = List.filteri (fun i _ -> not (Intset.mem i ints)) brl in
+ let brl_opt = List.filteri (fun i _ -> not (Int.Set.mem i ints)) brl in
let brl_opt = brl_opt @ [last_br] in
MLcase (typ, e, Array.of_list brl_opt)
| None -> MLcase (typ, e, br)