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 | `Normalize ]
29 type loc = CicAst.location
31 type ('term, 'ident) pattern =
32 ('ident * 'term) list * 'term option
34 type ('term, 'ident) tactic =
35 | Absurd of loc * 'term
36 | Apply of loc * 'term
37 | Auto of loc * int option
39 | Change of loc * 'term * 'term * ('term,'ident) pattern (* what, with what, where *)
40 | Contradiction of loc
42 | Decompose of loc * 'term
43 | Discriminate of loc * 'term
44 | Elim of loc * 'term * 'term option (* what to elim, which principle to use *)
45 | ElimType of loc * 'term
46 | Exact of loc * 'term
48 | Fold of loc * reduction_kind * 'term
50 | Generalize of loc * 'term * ('term, 'ident) pattern
51 | Goal of loc * int (* change current goal, argument is goal number 1-based *)
52 | Injection of loc * 'term
53 | Intros of loc * int option * 'ident list
55 | LetIn of loc * 'term * 'ident
56 | Reduce of loc * reduction_kind * ('term, 'ident) pattern
58 | Replace of loc * 'term * 'term (* what, with what *)
59 | Rewrite of loc * direction * 'term * ('term, 'ident) pattern
64 | Transitivity of loc * 'term
65 | FwdSimpl of loc * 'term
66 | LApply of loc * 'term
76 (** <name, inductive/coinductive, type, constructor list>
77 * true means inductive, false coinductive *)
78 type 'term inductive_type = string * bool * 'term * (string * 'term) list
80 type search_kind = [ `Locate | `Hint | `Match | `Elim ]
82 type print_kind = [ `Env | `Coer ]
86 | WHint of loc * 'term
87 | WMatch of loc * 'term
88 | WInstance of loc * 'term
89 | WLocate of loc * string
90 | WElim of loc * 'term
93 | Print of loc * string
94 | Check of loc * 'term
97 (* | Redo of loc * int option
98 | Undo of loc * int option *)
99 (* | Print of loc * print_kind *)
100 | Search_pat of loc * search_kind * string (* searches with string pattern *)
101 | Search_term of loc * search_kind * 'term (* searches with term pattern *)
104 | Ident_alias of string * string (* identifier, uri *)
105 | Symbol_alias of string * int * string (* name, instance no, description *)
106 | Number_alias of int * string (* instance no, description *)
109 | Inductive of (string * CicAst.term) list * CicAst.term inductive_type list
110 (** parameters, list of loc * mutual inductive types *)
111 | Theorem of thm_flavour * string * CicAst.term * CicAst.term option
112 (** flavour, name, type, body
113 * - name is absent when an unnamed theorem is being proved, tipically in
115 * - body is present when its given along with the command, otherwise it
116 * will be given in proof editing mode using the tactical language
119 (string * CicAst.term) list * string * CicAst.term *
120 (string * CicAst.term) list
122 type ('term,'obj) command =
123 | Set of loc * string * string
126 * Name is needed when theorem was started without providing a name
128 | Coercion of loc * 'term
129 | Alias of loc * alias_spec
130 (** parameters, name, type, fields *)
133 type ('term, 'ident) tactical =
134 | Tactic of loc * ('term, 'ident) tactic
136 | Do of loc * int * ('term, 'ident) tactical
138 | Repeat of loc * ('term, 'ident) tactical
139 | Seq of loc * ('term, 'ident) tactical list (* sequential composition *)
140 | Then of loc * ('term, 'ident) tactical * ('term, 'ident) tactical list
141 | Tries of loc * ('term, 'ident) tactical list
142 (* try a sequence of loc * tacticals until one succeeds, fail otherwise *)
143 | Try of loc * ('term, 'ident) tactical (* try a tactical and mask failures *)
146 type ('term, 'obj, 'ident) code =
147 | Command of loc * ('term,'obj) command
148 | Macro of loc * 'term macro
149 (* Macro are substantially queries, but since we are not the kind of
150 * peolpe that like to push "start" to turn off the computer
151 * we added this command *)
152 | Tactical of loc * ('term, 'ident) tactical
154 type ('term, 'obj, 'ident) comment =
155 | Note of loc * string
156 | Code of loc * ('term, 'obj, 'ident) code
158 type ('term, 'obj, 'ident) statement =
159 | Executable of loc * ('term, 'obj, 'ident) code
160 | Comment of loc * ('term, 'obj, 'ident) comment