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 = [ `LeftToRight | `RightToLeft ]
27 type reduction_kind = [ `Reduce | `Simpl | `Whd | `Normalize ]
29 type loc = CicNotationPt.location
31 type ('term, 'ident) pattern = 'term option * ('ident * 'term) list * 'term
33 type ('term, 'ident) type_spec =
35 | Type of UriManager.uri * int
37 type ('term, 'ident) tactic =
38 | Absurd of loc * 'term
39 | Apply of loc * 'term
41 | Auto of loc * int option * int option (* depth, width *)
42 | Change of loc * ('term,'ident) pattern * 'term
43 | Clear of loc * 'ident
44 | ClearBody of loc * 'ident
45 | Compare of loc * 'term
46 | Constructor of loc * int
47 | Contradiction of loc
48 | Cut of loc * 'ident option * 'term
49 | DecideEquality of loc
50 | Decompose of loc * ('term, 'ident) type_spec list * 'ident * 'ident list
51 | Discriminate of loc * 'term
52 | Elim of loc * 'term * 'term option * int option * 'ident list
53 | ElimType of loc * 'term * 'term option * int option * 'ident list
54 | Exact of loc * 'term
57 | Fold of loc * reduction_kind * 'term * ('term, 'ident) pattern
59 | FwdSimpl of loc * string * 'ident list
60 | Generalize of loc * ('term, 'ident) pattern * 'ident option
61 | Goal of loc * int (* change current goal, argument is goal number 1-based *)
63 | Injection of loc * 'term
64 | Intros of loc * int option * 'ident list
65 | LApply of loc * int option * 'term list * 'term * 'ident option
67 | LetIn of loc * 'term * 'ident
68 | Reduce of loc * reduction_kind * ('term, 'ident) pattern
70 | Replace of loc * ('term, 'ident) pattern * 'term
71 | Rewrite of loc * direction * 'term * ('term, 'ident) pattern
76 | Transitivity of loc * 'term
78 type thm_flavour = Cic.object_flavour
80 (** <name, inductive/coinductive, type, constructor list>
81 * true means inductive, false coinductive *)
82 type 'term inductive_type = string * bool * 'term * (string * 'term) list
84 type search_kind = [ `Locate | `Hint | `Match | `Elim ]
86 type print_kind = [ `Env | `Coer ]
90 | WHint of loc * 'term
91 | WMatch of loc * 'term
92 | WInstance of loc * 'term
93 | WLocate of loc * string
94 | WElim of loc * 'term
97 | Print of loc * string
98 | Check of loc * 'term
101 (* | Redo of loc * int option
102 | Undo of loc * int option *)
103 (* | Print of loc * print_kind *)
104 | Search_pat of loc * search_kind * string (* searches with string pattern *)
105 | Search_term of loc * search_kind * 'term (* searches with term pattern *)
108 | Ident_alias of string * string (* identifier, uri *)
109 | Symbol_alias of string * int * string (* name, instance no, description *)
110 | Number_alias of int * string (* instance no, description *)
113 | Inductive of (string * CicNotationPt.term) list *
114 CicNotationPt.term inductive_type list
115 (** parameters, list of loc * mutual inductive types *)
116 | Theorem of thm_flavour * string * CicNotationPt.term *
117 CicNotationPt.term option
118 (** flavour, name, type, body
119 * - name is absent when an unnamed theorem is being proved, tipically in
121 * - body is present when its given along with the command, otherwise it
122 * will be given in proof editing mode using the tactical language
124 | Record of (string * CicNotationPt.term) list * string * CicNotationPt.term *
125 (string * CicNotationPt.term) list
127 type ('term,'obj) command =
128 | Default of loc * string * UriManager.uri list
129 | Include of loc * string
130 | Set of loc * string * string
134 * Name is needed when theorem was started without providing a name
136 | Coercion of loc * 'term
137 | Alias of loc * alias_spec
138 (** parameters, name, type, fields *)
140 | Notation of loc * CicNotationPt.term * Gramext.g_assoc * int *
142 (* level 1 pattern, associativity, precedence, level 2 pattern *)
143 | Interpretation of loc *
144 string * (string * CicNotationPt.argument_pattern list) *
145 CicNotationPt.cic_appl_pattern
146 (* description (i.e. id), symbol, arg pattern, appl pattern *)
149 | Dump of loc (* dump grammar on stdout *)
151 | Render of loc * UriManager.uri (* render library object *)
153 type ('term, 'ident) tactical =
154 | Tactic of loc * ('term, 'ident) tactic
155 | Do of loc * int * ('term, 'ident) tactical
156 | Repeat of loc * ('term, 'ident) tactical
157 | Seq of loc * ('term, 'ident) tactical list (* sequential composition *)
158 | Then of loc * ('term, 'ident) tactical * ('term, 'ident) tactical list
159 | First of loc * ('term, 'ident) tactical list
160 (* try a sequence of loc * tacticals until one succeeds, fail otherwise *)
161 | Try of loc * ('term, 'ident) tactical (* try a tactical and mask failures *)
162 | Solve of loc * ('term, 'ident) tactical list
165 type ('term, 'obj, 'ident) code =
166 | Command of loc * ('term,'obj) command
167 | Macro of loc * 'term macro
168 | Tactical of loc * ('term, 'ident) tactical
170 type ('term, 'obj, 'ident) comment =
171 | Note of loc * string
172 | Code of loc * ('term, 'obj, 'ident) code
174 type ('term, 'obj, 'ident) statement =
175 | Executable of loc * ('term, 'obj, 'ident) code
176 | Comment of loc * ('term, 'obj, 'ident) comment