From 82649c076ae38353aec5333987c80476f27e3775 Mon Sep 17 00:00:00 2001 From: soubiran Date: Fri, 23 Oct 2009 16:19:47 +0000 Subject: 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 --- library/declare.ml | 2 +- library/libnames.ml | 9 +++++++++ library/libnames.mli | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'library') 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 -- cgit v1.2.3