Module Notation_term

notation_constr

notation_constr is the subtype of glob_constr allowed in syntactic extensions (i.e. notations). No location since intended to be substituted at any place of a text. Non global expressions such as existential variables are not allowed.

Note concerning NList: first constr is iterator, second is terminator; first id is where each argument of the list has to be substituted in iterator and snd id is alternative name just for printing; boolean is associativity

Types concerning notations

type scope_name = string
type tmp_scope_name = scope_name
type subscopes = Constrexpr.scope_delimiter list
type notation_var_binders = Names.Id.Set.t

The set of other notation variables that are bound to a binder or binder list and that bind the given notation variable, for instance, in "{ x | P }" := (sigT (fun x => P), "x" is under an empty set of binders and "P" is under the binders bound to "x", that is, its notation_var_binders set is "x"

Type of the meta-variables of an notation_constr: in a recursive pattern x..y, x carries the sequence of objects bound to the list x..y

type notation_binder_kind =
  1. | AsIdent
  2. | AsName
  3. | AsAnyPattern
  4. | AsStrictPattern
type notation_binder_source =
  1. | NtnBinderParsedAsConstr of notation_binder_kind
  2. | NtnBinderParsedAsSomeBinderKind of notation_binder_kind
  3. | NtnBinderParsedAsBinder
type notation_var_constr_kind =
  1. | NtnAlwaysConstr
  2. | NtnConstrForConstrAndPatternForPattern
type notation_var_kind =
  1. | NtnTypeVarConstr of notation_var_constr_kind
  2. | NtnTypeVarPattern of notation_binder_source
  3. | NtnTypeVarBinders of notation_binder_source

Type of variables in notation interpretations, remembering how it is parsed; Note: when a notation variable appears both as term and as binder, its type is Pattern

type notation_var_type =
  1. | NtnTypeVar of extended_subscopes * notation_var_binders * notation_var_kind
  2. | NtnTypeVarList of notation_var_type
  3. | NtnTypeVarTuple of notation_var_type list
type notation_var_internalization_type =
  1. | NtnInternTypeAny of scope_name option
  2. | NtnInternTypeOnlyBinder

Type of variables when interpreting a constr_expr as a notation_constr: in a recursive pattern x..y, both x and y carry the individual type of each element of the list x..y

type 'a interpretation_gen = (Names.Id.t * 'a) list * notation_constr

This characterizes to what a notation is interpreted to

type forgetfulness = {
  1. forget_ltac : bool;
  2. forget_volatile_cast : bool;
}
type reversibility_status =
  1. | APrioriReversible
  2. | Forgetful of forgetfulness
  3. | NonInjective of Names.Id.t list
type notation_interp_var_types = notation_var_internalization_type Names.Id.Map.t
type 'a notation_raw_type =
  1. | NtnRawTypeVar of 'a
  2. | NtnRawTypeVarList of ('a * 'a) notation_raw_type
  3. | NtnRawTypeVarTuple of 'a notation_raw_type list
type notation_interp_env = {
  1. ninterp_var_type : notation_interp_var_types;
  2. ninterp_raw_types : Names.Id.t notation_raw_type list;
}