NotationNotations
val notation_cat : Libobject.categoryval pr_notation : Constrexpr.notation -> Pp.tPrinting
module NotationSet : CSet.ExtS with type elt = Constrexpr.notationmodule NotationMap :
CMap.ExtS with type key = Constrexpr.notation and module Set := NotationSetmodule SpecificNotationSet :
CSet.ExtS with type elt = Constrexpr.specific_notationmodule SpecificNotationMap :
CMap.ExtS
with type key = Constrexpr.specific_notation
and module Set := SpecificNotationSetA scope is a set of interpreters for symbols + optional interpreter and printers for integers + optional delimiters
val declare_scope : Notation_term.scope_name -> unitval ensure_scope : Notation_term.scope_name -> unitval current_scopes : unit -> scopesval scope_is_open_in_scopes : Notation_term.scope_name -> scopes -> boolCheck where a scope is opened or not in a scope list, or in * the current opened scopes
val scope_is_open : Notation_term.scope_name -> boolval open_scope : Notation_term.scope_name -> unitOpen scope
val close_scope : Notation_term.scope_name -> unitval normalize_scope : string -> Notation_term.scope_nameReturn a scope taking either a scope name or delimiter
val empty_scope_stack : scopesExtend a list of scopes
val push_scope : Notation_term.scope_name -> scopes -> scopesval find_scope : Notation_term.scope_name -> scopeval scope_delimiters : scope -> delimiters optionDeclare delimiters for printing
val declare_delimiters : Notation_term.scope_name -> delimiters -> unitval remove_delimiters : Notation_term.scope_name -> unitval find_delimiters_scope :
?loc:Loc.t ->
delimiters ->
Notation_term.scope_nameA number interpreter is the pair of an interpreter for **(hexa)decimal** numbers in terms and an optional interpreter in pattern, if non integer or negative numbers are not supported, the interpreter must fail with an appropriate error message
type notation_location =
(Names.DirPath.t * Names.DirPath.t * Loc.t option) * string1st dirpath: dirpath of the library 2nd dirpath: module and section-only dirpath (ie Lib.current_dirpath true) location: The location. Presumably you can recover the dirpaths from that but I don't know how. string: string used to generate the notation
dirpaths are used for dumpglob, the location for Locate, and string for printing (pr_notation_info)
type required_module = Libnames.full_path * string listtype prim_token_infos = {pt_local : bool;Is this interpretation local?
*)pt_scope : Notation_term.scope_name;Concerned scope
*)pt_interp_info : PrimNotations.prim_token_interp_info;Unique id "pointing" to (un)interp functions, OR a number notation object describing (un)interp functions
*)pt_required : required_module;Module that should be loaded first
*)pt_refs : Names.GlobRef.t list;Entry points during uninterpretation
*)pt_in_match : bool;Is this prim token legal in match patterns ?
*)}Note: most of the time, the pt_refs field above will contain inductive constructors (e.g. O and S for nat). But it could also be injection functions such as IZR for reals.
Activate a prim token interpretation whose unique id and functions have already been registered.
val enable_prim_token_interpretation : prim_token_infos -> unitReturn the term/cases_pattern bound to a primitive token in a given scope context
val interp_prim_token :
?loc:Loc.t ->
Constrexpr.prim_token ->
Notation_term.subscopes ->
Glob_term.glob_constrval interp_prim_token_cases_pattern_expr :
?loc:Loc.t ->
(Glob_term.glob_constr -> unit) ->
Constrexpr.prim_token ->
Notation_term.subscopes ->
Glob_term.glob_constrReturn the primitive token associated to a term/cases_pattern; raise No_match if no such token
val uninterp_prim_token :
print_float:bool ->
'a Glob_term.glob_constr_g ->
Notation_term.subscopes ->
Constrexpr.prim_token * delimiters optionval uninterp_prim_token_cases_pattern :
print_float:bool ->
'a Glob_term.cases_pattern_g ->
Notation_term.subscopes ->
Names.Name.t * Constrexpr.prim_token * delimiters optionval availability_of_prim_token :
Constrexpr.prim_token ->
Notation_term.scope_name ->
Notation_term.subscopes ->
delimiters option optiontype entry_coercion_kind = | IsEntryCoercion of Constrexpr.notation_entry_level
* Constrexpr.notation_entry_relative_level| IsEntryGlobal of Globnames.CustomName.t * int| IsEntryIdent of Globnames.CustomName.t * intval declare_notation :
(Constrexpr.notation_with_optional_scope * Constrexpr.notation) ->
Notation_term.interpretation ->
notation_location ->
use:Notationextern.notation_use ->
entry_coercion_kind option ->
UserWarn.t option ->
unitval interp_notation :
?loc:Loc.t ->
Constrexpr.notation ->
Notation_term.subscopes ->
Notation_term.interpretation
* (notation_location * Notation_term.scope_name option)Return the interpretation bound to a notation
val availability_of_notation :
Constrexpr.specific_notation ->
Notation_term.subscopes ->
(Notation_term.scope_name option * delimiters option) optionTest if a notation is available in the scopes context scopes; if available, the result is not None; the first argument is itself not None if a delimiters is needed
val is_printing_inactive_rule :
Notationextern.interp_rule ->
Notation_term.interpretation ->
booltype 'a notation_query_pattern_gen = {notation_entry_pattern : Constrexpr.notation_entry list;interp_rule_key_pattern : (Constrexpr.notation_key, 'a) Util.union option;use_pattern : Notationextern.notation_use;scope_pattern : Constrexpr.notation_with_optional_scope option;interpretation_pattern : Notation_term.interpretation option;}type notation_query_pattern = Libnames.qualid notation_query_pattern_genval toggle_notations :
on:bool ->
all:bool ->
?verbose:bool ->
(Glob_term.glob_constr -> Pp.t) ->
notation_query_pattern ->
unitTake a notation string and turn it into a notation key. eg. "x + y" becomes "_ + _".
type notation_as_reference_error = | AmbiguousNotationAsReference of Constrexpr.notation_key| NotationNotReference of Environ.env
* Evd.evar_map
* Constrexpr.notation_key
* (Constrexpr.notation_key * Notation_term.notation_constr) listexception NotationAsReferenceError of notation_as_reference_errorval interp_notation_as_global_reference :
?loc:Loc.t ->
head:bool ->
(Names.GlobRef.t -> bool) ->
Constrexpr.notation_key ->
delimiters option ->
Names.GlobRef.tIf head is true, also allows applied global references. Raise NotationAsReferenceError if not resolvable as a global reference
val interp_notation_as_global_reference_expanded :
?loc:Loc.t ->
head:bool ->
(Names.GlobRef.t -> bool) ->
Constrexpr.notation_key ->
delimiters option ->
(Constrexpr.notation_entry * Constrexpr.notation_key)
* Constrexpr.notation_key
* Constrexpr.notation_with_optional_scope
* Notation_term.interpretation
* Names.GlobRef.tSame together with the full notation
val declare_arguments_scope :
bool ->
Names.GlobRef.t ->
Notation_term.scope_name list list ->
unitDeclares and looks for scopes associated to arguments of a global ref
val find_arguments_scope :
Environ.env ->
Names.GlobRef.t ->
Notation_term.scope_name list listval scope_class_compare : scope_class -> scope_class -> intComparison of scope_class
val subst_scope_class :
Environ.env ->
Mod_subst.substitution ->
scope_class ->
scope_class optionval declare_scope_class :
bool ->
Notation_term.scope_name ->
?where:add_scope_where ->
scope_class ->
unitval declare_ref_arguments_scope : Names.GlobRef.t -> unitval compute_arguments_scope :
Environ.env ->
Evd.evar_map ->
EConstr.types ->
Notation_term.scope_name list listval compute_type_scope :
Environ.env ->
Evd.evar_map ->
EConstr.types ->
Notation_term.scope_name listval compute_glob_type_scope :
'a Glob_term.glob_constr_g ->
Notation_term.scope_name listval current_type_scope_names : unit -> Notation_term.scope_name listGet the current scopes bound to Sortclass
val scope_class_of_class : Coercionops.cl_typ -> scope_classBuilding notation key
type symbol = | Terminal of string| NonTerminal of Names.Id.t| SProdList of Names.Id.t * symbol list| Break of intval make_notation_key :
Constrexpr.notation_entry ->
symbol list ->
Constrexpr.notationMake/decompose a notation of the form "_ U _"
val decompose_notation_key :
Constrexpr.notation ->
Constrexpr.notation_entry * symbol listtype notation_symbols = {recvars : (Names.Id.t * Names.Id.t) list;mainvars : Names.Id.t list;symbols : symbol list;}val is_prim_token_constant_in_constr :
(Constrexpr.notation_entry * symbol list) ->
boolval decompose_raw_notation : string -> notation_symbolsDecompose a notation of the form "a 'U' b" together with the lists of pairs of recursive variables and the list of all variables binding in the notation
val pr_scope_class : scope_class -> Pp.tPrints scopes (expects a pure aconstr printer)
val pr_scope :
(Glob_term.glob_constr -> Pp.t) ->
Notation_term.scope_name ->
Pp.tval pr_scopes : (Glob_term.glob_constr -> Pp.t) -> Pp.tval locate_notation :
(Glob_term.glob_constr -> Pp.t) ->
Constrexpr.notation_key ->
Notation_term.scope_name option ->
Pp.tval pr_visibility :
(Glob_term.glob_constr -> Pp.t) ->
Notation_term.scope_name option ->
Pp.tCoercions between entries
val is_coercion :
Constrexpr.notation_entry_level ->
Constrexpr.notation_entry_relative_level ->
boolFor a rule of the form "Notation string := x (in some-entry, x at some-relative-entry)", tell if going from some-entry to some-relative-entry is coercing
val declare_entry_coercion :
Constrexpr.specific_notation ->
Constrexpr.notation_entry_level ->
Constrexpr.notation_entry_relative_level ->
unitAdd a coercion from some-entry to some-relative-entry
type entry_coercion =
(Constrexpr.notation_with_optional_scope * Constrexpr.notation) listval availability_of_entry_coercion :
?non_included:bool ->
Constrexpr.notation_entry_relative_level ->
Constrexpr.notation_entry_level ->
entry_coercion optionReturn a coercion path from some-relative-entry to some-entry if there is one
Special properties of entries
val declare_custom_entry_has_global : Globnames.CustomName.t -> int -> unitval declare_custom_entry_has_ident : Globnames.CustomName.t -> int -> unitval entry_has_global : Constrexpr.notation_entry_relative_level -> boolval entry_has_ident : Constrexpr.notation_entry_relative_level -> boolval prec_less :
Constrexpr.entry_level ->
Constrexpr.entry_relative_level ->
boolval may_capture_cont_after :
Constrexpr.entry_level option ->
Constrexpr.entry_relative_level ->
boolval declare_notation_level :
Constrexpr.notation ->
Notationextern.level ->
unitval level_of_notation : Constrexpr.notation -> Notationextern.levelraise Not_found if not declared
Rem: printing rules for primitive token are canonical
val declare_ntn_gram_loc : Constrexpr.notation -> Loc.t option -> unit