diff options
| author | herbelin | 2007-11-08 22:22:16 +0000 |
|---|---|---|
| committer | herbelin | 2007-11-08 22:22:16 +0000 |
| commit | c54142e48402d36f0b69239612bf04c1e5bd9ee4 (patch) | |
| tree | d5c4a6d787f2fe6f8af7bbcfde2ec5ea533bb107 /pretyping | |
| parent | 8a51418e76da874843d6b58b6615dc12a82e2c0a (diff) | |
Prise en compte des notations "alias" dans la globalisation des coercions.
Au passage, un peu plus de standardisation des noms de fonctions de
globalisation
Principe de base :
locate_foo : qualid -> foo (échoue avec Not_found)
global : reference -> global_reference (échoue avec UserError)
global_of_foo : foo -> global_reference (échoue avec UserError)
f_with_alias : se comporte comme f mais prenant aussi en compte les
notations de la forme "Notation id:=ref"
Principale exception :
locate, au lieu de locate_global
locate_global_with_alias, qui prend en entrée un "qualid located"
Restent beaucoup de fonctions qui pourraient utiliser
global_with_alias au lieu de global, notamment dans contribs.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10305 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/classops.ml | 6 | ||||
| -rw-r--r-- | pretyping/detyping.ml | 11 | ||||
| -rw-r--r-- | pretyping/detyping.mli | 2 |
3 files changed, 5 insertions, 14 deletions
diff --git a/pretyping/classops.ml b/pretyping/classops.ml index 49147dfd7a..9a628b3fde 100644 --- a/pretyping/classops.ml +++ b/pretyping/classops.ml @@ -370,8 +370,8 @@ let classes () = Bijint.dom !class_tab let coercions () = Gmap.rng !coercion_tab let inheritance_graph () = Gmap.to_list !inheritance_graph -let coercion_of_qualid qid = - let ref = Nametab.global qid in +let coercion_of_reference r = + let ref = Nametab.global r in if not (coercion_exists ref) then errorlabstrm "try_add_coercion" (Nametab.pr_global_env Idset.empty ref ++ str" is not a coercion"); @@ -380,7 +380,7 @@ let coercion_of_qualid qid = module CoercionPrinting = struct type t = coe_typ - let encode = coercion_of_qualid + let encode = coercion_of_reference let subst = subst_coe_typ let printer x = pr_global_env Idset.empty x let key = Goptions.SecondaryTable ("Printing","Coercion") diff --git a/pretyping/detyping.ml b/pretyping/detyping.ml index 049c936415..829c5f4048 100644 --- a/pretyping/detyping.ml +++ b/pretyping/detyping.ml @@ -31,8 +31,8 @@ let dl = dummy_loc (****************************************************************************) (* Tools for printing of Cases *) -let encode_inductive qid = - let indsp = global_inductive qid in +let encode_inductive r = + let indsp = inductive_of_reference r in let constr_lengths = mis_constr_nargs indsp in (indsp,constr_lengths) @@ -108,13 +108,6 @@ module PrintingCasesLet = module PrintingIf = Goptions.MakeRefTable(PrintingCasesIf) module PrintingLet = Goptions.MakeRefTable(PrintingCasesLet) -let force_let ci = - let indsp = ci.ci_ind in - let lc = mis_constr_nargs indsp in PrintingLet.active (indsp,lc) -let force_if ci = - let indsp = ci.ci_ind in - let lc = mis_constr_nargs indsp in PrintingIf.active (indsp,lc) - (* Options for printing or not wildcard and synthetisable types *) open Goptions diff --git a/pretyping/detyping.mli b/pretyping/detyping.mli index 445c2183df..588bc8c849 100644 --- a/pretyping/detyping.mli +++ b/pretyping/detyping.mli @@ -50,8 +50,6 @@ val lookup_index_as_renamed : env -> constr -> int -> int option val set_detype_anonymous : (loc -> int -> rawconstr) -> unit val force_wildcard : unit -> bool val synthetize_type : unit -> bool -val force_if : case_info -> bool -val force_let : case_info -> bool (* Utilities to transform kernel cases to simple pattern-matching problem *) |
