summaryrefslogtreecommitdiff
path: root/plugins/field/field.ml4
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/field/field.ml4')
-rw-r--r--plugins/field/field.ml416
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/field/field.ml4 b/plugins/field/field.ml4
index 37aa457d..9e4f4d74 100644
--- a/plugins/field/field.ml4
+++ b/plugins/field/field.ml4
@@ -1,6 +1,6 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2011 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
@@ -8,8 +8,6 @@
(*i camlp4deps: "parsing/grammar.cma" i*)
-(* $Id: field.ml4 14641 2011-11-06 11:59:10Z herbelin $ *)
-
open Names
open Pp
open Proof_type
@@ -39,18 +37,20 @@ let constr_of_opt a opt =
| None -> mkApp (init_constant "None",[|ac3|])
| Some f -> mkApp (init_constant "Some",[|ac3;constr_of f|])
+module Cmap = Map.Make(struct type t = constr let compare = constr_ord end)
+
(* Table of theories *)
-let th_tab = ref (Gmap.empty : (constr,constr) Gmap.t)
+let th_tab = ref (Cmap.empty : constr Cmap.t)
let lookup env typ =
- try Gmap.find typ !th_tab
+ try Cmap.find typ !th_tab
with Not_found ->
errorlabstrm "field"
(str "No field is declared for type" ++ spc() ++
Printer.pr_lconstr_env env typ)
let _ =
- let init () = th_tab := Gmap.empty in
+ let init () = th_tab := Cmap.empty in
let freeze () = !th_tab in
let unfreeze fs = th_tab := fs in
Summary.declare_summary "field"
@@ -59,7 +59,7 @@ let _ =
Summary.init_function = init }
let load_addfield _ = ()
-let cache_addfield (_,(typ,th)) = th_tab := Gmap.add typ th !th_tab
+let cache_addfield (_,(typ,th)) = th_tab := Cmap.add typ th !th_tab
let subst_addfield (subst,(typ,th as obj)) =
let typ' = subst_mps subst typ in
let th' = subst_mps subst th in
@@ -67,7 +67,7 @@ let subst_addfield (subst,(typ,th as obj)) =
(typ',th')
(* Declaration of the Add Field library object *)
-let (in_addfield,out_addfield)=
+let in_addfield : types * constr -> Libobject.obj =
Libobject.declare_object {(Libobject.default_object "ADD_FIELD") with
Libobject.open_function = (fun i o -> if i=1 then cache_addfield o);
Libobject.cache_function = cache_addfield;