(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* 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 notation_var_binders = Id.Set.t (** 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 = (* This accepts only ident *) | AsIdent (* This accepts only name *) | AsName (* This accepts pattern *) | AsAnyPattern (* This accepts only strict pattern (i.e. no single variable) at printing *) | AsStrictPattern type notation_binder_source = (* Parsed as constr and constrained to be ident, name or pattern, depending on kind *) | NtnBinderParsedAsConstr of notation_binder_kind (* Parsed and interpreted as ident, name or pattern, depending on kind *) | NtnBinderParsedAsSomeBinderKind of notation_binder_kind (* Parsed as open or closed binder: This accepts ident, _, quoted pattern, etc. *) | NtnBinderParsedAsBinder type notation_var_constr_kind = | NtnAlwaysConstr (* In anticipation of supporting PatCast in pattern, which is a case where a constr in a pattern should be kept as a constr and not interpreted by default as a pattern *) | NtnConstrForConstrAndPatternForPattern (** 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_kind = | NtnTypeVarConstr of notation_var_constr_kind | NtnTypeVarPattern of notation_binder_source | NtnTypeVarBinders of notation_binder_source type notation_var_type = | NtnTypeVar of (extended_subscopes * notation_var_binders) * notation_var_kind | NtnTypeVarList of notation_var_type (* list A *) | NtnTypeVarTuple of notation_var_type list (* A1 * ... * An *) (** 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 notation_var_internalization_type = | NtnInternTypeAny of scope_name option | NtnInternTypeOnlyBinder (** This characterizes to what a notation is interpreted to *) type 'a interpretation_gen = (Id.t * 'a) list * notation_constr type interpretation = notation_var_type interpretation_gen (* (var_types, n) is a pair with a notation n and the type of its non terminals, var_types is a list giving a name and a type to each non terminal. Type invariant: the length of var_types is the number of non terminals appearing in n, as given by the function TODO *) type forgetfulness = { forget_ltac : bool; forget_volatile_cast : bool } type reversibility_status = | APrioriReversible | Forgetful of forgetfulness | NonInjective of Id.t list type notation_interp_var_types = notation_var_internalization_type Names.Id.Map.t type 'a notation_raw_type = | NtnRawTypeVar of 'a | NtnRawTypeVarList of ('a * 'a) notation_raw_type (* A .. A *) (* represented as a pattern pat(x) ... pat(y) in the declaration of the notation and we keep the names of the two ends (note that this may multiply in case of nested recursive patterns) *) | NtnRawTypeVarTuple of 'a notation_raw_type list (* A1 * ... * An *) type notation_interp_env = { ninterp_var_type : notation_interp_var_types; ninterp_raw_types : Id.t notation_raw_type list; }