aboutsummaryrefslogtreecommitdiffhomepage
path: root/library
diff options
context:
space:
mode:
authorGravatar ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-11-25 17:39:07 +0000
committerGravatar ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-11-25 17:39:07 +0000
commitb35582012e9f7923ca2e55bfbfae9215770f8fbd (patch)
tree21ec39af08f0d8ce1b33272443518e843a9d5c28 /library
parent9489721652bb443b5ed680701d94283737038f0b (diff)
Monomorphization (library)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16001 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library')
-rw-r--r--library/declare.ml4
-rw-r--r--library/decls.ml3
-rw-r--r--library/libobject.ml15
3 files changed, 12 insertions, 10 deletions
diff --git a/library/declare.ml b/library/declare.ml
index 7364031d5..9d986d185 100644
--- a/library/declare.ml
+++ b/library/declare.ml
@@ -128,7 +128,7 @@ let cache_constant ((sp,kn),(cdt,dhyps,kind)) =
let _,dir,_ = repr_kn kn in
check_exists sp;
let kn' = Global.add_constant dir id cdt in
- assert (kn' = constant_of_kn kn);
+ assert (eq_constant kn' (constant_of_kn kn));
Nametab.push (Nametab.Until 1) sp (ConstRef (constant_of_kn kn));
add_section_constant kn' (Global.lookup_constant kn').const_hyps;
Dischargedhypsmap.set_discharged_hyps sp dhyps;
@@ -235,7 +235,7 @@ let cache_inductive ((sp,kn),(dhyps,mie)) =
let id = basename sp in
let _,dir,_ = repr_kn kn in
let kn' = Global.add_mind dir id mie in
- assert (kn'= mind_of_kn kn);
+ assert (eq_mind kn' (mind_of_kn kn));
add_section_kn kn' (Global.lookup_mind kn').mind_hyps;
Dischargedhypsmap.set_discharged_hyps sp dhyps;
List.iter (fun (sp, ref) -> Nametab.push (Nametab.Until 1) sp ref) names;
diff --git a/library/decls.ml b/library/decls.ml
index f6fa626b1..af6ee3448 100644
--- a/library/decls.ml
+++ b/library/decls.ml
@@ -9,6 +9,7 @@
(** This module registers tables for some non-logical informations
associated declarations *)
+open Util
open Names
open Sign
open Decl_kinds
@@ -64,7 +65,7 @@ let initialize_named_context_for_proof () =
let last_section_hyps dir =
fold_named_context
(fun (id,_,_) sec_ids ->
- try if dir=variable_path id then id::sec_ids else sec_ids
+ try if dir_path_eq dir (variable_path id) then id::sec_ids else sec_ids
with Not_found -> sec_ids)
(Environ.named_context (Global.env()))
~init:[]
diff --git a/library/libobject.ml b/library/libobject.ml
index ffd87ce80..81f306a33 100644
--- a/library/libobject.ml
+++ b/library/libobject.ml
@@ -6,6 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
+open Util
open Errors
open Libnames
open Mod_subst
@@ -82,20 +83,20 @@ let declare_object_full odecl =
let na = odecl.object_name in
let (infun,outfun) = Dyn.create na in
let cacher (oname,lobj) =
- if Dyn.tag lobj = na then odecl.cache_function (oname,outfun lobj)
+ if String.equal (Dyn.tag lobj) na then odecl.cache_function (oname,outfun lobj)
else anomaly "somehow we got the wrong dynamic object in the cachefun"
and loader i (oname,lobj) =
- if Dyn.tag lobj = na then odecl.load_function i (oname,outfun lobj)
+ if String.equal (Dyn.tag lobj) na then odecl.load_function i (oname,outfun lobj)
else anomaly "somehow we got the wrong dynamic object in the loadfun"
and opener i (oname,lobj) =
- if Dyn.tag lobj = na then odecl.open_function i (oname,outfun lobj)
+ if String.equal (Dyn.tag lobj) na then odecl.open_function i (oname,outfun lobj)
else anomaly "somehow we got the wrong dynamic object in the openfun"
and substituter (sub,lobj) =
- if Dyn.tag lobj = na then
+ if String.equal (Dyn.tag lobj) na then
infun (odecl.subst_function (sub,outfun lobj))
else anomaly "somehow we got the wrong dynamic object in the substfun"
and classifier lobj =
- if Dyn.tag lobj = na then
+ if String.equal (Dyn.tag lobj) na then
match odecl.classify_function (outfun lobj) with
| Dispose -> Dispose
| Substitute obj -> Substitute (infun obj)
@@ -104,12 +105,12 @@ let declare_object_full odecl =
else
anomaly "somehow we got the wrong dynamic object in the classifyfun"
and discharge (oname,lobj) =
- if Dyn.tag lobj = na then
+ if String.equal (Dyn.tag lobj) na then
Option.map infun (odecl.discharge_function (oname,outfun lobj))
else
anomaly "somehow we got the wrong dynamic object in the dischargefun"
and rebuild lobj =
- if Dyn.tag lobj = na then infun (odecl.rebuild_function (outfun lobj))
+ if String.equal (Dyn.tag lobj) na then infun (odecl.rebuild_function (outfun lobj))
else anomaly "somehow we got the wrong dynamic object in the rebuildfun"
in
Hashtbl.add cache_tab na { dyn_cache_function = cacher;