From 8c417a6d32e379d9642d6f2ef144f33d7df4832e Mon Sep 17 00:00:00 2001 From: herbelin Date: Fri, 18 Feb 2005 22:15:17 +0000 Subject: Standardisation of constr_of_reference into constr_of_global + Moved Indmap and ConstrMap to Names git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@6747 85f007b7-540e-0410-9357-904b9bb8a0f7 --- library/libnames.ml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'library/libnames.ml') diff --git a/library/libnames.ml b/library/libnames.ml index f21b98698..361c01696 100644 --- a/library/libnames.ml +++ b/library/libnames.ml @@ -27,11 +27,12 @@ let subst_global subst ref = match ref with let kn',t = subst_con subst kn in if kn==kn' then ref, mkConst kn else ConstRef kn', t | IndRef (kn,i) -> - let kn' = subst_kn subst kn in if kn==kn' then ref, mkInd (kn,i) else - IndRef(kn',i), mkInd (kn',i) + let kn' = subst_kn subst kn in + if kn==kn' then ref, mkInd (kn,i) else IndRef(kn',i), mkInd (kn',i) | ConstructRef ((kn,i),j) -> - let kn' = subst_kn subst kn in if kn==kn' then ref, mkConstruct ((kn,i),j) - else ConstructRef ((kn',i),j), mkConstruct ((kn',i),j) + let kn' = subst_kn subst kn in + if kn==kn' then ref, mkConstruct ((kn,i),j) + else ConstructRef ((kn',i),j), mkConstruct ((kn',i),j) let reference_of_constr c = match kind_of_term c with | Const sp -> ConstRef sp @@ -40,12 +41,14 @@ let reference_of_constr c = match kind_of_term c with | Var id -> VarRef id | _ -> raise Not_found -let constr_of_reference = function +let constr_of_global = function | VarRef id -> mkVar id | ConstRef sp -> mkConst sp | ConstructRef sp -> mkConstruct sp | IndRef sp -> mkInd sp +let constr_of_reference = constr_of_global + module RefOrdered = struct type t = global_reference @@ -55,24 +58,8 @@ module RefOrdered = module Refset = Set.Make(RefOrdered) module Refmap = Map.Make(RefOrdered) -module InductiveOrdered = struct - type t = inductive - let compare (spx,ix) (spy,iy) = - let c = ix - iy in if c = 0 then compare spx spy else c -end - -module Indmap = Map.Make(InductiveOrdered) - let inductives_table = ref Indmap.empty -module ConstructorOrdered = struct - type t = constructor - let compare (indx,ix) (indy,iy) = - let c = ix - iy in if c = 0 then InductiveOrdered.compare indx indy else c -end - -module Constrmap = Map.Make(ConstructorOrdered) - (**********************************************) let pr_dirpath sl = (str (string_of_dirpath sl)) @@ -267,3 +254,4 @@ let pr_reference = function let loc_of_reference = function | Qualid (loc,qid) -> loc | Ident (loc,id) -> loc + -- cgit v1.2.3