blob: 631d7e0af26c8e07543cdab8bb2eb317640ceccf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
(***********************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
(* <O___,, * INRIA-Rocquencourt & LRI-CNRS-Orsay *)
(* \VV/ *************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(***********************************************************************)
(*i $Id$ i*)
(*i*)
open Dyn
open Pp
open Names
open Proof_type
open Tacmach
open Tactic_debug
open Term
(*i*)
(* Values for interpretation *)
type value =
| VTactic of tactic
| VFTactic of tactic_arg list * (tactic_arg list -> tactic)
| VRTactic of (goal list sigma * validation)
| VContext of (interp_sign -> goal sigma -> value)
| VArg of tactic_arg
| VFun of (identifier * value) list * identifier option list * Coqast.t
| VVoid
| VRec of value ref
(* Signature for interpretation: val\_interp and interpretation functions *)
and interp_sign =
{ evc : Evd.evar_map;
env : Environ.env;
lfun : (identifier * value) list;
lmatch : (int * constr) list;
goalopt : goal sigma option;
debug : debug_info }
(* Gives the constr corresponding to a Constr [tactic_arg] *)
val constr_of_Constr : tactic_arg -> constr
(* To embed several objects in Coqast.t *)
val tacticIn : (interp_sign -> Coqast.t) -> Coqast.t
val tacticOut : Coqast.t -> (interp_sign -> Coqast.t)
val valueIn : value -> Coqast.t
val valueOut: Coqast.t -> value
val constrIn : constr -> Coqast.t
val constrOut : Coqast.t -> constr
val loc : Coqast.loc
(* Sets the debugger mode *)
val set_debug : debug_info -> unit
(* Gives the state of debug *)
val get_debug : unit -> debug_info
(* Adds a definition for tactics in the table *)
val add_tacdef : identifier -> Coqast.t -> unit
(* Interprets any expression *)
val val_interp : interp_sign -> Coqast.t -> value
(* Interprets tactic arguments *)
val interp_tacarg : interp_sign -> Coqast.t -> tactic_arg
(* Interprets tactic expressions *)
val tac_interp : (identifier * value) list -> (int * constr) list ->
debug_info -> Coqast.t -> tactic
(* Initial call for interpretation *)
val interp : Coqast.t -> tactic
(* Hides interpretation for pretty-print *)
val hide_interp : Coqast.t -> tactic
(* For bad tactic calls *)
val bad_tactic_args : string -> 'a
|