1 (* Copyright (C) 2004, HELM Team.
3 * This file is part of HELM, an Hypertextual, Electronic
4 * Library of Mathematics, developed at the Computer Science
5 * Department, University of Bologna, Italy.
7 * HELM is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * HELM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with HELM; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
22 * For details, see the HELM World-Wide-Web page,
23 * http://helm.cs.unibo.it/
26 type direction = [ `Left | `Right ]
27 type reduction_kind = [ `Reduce | `Simpl | `Whd ]
28 (* type 'term pattern = Pattern of 'term *)
30 (* everywhere includes goal and hypotheses *)
31 type 'term pattern = [ `Goal | `Everywhere ]
33 (* when an 'ident option is None, the default is to apply the tactic
34 to the current goal *)
36 type loc = CicAst.location
38 type ('term, 'ident) tactic =
39 | Absurd of loc * 'term
40 | Apply of loc * 'term
41 | Auto of loc * int option
43 | Change of loc * 'term * 'term * 'ident option (* what, with what, where *)
44 | Change_pattern of loc * 'term pattern * 'term * 'ident option
45 (* what, with what, where *)
46 | Contradiction of loc
48 | Decompose of loc * 'ident * 'ident list (* where, which principles *)
49 | Discriminate of loc * 'ident
50 | Elim of loc * 'term * 'term option (* what to elim, which principle to use *)
51 | ElimType of loc * 'term
52 | Exact of loc * 'term
54 | Fold of loc * reduction_kind * 'term
56 | Goal of loc * int (* change current goal, argument is goal number 1-based *)
57 | Injection of loc * 'ident
58 | Intros of loc * int option * 'ident list
60 | LetIn of loc * 'term * 'ident
61 (* | Named_intros of loc * 'ident list (* joined with Intros above *) *)
62 (* | Reduce of loc * reduction_kind * 'term pattern * 'ident option (* what, where *) *)
63 | Reduce of loc * reduction_kind * ('term list * 'term pattern) option
64 (* kind, (what, where)
65 * if second argument is None, reduction is applied to the current goal,
66 * otherwise to each occurrence of loc * terms given in list occuring in term
69 | Replace of loc * 'term * 'term (* what, with what *)
70 | Replace_pattern of loc * 'term pattern * 'term
71 | Rewrite of loc * direction * 'term * 'ident option
76 | Transitivity of loc * 'term
86 (** <name, inductive/coinductive, type, constructor list>
87 * true means inductive, false coinductive *)
88 type 'term inductive_type = string * bool * 'term * (string * 'term) list
90 type search_kind = [ `Locate | `Hint | `Match | `Elim ]
92 type print_kind = [ `Env | `Coer ]
96 | Print of loc * string
97 | Check of loc * 'term
99 | Match of loc * 'term
100 | Instance of loc * 'term
102 | Redo of loc * int option
103 | Undo of loc * int option
104 (* | Print of loc * print_kind *)
105 | Search_pat of loc * search_kind * string (* searches with string pattern *)
106 | Search_term of loc * search_kind * 'term (* searches with term pattern *)
109 | Ident_alias of string * string (* identifier, uri *)
110 | Symbol_alias of string * int * string (* name, instance no, description *)
111 | Number_alias of int * string (* instance no, description *)
114 | Set of loc * string * string
117 * Name is needed when theorem was started without providing a name
119 | Inductive of loc * (string * 'term) list * 'term inductive_type list
120 (** parameters, list of loc * mutual inductive types *)
121 | Theorem of loc * thm_flavour * string option * 'term * 'term option
122 (** flavour, name, type, body
123 * - name is absent when an unnamed theorem is being proved, tipically in
125 * - body is present when its given along with the command, otherwise it
126 * will be given in proof editing mode using the tactical language
128 | Coercion of loc * 'term
129 | Alias of loc * alias_spec
131 type ('term, 'ident) tactical =
132 | Tactic of loc * ('term, 'ident) tactic
134 | Do of loc * int * ('term, 'ident) tactical
136 | Repeat of loc * ('term, 'ident) tactical
137 | Seq of loc * ('term, 'ident) tactical list (* sequential composition *)
138 | Then of loc * ('term, 'ident) tactical * ('term, 'ident) tactical list
139 | Tries of loc * ('term, 'ident) tactical list
140 (* try a sequence of loc * tacticals until one succeeds, fail otherwise *)
141 | Try of loc * ('term, 'ident) tactical (* try a tactical and mask failures *)
143 type ('term, 'ident) statement =
144 | Command of loc * 'term command
145 | Macro of loc * 'term macro
146 (* Macro are substantially queries, but since we are not the kind of
147 * peolpe that like to push "start" to turn off the computer
148 * we added this command *)
149 | Tactical of loc * ('term, 'ident) tactical