aboutsummaryrefslogtreecommitdiffhomepage
path: root/library
diff options
context:
space:
mode:
authorGravatar soubiran <soubiran@85f007b7-540e-0410-9357-904b9bb8a0f7>2009-10-23 16:19:47 +0000
committerGravatar soubiran <soubiran@85f007b7-540e-0410-9357-904b9bb8a0f7>2009-10-23 16:19:47 +0000
commit82649c076ae38353aec5333987c80476f27e3775 (patch)
treeb5490819cb0bfd8ecc01e89b18344956d1ef9d6e /library
parent76ff040e3b46539625ec61e7597f06a87b927c5a (diff)
First debug... the renaming of librairies was not working and auto/dn were not taking in account equivalent names of inductive types.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12408 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library')
-rw-r--r--library/declare.ml2
-rw-r--r--library/libnames.ml9
-rw-r--r--library/libnames.mli1
3 files changed, 11 insertions, 1 deletions
diff --git a/library/declare.ml b/library/declare.ml
index 1084aa07d..dd1b12a24 100644
--- a/library/declare.ml
+++ b/library/declare.ml
@@ -163,7 +163,7 @@ let hcons_constant_declaration = function
let declare_constant_common id dhyps (cd,kind) =
let (sp,kn) = add_leaf id (inConstant (cd,dhyps,kind)) in
- let c = constant_of_kn kn in
+ let c = Global.constant_of_delta (constant_of_kn kn) in
declare_constant_implicits c;
Heads.declare_head (EvalConstRef c);
Notation.declare_ref_arguments_scope (ConstRef c);
diff --git a/library/libnames.ml b/library/libnames.ml
index fad0336fc..9a7135eae 100644
--- a/library/libnames.ml
+++ b/library/libnames.ml
@@ -57,6 +57,15 @@ let subst_global subst ref = match ref with
let c',t = subst_constructor subst c in
if c'==c then ref,t else ConstructRef c', t
+let canonical_gr = function
+ | ConstRef con ->
+ ConstRef(constant_of_kn(canonical_con con))
+ | IndRef (kn,i) ->
+ IndRef(mind_of_kn(canonical_mind kn),i)
+ | ConstructRef ((kn,i),j )->
+ ConstructRef((mind_of_kn(canonical_mind kn),i),j)
+ | VarRef id -> VarRef id
+
let global_of_constr c = match kind_of_term c with
| Const sp -> ConstRef sp
| Ind ind_sp -> IndRef ind_sp
diff --git a/library/libnames.mli b/library/libnames.mli
index fd2ca37ae..9ee7d0ab5 100644
--- a/library/libnames.mli
+++ b/library/libnames.mli
@@ -29,6 +29,7 @@ val isIndRef : global_reference -> bool
val isConstructRef : global_reference -> bool
val eq_gr : global_reference -> global_reference -> bool
+val canonical_gr : global_reference -> global_reference
val destVarRef : global_reference -> variable
val destConstRef : global_reference -> constant