1
(************************************************************************)
2
(* v * The Coq Proof Assistant / The Coq Development Team *)
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
4
(* \VV/ **************************************************************)
5
(* // * This file is distributed under the terms of the *)
6
(* * GNU Lesser General Public License Version 2.1 *)
7
(************************************************************************)
9
(*i $Id: tacinterp.mli 12102 2009-04-24 10:48:11Z herbelin $ i*)
27
(* Values for interpretation *)
29
| VRTactic of (goal list sigma * validation)
30
| VFun of ltac_trace * (identifier*value) list *
31
identifier option list * glob_tactic_expr
34
| VIntroPattern of intro_pattern_expr
36
| VConstr_context of constr
38
| VRec of (identifier*value) list ref * glob_tactic_expr
40
(* Signature for interpretation: val\_interp and interpretation functions *)
42
{ lfun : (identifier * value) list;
43
avoid_ids : identifier list;
47
val extract_ltac_vars : interp_sign -> Evd.evar_map -> Environ.env ->
48
Pretyping.var_map * Pretyping.unbound_ltac_var_map
50
(* Transforms an id into a constr if possible *)
51
val constr_of_id : Environ.env -> identifier -> constr
53
(* To embed several objects in Coqast.t *)
54
val tactic_in : (interp_sign -> glob_tactic_expr) -> Dyn.t
55
val tactic_out : Dyn.t -> (interp_sign -> glob_tactic_expr)
57
val tacticIn : (interp_sign -> raw_tactic_expr) -> raw_tactic_expr
58
val globTacticIn : (interp_sign -> glob_tactic_expr) -> raw_tactic_expr
59
val valueIn : value -> raw_tactic_arg
60
val constrIn : constr -> constr_expr
62
(* Sets the debugger mode *)
63
val set_debug : debug_info -> unit
65
(* Gives the state of debug *)
66
val get_debug : unit -> debug_info
68
(* Adds a definition for tactics in the table *)
70
bool -> (Libnames.reference * bool * raw_tactic_expr) list -> unit
71
val add_primitive_tactic : string -> glob_tactic_expr -> unit
73
(* Tactic extensions *)
75
string -> (typed_generic_argument list -> tactic) -> unit
76
val overwriting_add_tactic :
77
string -> (typed_generic_argument list -> tactic) -> unit
79
string -> (typed_generic_argument list) -> tactic
81
(* Adds an interpretation function for extra generic arguments *)
83
ltacvars : identifier list * identifier list;
84
ltacrecvars : (identifier * Nametab.ltac_constant) list;
85
gsigma : Evd.evar_map;
88
val add_interp_genarg :
90
(glob_sign -> raw_generic_argument -> glob_generic_argument) *
91
(interp_sign -> goal sigma -> glob_generic_argument ->
92
typed_generic_argument) *
93
(substitution -> glob_generic_argument -> glob_generic_argument)
97
interp_sign -> goal sigma -> glob_generic_argument -> typed_generic_argument
100
glob_sign -> raw_generic_argument -> glob_generic_argument
103
glob_sign -> raw_tactic_expr -> glob_tactic_expr
106
glob_sign -> constr_expr -> rawconstr_and_expr
108
val intern_constr_with_bindings :
109
glob_sign -> constr_expr * constr_expr Rawterm.bindings ->
110
rawconstr_and_expr * rawconstr_and_expr Rawterm.bindings
113
glob_sign -> identifier Util.located -> identifier Util.located
116
substitution -> glob_generic_argument -> glob_generic_argument
118
val subst_rawconstr_and_expr :
119
substitution -> rawconstr_and_expr -> rawconstr_and_expr
121
(* Interprets any expression *)
122
val val_interp : interp_sign -> goal sigma -> glob_tactic_expr -> value
124
(* Interprets an expression that evaluates to a constr *)
125
val interp_ltac_constr : interp_sign -> goal sigma -> glob_tactic_expr ->
128
(* Interprets redexp arguments *)
129
val interp_redexp : Environ.env -> Evd.evar_map -> raw_red_expr -> red_expr
131
(* Interprets tactic expressions *)
132
val interp_tac_gen : (identifier * value) list -> identifier list ->
133
debug_info -> raw_tactic_expr -> tactic
135
val interp_hyp : interp_sign -> goal sigma -> identifier located -> identifier
137
val interp_bindings : interp_sign -> goal sigma -> rawconstr_and_expr Rawterm.bindings ->
138
Evd.open_constr Rawterm.bindings
140
(* Initial call for interpretation *)
141
val glob_tactic : raw_tactic_expr -> glob_tactic_expr
143
val glob_tactic_env : identifier list -> Environ.env -> raw_tactic_expr -> glob_tactic_expr
145
val eval_tactic : glob_tactic_expr -> tactic
147
val interp : raw_tactic_expr -> tactic
149
val eval_ltac_constr : goal sigma -> raw_tactic_expr -> constr
151
val subst_tactic : substitution -> glob_tactic_expr -> glob_tactic_expr
153
(* Hides interpretation for pretty-print *)
155
val hide_interp : raw_tactic_expr -> tactic option -> tactic
157
(* Declare the default tactic to fill implicit arguments *)
158
val declare_implicit_tactic : tactic -> unit
160
(* Declare the xml printer *)
161
val declare_xml_printer :
162
(out_channel -> Environ.env -> Evd.evar_map -> constr -> unit) -> unit
165
val print_ltac : Libnames.qualid -> std_ppcmds
167
(* Internals that can be useful for syntax extensions. *)
169
exception CannotCoerceTo of string
171
val interp_ltac_var : (value -> 'a) -> interp_sign -> Environ.env option -> identifier located -> 'a
173
val interp_int : interp_sign -> identifier located -> int
175
val error_ltac_variable : loc -> identifier -> Environ.env option -> value -> string -> 'a