summaryrefslogtreecommitdiff
path: root/intf
diff options
context:
space:
mode:
Diffstat (limited to 'intf')
-rw-r--r--intf/constrexpr.mli37
-rw-r--r--intf/extend.mli52
-rw-r--r--intf/genredexpr.mli8
-rw-r--r--intf/glob_term.mli8
-rw-r--r--intf/misctypes.mli8
-rw-r--r--intf/notation_term.mli22
-rw-r--r--intf/tacexpr.mli100
-rw-r--r--intf/vernacexpr.mli114
8 files changed, 234 insertions, 115 deletions
diff --git a/intf/constrexpr.mli b/intf/constrexpr.mli
index dcdbd47f..0cbb2957 100644
--- a/intf/constrexpr.mli
+++ b/intf/constrexpr.mli
@@ -32,21 +32,25 @@ type abstraction_kind = AbsLambda | AbsPi
type proj_flag = int option (** [Some n] = proj of the n-th visible argument *)
-type prim_token = Numeral of Bigint.bigint | String of string
+type prim_token =
+ | Numeral of Bigint.bigint (** representation of integer literals that appear in Coq scripts. *)
+ | String of string
type raw_cases_pattern_expr =
| RCPatAlias of Loc.t * raw_cases_pattern_expr * Id.t
| RCPatCstr of Loc.t * Globnames.global_reference
* raw_cases_pattern_expr list * raw_cases_pattern_expr list
- (** [CPatCstr (_, Inl c, l1, l2)] represents (@c l1) l2 *)
+ (** [CPatCstr (_, c, l1, l2)] represents ((@c l1) l2) *)
| RCPatAtom of Loc.t * Id.t option
| RCPatOr of Loc.t * raw_cases_pattern_expr list
+type instance_expr = Misctypes.glob_level list
+
type cases_pattern_expr =
| CPatAlias of Loc.t * cases_pattern_expr * Id.t
| CPatCstr of Loc.t * reference
- * cases_pattern_expr list * cases_pattern_expr list
- (** [CPatCstr (_, Inl c, l1, l2)] represents (@c l1) l2 *)
+ * cases_pattern_expr list option * cases_pattern_expr list
+ (** [CPatCstr (_, c, Some l1, l2)] represents (@c l1) l2 *)
| CPatAtom of Loc.t * reference option
| CPatOr of Loc.t * cases_pattern_expr list
| CPatNotation of Loc.t * notation * cases_pattern_notation_substitution
@@ -56,14 +60,13 @@ type cases_pattern_expr =
| CPatPrim of Loc.t * prim_token
| CPatRecord of Loc.t * (reference * cases_pattern_expr) list
| CPatDelimiters of Loc.t * string * cases_pattern_expr
+ | CPatCast of Loc.t * cases_pattern_expr * constr_expr
and cases_pattern_notation_substitution =
cases_pattern_expr list * (** for constr subterms *)
cases_pattern_expr list list (** for recursive notations *)
-type instance_expr = Misctypes.glob_level list
-
-type constr_expr =
+and constr_expr =
| CRef of reference * instance_expr option
| CFix of Loc.t * Id.t located * fix_expr list
| CCoFix of Loc.t * Id.t located * cofix_expr list
@@ -73,9 +76,15 @@ type constr_expr =
| CAppExpl of Loc.t * (proj_flag * reference * instance_expr option) * constr_expr list
| CApp of Loc.t * (proj_flag * constr_expr) *
(constr_expr * explicitation located option) list
- | CRecord of Loc.t * constr_expr option * (reference * constr_expr) list
- | CCases of Loc.t * case_style * constr_expr option *
- case_expr list * branch_expr list
+ | CRecord of Loc.t * (reference * constr_expr) list
+
+ (* representation of the "let" and "match" constructs *)
+ | CCases of Loc.t (* position of the "match" keyword *)
+ * case_style (* determines whether this value represents "let" or "match" construct *)
+ * constr_expr option (* return-clause *)
+ * case_expr list
+ * branch_expr list (* branches *)
+
| CLetTuple of Loc.t * Name.t located list * (Name.t located option * constr_expr option) *
constr_expr * constr_expr
| CIf of Loc.t * constr_expr * (Name.t located option * constr_expr option)
@@ -90,8 +99,9 @@ type constr_expr =
| CPrim of Loc.t * prim_token
| CDelimiters of Loc.t * string * constr_expr
-and case_expr =
- constr_expr * (Name.t located option * cases_pattern_expr option)
+and case_expr = constr_expr (* expression that is being matched *)
+ * Name.t located option (* as-clause *)
+ * cases_pattern_expr option (* in-clause *)
and branch_expr =
Loc.t * cases_pattern_expr list located list * constr_expr
@@ -115,13 +125,14 @@ and recursion_order_expr =
and local_binder =
| LocalRawDef of Name.t located * constr_expr
| LocalRawAssum of Name.t located list * binder_kind * constr_expr
+ | LocalPattern of Loc.t * cases_pattern_expr * constr_expr option
and constr_notation_substitution =
constr_expr list * (** for constr subterms *)
constr_expr list list * (** for recursive notations *)
local_binder list list (** for binders subexpressions *)
-type typeclass_constraint = Name.t located * binding_kind * constr_expr
+type typeclass_constraint = (Name.t located * Id.t located list option) * binding_kind * constr_expr
and typeclass_context = typeclass_constraint list
diff --git a/intf/extend.mli b/intf/extend.mli
index 03355238..7ba332f7 100644
--- a/intf/extend.mli
+++ b/intf/extend.mli
@@ -8,6 +8,8 @@
(** Entry keys for constr notations *)
+type 'a entry = 'a Compat.GrammarMake(CLexer).entry
+
type side = Left | Right
type gram_assoc = NonA | RightA | LeftA
@@ -50,3 +52,53 @@ type constr_prod_entry_key =
type simple_constr_prod_entry_key =
(production_level,unit) constr_entry_key_gen
+
+(** {5 AST for user-provided entries} *)
+
+type 'a user_symbol =
+| Ulist1 of 'a user_symbol
+| Ulist1sep of 'a user_symbol * string
+| Ulist0 of 'a user_symbol
+| Ulist0sep of 'a user_symbol * string
+| Uopt of 'a user_symbol
+| Uentry of 'a
+| Uentryl of 'a * int
+
+(** {5 Type-safe grammar extension} *)
+
+type ('self, 'a) symbol =
+| Atoken : Tok.t -> ('self, string) symbol
+| Alist1 : ('self, 'a) symbol -> ('self, 'a list) symbol
+| Alist1sep : ('self, 'a) symbol * ('self, _) symbol -> ('self, 'a list) symbol
+| Alist0 : ('self, 'a) symbol -> ('self, 'a list) symbol
+| Alist0sep : ('self, 'a) symbol * ('self, _) symbol -> ('self, 'a list) symbol
+| Aopt : ('self, 'a) symbol -> ('self, 'a option) symbol
+| Aself : ('self, 'self) symbol
+| Anext : ('self, 'self) symbol
+| Aentry : 'a entry -> ('self, 'a) symbol
+| Aentryl : 'a entry * int -> ('self, 'a) symbol
+| Arules : 'a rules list -> ('self, 'a) symbol
+
+and ('self, _, 'r) rule =
+| Stop : ('self, 'r, 'r) rule
+| Next : ('self, 'a, 'r) rule * ('self, 'b) symbol -> ('self, 'b -> 'a, 'r) rule
+
+and ('a, 'r) norec_rule = { norec_rule : 's. ('s, 'a, 'r) rule }
+
+and 'a rules =
+| Rules : ('act, Loc.t -> 'a) norec_rule * 'act -> 'a rules
+
+type 'a production_rule =
+| Rule : ('a, 'act, Loc.t -> 'a) rule * 'act -> 'a production_rule
+
+type 'a single_extend_statment =
+ string option *
+ (** Level *)
+ gram_assoc option *
+ (** Associativity *)
+ 'a production_rule list
+ (** Symbol list with the interpretation function *)
+
+type 'a extend_statment =
+ gram_position option *
+ 'a single_extend_statment list
diff --git a/intf/genredexpr.mli b/intf/genredexpr.mli
index ff036a13..2df79673 100644
--- a/intf/genredexpr.mli
+++ b/intf/genredexpr.mli
@@ -12,7 +12,9 @@
type 'a red_atom =
| FBeta
- | FIota
+ | FMatch
+ | FFix
+ | FCofix
| FZeta
| FConst of 'a list
| FDeltaBut of 'a list
@@ -21,7 +23,9 @@ type 'a red_atom =
type 'a glob_red_flag = {
rBeta : bool;
- rIota : bool;
+ rMatch : bool;
+ rFix : bool;
+ rCofix : bool;
rZeta : bool;
rDelta : bool; (** true = delta all but rConst; false = delta only on rConst*)
rConst : 'a list
diff --git a/intf/glob_term.mli b/intf/glob_term.mli
index 81d3e222..b3159c86 100644
--- a/intf/glob_term.mli
+++ b/intf/glob_term.mli
@@ -29,9 +29,14 @@ type cases_pattern =
| PatCstr of Loc.t * constructor * cases_pattern list * Name.t
(** [PatCstr(p,C,l,x)] = "|'C' 'l' as 'x'" *)
+(** Representation of an internalized (or in other words globalized) term. *)
type glob_constr =
| GRef of (Loc.t * global_reference * glob_level list option)
+ (** An identifier that represents a reference to an object defined
+ either in the (global) environment or in the (local) context. *)
| GVar of (Loc.t * Id.t)
+ (** An identifier that cannot be regarded as "GRef".
+ Bound variables are typically represented this way. *)
| GEvar of Loc.t * existential_name * (Id.t * glob_constr) list
| GPatVar of Loc.t * (bool * patvar) (** Used for patterns only *)
| GApp of Loc.t * glob_constr * glob_constr list
@@ -39,8 +44,7 @@ type glob_constr =
| GProd of Loc.t * Name.t * binding_kind * glob_constr * glob_constr
| GLetIn of Loc.t * Name.t * glob_constr * glob_constr
| GCases of Loc.t * case_style * glob_constr option * tomatch_tuples * cases_clauses
- (** [GCases(l,style,r,tur,cc)] = "match 'tur' return 'r' with 'cc'" (in
- [MatchStyle]) *)
+ (** [GCases(l,style,r,tur,cc)] = "match 'tur' return 'r' with 'cc'" (in [MatchStyle]) *)
| GLetTuple of Loc.t * Name.t list * (Name.t * glob_constr option) *
glob_constr * glob_constr
| GIf of Loc.t * glob_constr * (Name.t * glob_constr option) * glob_constr * glob_constr
diff --git a/intf/misctypes.mli b/intf/misctypes.mli
index a20093bc..1452bbc3 100644
--- a/intf/misctypes.mli
+++ b/intf/misctypes.mli
@@ -31,7 +31,8 @@ and 'constr intro_pattern_action_expr =
| IntroApplyOn of 'constr * (Loc.t * 'constr intro_pattern_expr)
| IntroRewrite of bool
and 'constr or_and_intro_pattern_expr =
- (Loc.t * 'constr intro_pattern_expr) list list
+ | IntroOrPattern of (Loc.t * 'constr intro_pattern_expr) list list
+ | IntroAndPattern of (Loc.t * 'constr intro_pattern_expr) list
(** Move destination for hypothesis *)
@@ -43,7 +44,10 @@ type 'id move_location =
(** Sorts *)
-type 'a glob_sort_gen = GProp | GSet | GType of 'a
+type 'a glob_sort_gen =
+ | GProp (** representation of [Prop] literal *)
+ | GSet (** representation of [Set] literal *)
+ | GType of 'a (** representation of [Type] literal *)
type sort_info = string Loc.located list
type level_info = string Loc.located option
diff --git a/intf/notation_term.mli b/intf/notation_term.mli
index 3a643b99..1ab9980a 100644
--- a/intf/notation_term.mli
+++ b/intf/notation_term.mli
@@ -42,7 +42,6 @@ type notation_constr =
(Name.t * notation_constr option * notation_constr) list array *
notation_constr array * notation_constr array
| NSort of glob_sort
- | NPatVar of patvar
| NCast of notation_constr * notation_constr cast_type
(** Note concerning NList: first constr is iterator, second is terminator;
@@ -61,7 +60,7 @@ type subscopes = tmp_scope_name option * scope_name list
(** 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_var_instance_type =
- | NtnTypeConstr | NtnTypeConstrList | NtnTypeBinderList
+ | NtnTypeConstr | NtnTypeOnlyBinder | NtnTypeConstrList | NtnTypeBinderList
(** Type of variables when interpreting a constr_expr as an notation_constr:
in a recursive pattern x..y, both x and y carry the individual type
@@ -74,8 +73,25 @@ type interpretation =
(Id.t * (subscopes * notation_var_instance_type)) list *
notation_constr
+type reversibility_flag = bool
+
type notation_interp_env = {
ninterp_var_type : notation_var_internalization_type Id.Map.t;
ninterp_rec_vars : Id.t Id.Map.t;
- mutable ninterp_only_parse : bool;
+}
+
+type grammar_constr_prod_item =
+ | GramConstrTerminal of Tok.t
+ | GramConstrNonTerminal of Extend.constr_prod_entry_key * Id.t option
+ | GramConstrListMark of int * bool
+ (* tells action rule to make a list of the n previous parsed items;
+ concat with last parsed list if true *)
+
+type notation_grammar = {
+ notgram_level : int;
+ notgram_assoc : Extend.gram_assoc option;
+ notgram_notation : Constrexpr.notation;
+ notgram_prods : grammar_constr_prod_item list list;
+ notgram_typs : notation_var_internalization_type list;
+ notgram_onlyprinting : bool;
}
diff --git a/intf/tacexpr.mli b/intf/tacexpr.mli
index 6c5e4406..5b5957be 100644
--- a/intf/tacexpr.mli
+++ b/intf/tacexpr.mli
@@ -34,13 +34,19 @@ type clear_flag = bool option (* true = clear hyp, false = keep hyp, None = use
type debug = Debug | Info | Off (* for trivial / auto / eauto ... *)
-type 'a core_induction_arg =
+type goal_selector =
+ | SelectNth of int
+ | SelectList of (int * int) list
+ | SelectId of Id.t
+ | SelectAll
+
+type 'a core_destruction_arg =
| ElimOnConstr of 'a
| ElimOnIdent of Id.t located
| ElimOnAnonHyp of int
-type 'a induction_arg =
- clear_flag * 'a core_induction_arg
+type 'a destruction_arg =
+ clear_flag * 'a core_destruction_arg
type inversion_kind =
| SimpleInversion
@@ -62,7 +68,7 @@ type 'id message_token =
| MsgIdent of 'id
type ('dconstr,'id) induction_clause =
- 'dconstr with_bindings induction_arg *
+ 'dconstr with_bindings destruction_arg *
(intro_pattern_naming_expr located option (* eqn:... *)
* 'dconstr or_and_intro_pattern_expr located or_var option) (* as ... *)
* 'id clause_expr option (* in ... *)
@@ -104,6 +110,11 @@ type ml_tactic_name = {
mltac_tactic : string;
}
+type ml_tactic_entry = {
+ mltac_name : ml_tactic_name;
+ mltac_index : int;
+}
+
(** Composite types *)
(** In globalize tactics, we need to keep the initial [constr_expr] to recompute
@@ -115,13 +126,14 @@ type open_constr_expr = unit * constr_expr
type open_glob_constr = unit * glob_constr_and_expr
type binding_bound_vars = Id.Set.t
-type glob_constr_pattern_and_expr = glob_constr_and_expr * constr_pattern
+type glob_constr_pattern_and_expr = binding_bound_vars * glob_constr_and_expr * constr_pattern
+
+type 'a delayed_open = 'a Pretyping.delayed_open =
+ { delayed : 'r. Environ.env -> 'r Sigma.t -> ('a, 'r) Sigma.sigma }
-type delayed_open_constr_with_bindings =
- Environ.env -> Evd.evar_map -> Evd.evar_map * Term.constr with_bindings
+type delayed_open_constr_with_bindings = Term.constr with_bindings delayed_open
-type delayed_open_constr =
- Environ.env -> Evd.evar_map -> Evd.evar_map * Term.constr
+type delayed_open_constr = Term.constr delayed_open
type intro_pattern = delayed_open_constr intro_pattern_expr located
type intro_patterns = delayed_open_constr intro_pattern_expr located list
@@ -132,50 +144,28 @@ type intro_pattern_naming = intro_pattern_naming_expr located
type 'a gen_atomic_tactic_expr =
(* Basic tactics *)
- | TacIntroPattern of 'dtrm intro_pattern_expr located list
- | TacIntroMove of Id.t option * 'nam move_location
- | TacExact of 'trm
+ | TacIntroPattern of evars_flag * 'dtrm intro_pattern_expr located list
| TacApply of advanced_flag * evars_flag * 'trm with_bindings_arg list *
('nam * 'dtrm intro_pattern_expr located option) option
| TacElim of evars_flag * 'trm with_bindings_arg * 'trm with_bindings option
| TacCase of evars_flag * 'trm with_bindings_arg
- | TacFix of Id.t option * int
| TacMutualFix of Id.t * int * (Id.t * int * 'trm) list
- | TacCofix of Id.t option
| TacMutualCofix of Id.t * (Id.t * 'trm) list
| TacAssert of
- bool * 'tacexpr option *
+ bool * 'tacexpr option option *
'dtrm intro_pattern_expr located option * 'trm
| TacGeneralize of ('trm with_occurrences * Name.t) list
- | TacGeneralizeDep of 'trm
| TacLetTac of Name.t * 'trm * 'nam clause_expr * letin_flag *
intro_pattern_naming_expr located option
(* Derived basic tactics *)
| TacInductionDestruct of
rec_flag * evars_flag * ('trm,'dtrm,'nam) induction_clause_list
- | TacDoubleInduction of quantified_hypothesis * quantified_hypothesis
-
- (* Automation tactics *)
- | TacTrivial of debug * 'trm list * string list option
- | TacAuto of debug * int or_var option * 'trm list * string list option
-
- (* Context management *)
- | TacClear of bool * 'nam list
- | TacClearBody of 'nam list
- | TacMove of 'nam * 'nam move_location
- | TacRename of ('nam *'nam) list
-
- (* Trmuctors *)
- | TacSplit of evars_flag * 'trm bindings list
(* Conversion *)
| TacReduce of ('trm,'cst,'pat) red_expr_gen * 'nam clause_expr
| TacChange of 'pat option * 'dtrm * 'nam clause_expr
- (* Equivalence relations *)
- | TacSymmetry of 'nam clause_expr
-
(* Equality and inversion *)
| TacRewrite of evars_flag *
(bool * multi * 'dtrm with_bindings_arg) list * 'nam clause_expr *
@@ -190,7 +180,6 @@ type 'a gen_atomic_tactic_expr =
constraint 'a = <
term:'trm;
- utrm: 'utrm;
dterm: 'dtrm;
pattern:'pat;
constant:'cst;
@@ -202,12 +191,9 @@ constraint 'a = <
(** Possible arguments of a tactic definition *)
-and 'a gen_tactic_arg =
- | TacDynamic of Loc.t * Dyn.t
+type 'a gen_tactic_arg =
| TacGeneric of 'lev generic_argument
- | MetaIdArg of Loc.t * bool * string
| ConstrMayEval of ('trm,'cst,'pat) may_eval
- | UConstr of 'utrm
| Reference of 'ref
| TacCall of Loc.t * 'ref *
'a gen_tactic_arg list
@@ -218,7 +204,6 @@ and 'a gen_tactic_arg =
constraint 'a = <
term:'trm;
- utrm: 'utrm;
dterm: 'dtrm;
pattern:'pat;
constant:'cst;
@@ -290,14 +275,14 @@ and 'a gen_tactic_expr =
('p,'a gen_tactic_expr) match_rule list
| TacFun of 'a gen_tactic_fun_ast
| TacArg of 'a gen_tactic_arg located
+ | TacSelect of goal_selector * 'a gen_tactic_expr
(* For ML extensions *)
- | TacML of Loc.t * ml_tactic_name * 'l generic_argument list
+ | TacML of Loc.t * ml_tactic_entry * 'a gen_tactic_arg list
(* For syntax extensions *)
- | TacAlias of Loc.t * KerName.t * (Id.t * 'l generic_argument) list
+ | TacAlias of Loc.t * KerName.t * 'a gen_tactic_arg list
constraint 'a = <
term:'t;
- utrm: 'utrm;
dterm: 'dtrm;
pattern:'p;
constant:'c;
@@ -312,7 +297,6 @@ and 'a gen_tactic_fun_ast =
constraint 'a = <
term:'t;
- utrm: 'utrm;
dterm: 'dtrm;
pattern:'p;
constant:'c;
@@ -325,7 +309,6 @@ constraint 'a = <
(** Globalized tactics *)
type g_trm = glob_constr_and_expr
-type g_utrm = g_trm
type g_pat = glob_constr_pattern_and_expr
type g_cst = evaluable_global_reference and_short_name or_var
type g_ref = ltac_constant located or_var
@@ -333,7 +316,6 @@ type g_nam = Id.t located
type g_dispatch = <
term:g_trm;
- utrm:g_utrm;
dterm:g_trm;
pattern:g_pat;
constant:g_cst;
@@ -355,7 +337,6 @@ type glob_tactic_arg =
(** Raw tactics *)
type r_trm = constr_expr
-type r_utrm = r_trm
type r_pat = constr_pattern_expr
type r_cst = reference or_by_notation
type r_ref = reference
@@ -364,7 +345,6 @@ type r_lev = rlevel
type r_dispatch = <
term:r_trm;
- utrm:r_utrm;
dterm:r_trm;
pattern:r_pat;
constant:r_cst;
@@ -386,34 +366,38 @@ type raw_tactic_arg =
(** Interpreted tactics *)
type t_trm = Term.constr
-type t_utrm = Glob_term.closed_glob_constr
-type t_pat = glob_constr_pattern_and_expr
-type t_cst = evaluable_global_reference and_short_name
+type t_pat = constr_pattern
+type t_cst = evaluable_global_reference
type t_ref = ltac_constant located
type t_nam = Id.t
type t_dispatch = <
term:t_trm;
- utrm:t_utrm;
dterm:g_trm;
pattern:t_pat;
constant:t_cst;
reference:t_ref;
name:t_nam;
- tacexpr:glob_tactic_expr;
+ tacexpr:unit;
level:tlevel
>
-type tactic_expr =
- t_dispatch gen_tactic_expr
-
type atomic_tactic_expr =
t_dispatch gen_atomic_tactic_expr
-type tactic_arg =
- t_dispatch gen_tactic_arg
-
(** Misc *)
type raw_red_expr = (r_trm, r_cst, r_pat) red_expr_gen
type glob_red_expr = (g_trm, g_cst, g_pat) red_expr_gen
+
+(** Traces *)
+
+type ltac_call_kind =
+ | LtacMLCall of glob_tactic_expr
+ | LtacNotationCall of KerName.t
+ | LtacNameCall of ltac_constant
+ | LtacAtomCall of glob_atomic_tactic_expr
+ | LtacVarCall of Id.t * glob_tactic_expr
+ | LtacConstrInterp of Glob_term.glob_constr * Pretyping.ltac_var_map
+
+type ltac_trace = (Loc.t * ltac_call_kind) list
diff --git a/intf/vernacexpr.mli b/intf/vernacexpr.mli
index 13dde16e..92e4dd61 100644
--- a/intf/vernacexpr.mli
+++ b/intf/vernacexpr.mli
@@ -19,7 +19,6 @@ open Libnames
type lident = Id.t located
type lname = Name.t located
type lstring = string located
-type lreference = reference
type class_rawexpr = FunClass | SortClass | RefClass of reference or_by_notation
@@ -28,11 +27,11 @@ type class_rawexpr = FunClass | SortClass | RefClass of reference or_by_notation
to print a goal that is out of focus (or already solved) it doesn't
make sense to apply a tactic to it. Hence it the types may look very
similar, they do not seem to mean the same thing. *)
-type goal_selector =
+type goal_selector = Tacexpr.goal_selector =
| SelectNth of int
+ | SelectList of (int * int) list
| SelectId of Id.t
| SelectAll
- | SelectAllParallel
type goal_identifier = string
type scope_name = string
@@ -62,7 +61,6 @@ type printable =
| PrintClasses
| PrintTypeClasses
| PrintInstances of reference or_by_notation
- | PrintLtac of reference
| PrintCoercions
| PrintCoercionPaths of class_rawexpr * class_rawexpr
| PrintCanonicalConversions
@@ -70,7 +68,6 @@ type printable =
| PrintHint of reference or_by_notation
| PrintHintGoal
| PrintHintDbName of string
- | PrintRewriteHintDbName of string
| PrintHintDb
| PrintScopes
| PrintScope of string
@@ -109,7 +106,7 @@ type showable =
| ShowTree
| ShowProofNames
| ShowIntros of bool
- | ShowMatch of lident
+ | ShowMatch of reference
| ShowThesis
type comment =
@@ -121,12 +118,23 @@ type reference_or_constr =
| HintsReference of reference
| HintsConstr of constr_expr
+type hint_mode =
+ | ModeInput (* No evars *)
+ | ModeNoHeadEvar (* No evar at the head *)
+ | ModeOutput (* Anything *)
+
+type 'a hint_info_gen =
+ { hint_priority : int option;
+ hint_pattern : 'a option }
+
+type hint_info_expr = constr_pattern_expr hint_info_gen
+
type hints_expr =
- | HintsResolve of (int option * bool * reference_or_constr) list
+ | HintsResolve of (hint_info_expr * bool * reference_or_constr) list
| HintsImmediate of reference_or_constr list
| HintsUnfold of reference list
| HintsTransparency of reference list * bool
- | HintsMode of reference * bool list
+ | HintsMode of reference * hint_mode list
| HintsConstructors of reference list
| HintsExtern of int * constr_expr option * raw_tactic_expr
@@ -204,16 +212,14 @@ type one_inductive_expr =
type proof_expr =
plident option * (local_binder list * constr_expr * (lident option * recursion_order_expr) option)
-type grammar_tactic_prod_item_expr =
- | TacTerm of string
- | TacNonTerm of Loc.t * string * (Names.Id.t * string) option
-
type syntax_modifier =
| SetItemLevel of string list * Extend.production_level
| SetLevel of int
| SetAssoc of Extend.gram_assoc
| SetEntryType of string * Extend.simple_constr_prod_entry_key
- | SetOnlyParsing of Flags.compat_version
+ | SetOnlyParsing
+ | SetOnlyPrinting
+ | SetCompatVersion of Flags.compat_version
| SetFormat of string * string located
type proof_end =
@@ -233,7 +239,32 @@ type section_subset_expr =
| SsSubstr of section_subset_expr * section_subset_expr
| SsFwdClose of section_subset_expr
-(** Extension identifiers for the VERNAC EXTEND mechanism. *)
+(** Extension identifiers for the VERNAC EXTEND mechanism.
+
+ {b ("Extraction", 0} indicates {b Extraction {i qualid}} command.
+
+ {b ("Extraction", 1} indicates {b Recursive Extraction {i qualid}} command.
+
+ {b ("Extraction", 2)} indicates {b Extraction "{i filename}" {i qualid{_ 1}} ... {i qualid{_ n}}} command.
+
+ {b ("ExtractionLibrary", 0)} indicates {b Extraction Library {i ident}} command.
+
+ {b ("RecursiveExtractionLibrary", 0)} indicates {b Recursive Extraction Library {i ident}} command.
+
+ {b ("SeparateExtraction", 0)} indicates {b Separate Extraction {i qualid{_ 1}} ... {i qualid{_ n}}} command.
+
+ {b ("ExtractionLanguage", 0)} indicates {b Extraction Language Ocaml} or {b Extraction Language Haskell} or {b Extraction Language Scheme} or {b Extraction Language JSON} commands.
+
+ {b ("ExtractionImplicit", 0)} indicates {b Extraction Implicit {i qualid} \[ {i ident{_1}} ... {i ident{_n} } \] } command.
+
+ {b ("ExtractionConstant", 0)} indicates {b Extract Constant {i qualid} => {i string}} command.
+
+ {b ("ExtractionInlinedConstant", 0)} indicates {b Extract Inlined Constant {i qualid} => {i string}} command.
+
+ {b ("ExtractionInductive", 0)} indicates {b Extract Inductive {i qualid} => {i string} [ {i string} ... {string} ] {i optstring}} command.
+
+ {b ("ExtractionBlacklist", 0)} indicates {b Extraction Blacklist {i ident{_1}} ... {i ident{_n}}} command.
+ *)
type extend_name =
(** Name of the vernac entry where the tactic is defined, typically found
after the VERNAC EXTEND statement in the source. *)
@@ -287,20 +318,18 @@ type module_binder = bool option * lident list * module_ast_inl
type vernac_expr =
(* Control *)
| VernacLoad of verbose_flag * string
- | VernacTime of vernac_list
- | VernacRedirect of string * vernac_list
+ | VernacTime of vernac_expr located
+ | VernacRedirect of string * vernac_expr located
| VernacTimeout of int * vernac_expr
| VernacFail of vernac_expr
| VernacError of exn (* always fails *)
(* Syntax *)
- | VernacTacticNotation of
- int * grammar_tactic_prod_item_expr list * raw_tactic_expr
| VernacSyntaxExtension of
obsolete_locality * (lstring * syntax_modifier list)
| VernacOpenCloseScope of obsolete_locality * (bool * scope_name)
| VernacDelimiters of scope_name * string option
- | VernacBindScope of scope_name * reference or_by_notation list
+ | VernacBindScope of scope_name * class_rawexpr list
| VernacInfix of obsolete_locality * (lstring * syntax_modifier list) *
constr_expr * scope_name option
| VernacNotation of
@@ -324,14 +353,14 @@ type vernac_expr =
| VernacScheme of (lident option * scheme) list
| VernacCombinedScheme of lident * lident list
| VernacUniverse of lident list
- | VernacConstraint of (lident * Univ.constraint_type * lident) list
+ | VernacConstraint of (glob_level * Univ.constraint_type * glob_level) list
(* Gallina extensions *)
| VernacBeginSection of lident
| VernacEndSegment of lident
| VernacRequire of
- lreference option * export_flag option * lreference list
- | VernacImport of export_flag * lreference list
+ reference option * export_flag option * reference list
+ | VernacImport of export_flag * reference list
| VernacCanonical of reference or_by_notation
| VernacCoercion of obsolete_locality * reference or_by_notation *
class_rawexpr * class_rawexpr
@@ -345,12 +374,12 @@ type vernac_expr =
local_binder list * (* super *)
typeclass_constraint * (* instance name, class name, params *)
(bool * constr_expr) option * (* props *)
- int option (* Priority *)
+ hint_info_expr
| VernacContext of local_binder list
| VernacDeclareInstances of
- reference list * int option (* instance names, priority *)
+ (reference * hint_info_expr) list (* instances names, priorities and patterns *)
| VernacDeclareClass of reference (* inductive or definition name *)
@@ -365,7 +394,6 @@ type vernac_expr =
(* Solving *)
- | VernacSolve of goal_selector * int option * raw_tactic_expr * bool
| VernacSolveExistential of int * constr_expr
(* Auxiliary file and library management *)
@@ -386,8 +414,6 @@ type vernac_expr =
| VernacBackTo of int
(* Commands *)
- | VernacDeclareTacticDefinition of
- (rec_flag * (reference * bool * raw_tactic_expr) list)
| VernacCreateHintDb of string * bool
| VernacRemoveHints of string list * reference list
| VernacHints of obsolete_locality * string list * hints_expr
@@ -396,10 +422,12 @@ type vernac_expr =
| VernacDeclareImplicits of reference or_by_notation *
(explicitation * bool * bool) list list
| VernacArguments of reference or_by_notation *
- ((Name.t * bool * (Loc.t * string) option * bool * bool) list) list *
- int * [ `ReductionDontExposeCase | `ReductionNeverUnfold | `Rename |
- `ExtraScopes | `Assert | `ClearImplicits | `ClearScopes |
- `DefaultImplicits ] list
+ vernac_argument_status list (* Main arguments status list *) *
+ (Name.t * vernac_implicit_status) list list (* Extra implicit status lists *) *
+ int option (* Number of args to trigger reduction *) *
+ [ `ReductionDontExposeCase | `ReductionNeverUnfold | `Rename |
+ `ExtraScopes | `Assert | `ClearImplicits | `ClearScopes |
+ `DefaultImplicits ] list
| VernacArgumentsScope of reference or_by_notation *
scope_name option list
| VernacReserve of simple_binder list
@@ -409,6 +437,7 @@ type vernac_expr =
(Conv_oracle.level * reference or_by_notation list) list
| VernacUnsetOption of Goptions.option_name
| VernacSetOption of Goptions.option_name * option_value
+ | VernacSetAppendOption of Goptions.option_name * string
| VernacAddOption of Goptions.option_name * option_ref_value list
| VernacRemoveOption of Goptions.option_name * option_ref_value list
| VernacMemOption of Goptions.option_name * option_ref_value list
@@ -421,7 +450,6 @@ type vernac_expr =
| VernacLocate of locatable
| VernacRegister of lident * register_kind
| VernacComments of comment list
- | VernacNop
(* Stm backdoor *)
| VernacStm of vernac_expr stm_vernac
@@ -455,9 +483,18 @@ type vernac_expr =
| VernacPolymorphic of bool * vernac_expr
| VernacLocal of bool * vernac_expr
-and vernac_list = located_vernac_expr list
+and tacdef_body =
+ | TacticDefinition of Id.t Loc.located * raw_tactic_expr (* indicates that user employed ':=' in Ltac body *)
+ | TacticRedefinition of reference * raw_tactic_expr (* indicates that user employed '::=' in Ltac body *)
+
+and vernac_implicit_status = Implicit | MaximallyImplicit | NotImplicit
-and located_vernac_expr = Loc.t * vernac_expr
+and vernac_argument_status = {
+ name : Name.t;
+ recarg_like : bool;
+ notation_scope : (Loc.t * string) option;
+ implicit_status : vernac_implicit_status;
+}
(* A vernac classifier has to tell if a command:
vernac_when: has to be executed now (alters the parser) or later
@@ -468,7 +505,7 @@ type vernac_type =
| VtStartProof of vernac_start
| VtSideff of vernac_sideff_type
| VtQed of vernac_qed_type
- | VtProofStep of bool (* parallelize *)
+ | VtProofStep of proof_step
| VtProofMode of string
| VtQuery of vernac_part_of_script * report_with
| VtStm of vernac_control * vernac_part_of_script
@@ -490,6 +527,13 @@ and vernac_control =
and opacity_guarantee =
| GuaranteesOpacity (** Only generates opaque terms at [Qed] *)
| Doesn'tGuaranteeOpacity (** May generate transparent terms even with [Qed].*)
+and proof_step = { (* TODO: inline with OCaml 4.03 *)
+ parallel : [ `Yes of solving_tac * anon_abstracting_tac | `No ];
+ proof_block_detection : proof_block_name option
+}
+and solving_tac = bool (* a terminator *)
+and anon_abstracting_tac = bool (* abstracting anonymously its result *)
+and proof_block_name = string (* open type of delimiters *)
type vernac_when =
| VtNow
| VtLater