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) tactic =
34 | Absurd of loc * 'term
35 | Apply of loc * 'term
37 | Auto of loc * int option * int option (* depth, width *)
38 | Change of loc * ('term,'ident) pattern * 'term
39 | Clear of loc * 'ident
40 | ClearBody of loc * 'ident
41 | Compare of loc * 'term
42 | Constructor of loc * int
43 | Contradiction of loc
44 | Cut of loc * 'ident option * 'term
45 | DecideEquality of loc
46 | Decompose of loc * 'term
47 | Discriminate of loc * 'term
48 | Elim of loc * 'term * 'term option * int option * 'ident list
49 | ElimType of loc * 'term * 'term option * int option * 'ident list
50 | Exact of loc * 'term
53 | Fold of loc * reduction_kind * 'term * ('term, 'ident) pattern
55 | FwdSimpl of loc * string * 'ident list
56 | Generalize of loc * ('term, 'ident) pattern * 'ident option
57 | Goal of loc * int (* change current goal, argument is goal number 1-based *)
59 | Injection of loc * 'term
60 | Intros of loc * int option * 'ident list
61 | LApply of loc * int option * 'term list * 'term * 'ident option
63 | LetIn of loc * 'term * 'ident
64 | Reduce of loc * reduction_kind * ('term, 'ident) pattern
66 | Replace of loc * ('term, 'ident) pattern * 'term
67 | Rewrite of loc * direction * 'term * ('term, 'ident) pattern
72 | Transitivity of loc * 'term
74 type thm_flavour = Cic.object_flavour
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 * CicNotationPt.term) list *
110 CicNotationPt.term inductive_type list
111 (** parameters, list of loc * mutual inductive types *)
112 | Theorem of thm_flavour * string * CicNotationPt.term * CicNotationPt.term option
113 (** flavour, name, type, body
114 * - name is absent when an unnamed theorem is being proved, tipically in
116 * - body is present when its given along with the command, otherwise it
117 * will be given in proof editing mode using the tactical language
120 (string * CicNotationPt.term) list * string * CicNotationPt.term *
121 (string * CicNotationPt.term) list
123 type ('term,'obj) command =
124 | Default of loc * string * UriManager.uri list
125 | Include of loc * string
126 | Set of loc * string * string
130 * Name is needed when theorem was started without providing a name
132 | Coercion of loc * 'term
133 | Alias of loc * alias_spec
134 (** parameters, name, type, fields *)
136 | Notation of loc * CicNotationPt.term * Gramext.g_assoc option * int option *
138 (* level 1 pattern, associativity, precedence, level 2 pattern *)
139 | Interpretation of loc *
140 string * (string * CicNotationPt.argument_pattern list) *
141 CicNotationPt.cic_appl_pattern
142 (* description (i.e. id), symbol, arg pattern, appl pattern *)
145 | Dump of loc (* dump grammar on stdout *)
147 | Render of loc * UriManager.uri (* render library object *)
149 type ('term, 'ident) tactical =
150 | Tactic of loc * ('term, 'ident) tactic
151 | Do of loc * int * ('term, 'ident) tactical
152 | Repeat of loc * ('term, 'ident) tactical
153 | Seq of loc * ('term, 'ident) tactical list (* sequential composition *)
154 | Then of loc * ('term, 'ident) tactical * ('term, 'ident) tactical list
155 | First of loc * ('term, 'ident) tactical list
156 (* try a sequence of loc * tacticals until one succeeds, fail otherwise *)
157 | Try of loc * ('term, 'ident) tactical (* try a tactical and mask failures *)
158 | Solve of loc * ('term, 'ident) tactical list
161 type ('term, 'obj, 'ident) code =
162 | Command of loc * ('term,'obj) command
163 | Macro of loc * 'term macro
164 | Tactical of loc * ('term, 'ident) tactical
166 type ('term, 'obj, 'ident) comment =
167 | Note of loc * string
168 | Code of loc * ('term, 'obj, 'ident) code
170 type ('term, 'obj, 'ident) statement =
171 | Executable of loc * ('term, 'obj, 'ident) code
172 | Comment of loc * ('term, 'obj, 'ident) comment