~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to proofs/refiner.mli

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
(************************************************************************)
 
8
 
 
9
(*i $Id: refiner.mli 11735 2009-01-02 17:22:31Z herbelin $ i*)
 
10
 
 
11
(*i*)
 
12
open Term
 
13
open Sign
 
14
open Evd
 
15
open Proof_trees
 
16
open Proof_type
 
17
open Tacexpr
 
18
(*i*)
 
19
 
 
20
(* The refiner (handles primitive rules and high-level tactics). *)
 
21
 
 
22
val sig_it  : 'a sigma -> 'a
 
23
val project : 'a sigma -> evar_map
 
24
 
 
25
val pf_env  : goal sigma -> Environ.env
 
26
val pf_hyps : goal sigma -> named_context
 
27
 
 
28
val unpackage : 'a sigma -> evar_map ref * 'a
 
29
val repackage : evar_map ref -> 'a -> 'a sigma
 
30
val apply_sig_tac :
 
31
  evar_map ref -> (goal sigma -> (goal list) sigma * validation) -> goal -> (goal list) * validation
 
32
 
 
33
type transformation_tactic = proof_tree -> (goal list * validation)
 
34
 
 
35
(*s Hiding the implementation of tactics. *)
 
36
 
 
37
(* [abstract_tactic tac] hides the (partial) proof produced by [tac] under
 
38
   a single proof node. The boolean tells if the default tactic is used. *)
 
39
val abstract_operation : compound_rule -> tactic -> tactic
 
40
val abstract_tactic : ?dflt:bool -> atomic_tactic_expr -> tactic -> tactic
 
41
val abstract_tactic_expr : ?dflt:bool -> tactic_expr -> tactic -> tactic
 
42
val abstract_extended_tactic :
 
43
  ?dflt:bool -> string -> typed_generic_argument list -> tactic -> tactic
 
44
 
 
45
val refiner : rule -> tactic
 
46
val frontier : transformation_tactic
 
47
val list_pf : proof_tree -> goal list
 
48
val unTAC : tactic -> goal sigma -> proof_tree sigma
 
49
 
 
50
 
 
51
(* Install a hook frontier_map and frontier_mapi call on the new node they create *)
 
52
val set_solve_hook : (Proof_type.proof_tree -> unit) -> unit
 
53
(* [frontier_map f n p] applies f on the n-th open subgoal of p and
 
54
   rebuilds proof-tree.
 
55
   n=1 for first goal, n negative counts from the right *)
 
56
val frontier_map :
 
57
  (proof_tree -> proof_tree) -> int -> proof_tree -> proof_tree
 
58
 
 
59
(* [frontier_mapi f p] applies (f i) on the i-th open subgoal of p. *)
 
60
val frontier_mapi :
 
61
  (int -> proof_tree -> proof_tree) -> proof_tree -> proof_tree
 
62
 
 
63
(*s Tacticals. *)
 
64
 
 
65
(* [tclNORMEVAR] forces propagation of evar constraints *)
 
66
val tclNORMEVAR       : tactic
 
67
 
 
68
(* [tclIDTAC] is the identity tactic without message printing*)
 
69
val tclIDTAC          : tactic
 
70
val tclIDTAC_MESSAGE  : Pp.std_ppcmds -> tactic
 
71
 
 
72
(* [tclEVARS sigma] changes the current evar map *)
 
73
val tclEVARS : evar_map -> tactic
 
74
 
 
75
(* [tclTHEN tac1 tac2 gls] applies the tactic [tac1] to [gls] and applies
 
76
   [tac2] to every resulting subgoals *)
 
77
val tclTHEN          : tactic -> tactic -> tactic
 
78
 
 
79
(* [tclTHENLIST [t1;..;tn]] applies [t1] THEN [t2] ... THEN [tn]. More
 
80
   convenient than [tclTHEN] when [n] is large *)
 
81
val tclTHENLIST      : tactic list -> tactic
 
82
 
 
83
(* [tclTHEN_i tac1 tac2 gls] applies the tactic [tac1] to [gls] and applies
 
84
   [(tac2 i)] to the [i]$^{th}$ resulting subgoal (starting from 1) *)
 
85
val tclTHEN_i        : tactic -> (int -> tactic) -> tactic
 
86
 
 
87
(* [tclTHENLAST tac1 tac2 gls] applies the tactic [tac1] to [gls] and [tac2]
 
88
   to the last resulting subgoal (previously called [tclTHENL]) *)
 
89
val tclTHENLAST         : tactic -> tactic -> tactic
 
90
 
 
91
(* [tclTHENFIRST tac1 tac2 gls] applies the tactic [tac1] to [gls] and [tac2]
 
92
   to the first resulting subgoal *)
 
93
val tclTHENFIRST         : tactic -> tactic -> tactic
 
94
 
 
95
(* [tclTHENS tac1 [|t1 ; ... ; tn|] gls] applies the tactic [tac1] to
 
96
   [gls] and applies [t1],..., [tn] to the [n] resulting subgoals. Raises
 
97
   an error if the number of resulting subgoals is not [n] *)
 
98
val tclTHENSV         : tactic -> tactic array -> tactic
 
99
 
 
100
(* Same with a list of tactics *)
 
101
val tclTHENS         : tactic -> tactic list -> tactic
 
102
 
 
103
(* [tclTHENST] is renamed [tclTHENSFIRSTn]
 
104
val tclTHENST        : tactic -> tactic array -> tactic -> tactic
 
105
*)
 
106
 
 
107
(* [tclTHENS3PARTS tac1 [|t1 ; ... ; tn|] tac2 [|t'1 ; ... ; t'm|] gls]
 
108
   applies the tactic [tac1] to [gls] then, applies [t1], ..., [tn] to
 
109
   the first [n] resulting subgoals, [t'1], ..., [t'm] to the last [m]
 
110
   subgoals and [tac2] to the rest of the subgoals in the middle. Raises an
 
111
   error if the number of resulting subgoals is strictly less than [n+m] *)
 
112
val tclTHENS3PARTS     : tactic -> tactic array -> tactic -> tactic array -> tactic
 
113
 
 
114
(* [tclTHENSLASTn tac1 [t1 ; ... ; tn] tac2 gls] applies [t1],...,[tn] on the
 
115
   last [n] resulting subgoals and [tac2] on the remaining first subgoals *)
 
116
val tclTHENSLASTn     : tactic -> tactic -> tactic array -> tactic
 
117
 
 
118
(* [tclTHENSFIRSTn tac1 [t1 ; ... ; tn] tac2 gls] first applies [tac1], then
 
119
   applies [t1],...,[tn] on the first [n] resulting subgoals and
 
120
   [tac2] for the remaining last subgoals (previously called tclTHENST) *)
 
121
val tclTHENSFIRSTn : tactic -> tactic array -> tactic -> tactic
 
122
 
 
123
(* [tclTHENLASTn tac1 [t1 ; ... ; tn] gls] first applies [tac1] then,
 
124
   applies [t1],...,[tn] on the last [n] resulting subgoals and leaves
 
125
   unchanged the other subgoals *)
 
126
val tclTHENLASTn    : tactic -> tactic array -> tactic
 
127
 
 
128
(* [tclTHENFIRSTn tac1 [t1 ; ... ; tn] gls] first applies [tac1] then,
 
129
   applies [t1],...,[tn] on the first [n] resulting subgoals and leaves
 
130
   unchanged the other subgoals (previously called [tclTHENSI]) *)
 
131
val tclTHENFIRSTn   : tactic -> tactic array -> tactic
 
132
 
 
133
(* A special exception for levels for the Fail tactic *)
 
134
exception FailError of int * Pp.std_ppcmds
 
135
 
 
136
(* Takes an exception and either raise it at the next
 
137
   level or do nothing. *)
 
138
val catch_failerror  : exn -> unit
 
139
 
 
140
val tclORELSE0       : tactic -> tactic -> tactic
 
141
val tclORELSE        : tactic -> tactic -> tactic
 
142
val tclREPEAT        : tactic -> tactic
 
143
val tclREPEAT_MAIN   : tactic -> tactic
 
144
val tclFIRST         : tactic list -> tactic
 
145
val tclSOLVE         : tactic list -> tactic
 
146
val tclTRY           : tactic -> tactic
 
147
val tclTHENTRY       : tactic -> tactic -> tactic
 
148
val tclCOMPLETE      : tactic -> tactic
 
149
val tclAT_LEAST_ONCE : tactic -> tactic
 
150
val tclFAIL          : int -> Pp.std_ppcmds -> tactic
 
151
val tclDO            : int -> tactic -> tactic
 
152
val tclPROGRESS      : tactic -> tactic
 
153
val tclWEAK_PROGRESS : tactic -> tactic
 
154
val tclNOTSAMEGOAL   : tactic -> tactic
 
155
val tclINFO          : tactic -> tactic
 
156
 
 
157
(* [tclIFTHENELSE tac1 tac2 tac3 gls] first applies [tac1] to [gls] then,
 
158
   if it succeeds, applies [tac2] to the resulting subgoals, 
 
159
   and if not applies [tac3] to the initial goal [gls] *)
 
160
val tclIFTHENELSE    : tactic -> tactic -> tactic -> tactic
 
161
val tclIFTHENSELSE   : tactic -> tactic list -> tactic ->tactic
 
162
val tclIFTHENSVELSE   : tactic -> tactic array -> tactic ->tactic
 
163
 
 
164
(* [tclIFTHENTRYELSEMUST tac1 tac2 gls] applies [tac1] then [tac2]. If [tac1]
 
165
   has been successful, then [tac2] may fail. Otherwise, [tac2] must succeed. 
 
166
   Equivalent to [(tac1;try tac2)||tac2] *)
 
167
 
 
168
val tclIFTHENTRYELSEMUST : tactic -> tactic -> tactic
 
169
 
 
170
(*s Tactics handling a list of goals. *)
 
171
 
 
172
type validation_list = proof_tree list -> proof_tree list
 
173
 
 
174
type tactic_list = (goal list sigma) -> (goal list sigma) * validation_list
 
175
 
 
176
val tclFIRSTLIST       : tactic_list list -> tactic_list
 
177
val tclIDTAC_list      : tactic_list
 
178
val first_goal         : 'a list sigma -> 'a sigma
 
179
val apply_tac_list     : tactic -> tactic_list
 
180
val then_tactic_list   : tactic_list -> tactic_list -> tactic_list
 
181
val tactic_list_tactic : tactic_list -> tactic
 
182
val goal_goal_list     : 'a sigma -> 'a list sigma
 
183
 
 
184
 
 
185
(*s Functions for handling the state of the proof editor. *)
 
186
 
 
187
type pftreestate
 
188
 
 
189
val proof_of_pftreestate : pftreestate -> proof_tree
 
190
val cursor_of_pftreestate : pftreestate -> int list
 
191
val is_top_pftreestate : pftreestate -> bool
 
192
val match_rule : (rule -> bool) -> pftreestate -> bool
 
193
val evc_of_pftreestate : pftreestate -> evar_map
 
194
val top_goal_of_pftreestate : pftreestate -> goal sigma
 
195
val nth_goal_of_pftreestate : int -> pftreestate -> goal sigma
 
196
 
 
197
val traverse : int -> pftreestate -> pftreestate
 
198
val map_pftreestate : 
 
199
  (evar_map ref -> proof_tree -> proof_tree) -> pftreestate -> pftreestate
 
200
val solve_nth_pftreestate : int -> tactic -> pftreestate -> pftreestate
 
201
val solve_pftreestate : tactic -> pftreestate -> pftreestate
 
202
 
 
203
(* a weak version of logical undoing, that is really correct only *)
 
204
(* if there are no existential variables.                         *)
 
205
val weak_undo_pftreestate : pftreestate -> pftreestate
 
206
 
 
207
val mk_pftreestate : goal -> pftreestate
 
208
val extract_open_proof : evar_map -> proof_tree -> constr * (int * types) list
 
209
val extract_open_pftreestate : pftreestate -> constr * Termops.metamap
 
210
val extract_pftreestate : pftreestate -> constr
 
211
val first_unproven : pftreestate -> pftreestate
 
212
val last_unproven : pftreestate -> pftreestate
 
213
val nth_unproven : int -> pftreestate -> pftreestate
 
214
val node_prev_unproven : int -> pftreestate -> pftreestate
 
215
val node_next_unproven : int -> pftreestate -> pftreestate
 
216
val next_unproven : pftreestate -> pftreestate
 
217
val prev_unproven : pftreestate -> pftreestate
 
218
val top_of_tree : pftreestate -> pftreestate
 
219
val match_rule : (rule -> bool) -> pftreestate -> bool
 
220
val up_until_matching_rule : (rule -> bool) -> 
 
221
  pftreestate -> pftreestate
 
222
val up_to_matching_rule : (rule -> bool) -> 
 
223
  pftreestate -> pftreestate
 
224
val change_rule : (rule -> rule) -> pftreestate -> pftreestate
 
225
val change_constraints_pftreestate 
 
226
  : evar_map -> pftreestate -> pftreestate
 
227
 
 
228
 
 
229
(*s Pretty-printers. *)
 
230
 
 
231
(*i*)
 
232
open Pp
 
233
(*i*)
 
234
val set_info_printer :
 
235
  (evar_map -> named_context -> proof_tree -> Pp.std_ppcmds) -> unit