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 module Ast = CicNotationPt
28 type direction = [ `LeftToRight | `RightToLeft ]
29 type 'term reduction_kind =
30 [ `Normalize | `Reduce | `Simpl | `Unfold of 'term option | `Whd ]
32 type loc = Ast.location
34 type ('term, 'ident) pattern = 'term option * ('ident * 'term) list * 'term
36 type ('term, 'ident) type_spec =
38 | Type of UriManager.uri * int
40 type ('term, 'ident) tactic =
41 | Absurd of loc * 'term
42 | Apply of loc * 'term
44 | Auto of loc * int option * int option * string option (* depth, width, paramodulation ALB *)
45 | Change of loc * ('term,'ident) pattern * 'term
46 | Clear of loc * 'ident
47 | ClearBody of loc * 'ident
48 | Compare of loc * 'term
49 | Constructor of loc * int
50 | Contradiction of loc
51 | Cut of loc * 'ident option * 'term
52 | DecideEquality of loc
53 | Decompose of loc * ('term, 'ident) type_spec list * 'ident * 'ident list
54 | Discriminate of loc * 'term
55 | Elim of loc * 'term * 'term option * int option * 'ident list
56 | ElimType of loc * 'term * 'term option * int option * 'ident list
57 | Exact of loc * 'term
60 | Fold of loc * 'term reduction_kind * 'term * ('term, 'ident) pattern
62 | FwdSimpl of loc * string * 'ident list
63 | Generalize of loc * ('term, 'ident) pattern * 'ident option
64 | Goal of loc * int (* change current goal, argument is goal number 1-based *)
66 | Injection of loc * 'term
67 | Intros of loc * int option * 'ident list
68 | LApply of loc * int option * 'term list * 'term * 'ident option
70 | LetIn of loc * 'term * 'ident
71 | Reduce of loc * 'term reduction_kind * ('term, 'ident) pattern
73 | Replace of loc * ('term, 'ident) pattern * 'term
74 | Rewrite of loc * direction * 'term * ('term, 'ident) pattern
79 | Transitivity of loc * 'term
81 type thm_flavour = Cic.object_flavour
83 (** <name, inductive/coinductive, type, constructor list>
84 * true means inductive, false coinductive *)
85 type 'term inductive_type = string * bool * 'term * (string * 'term) list
87 type search_kind = [ `Locate | `Hint | `Match | `Elim ]
89 type print_kind = [ `Env | `Coer ]
93 | WHint of loc * 'term
94 | WMatch of loc * 'term
95 | WInstance of loc * 'term
96 | WLocate of loc * string
97 | WElim of loc * 'term
100 | Print of loc * string
101 | Check of loc * 'term
104 (* | Redo of loc * int option
105 | Undo of loc * int option *)
106 (* | Print of loc * print_kind *)
107 | Search_pat of loc * search_kind * string (* searches with string pattern *)
108 | Search_term of loc * search_kind * 'term (* searches with term pattern *)
111 | Ident_alias of string * string (* identifier, uri *)
112 | Symbol_alias of string * int * string (* name, instance no, description *)
113 | Number_alias of int * string (* instance no, description *)
116 | Inductive of (string * Ast.term) list *
117 Ast.term inductive_type list
118 (** parameters, list of loc * mutual inductive types *)
119 | Theorem of thm_flavour * string * Ast.term *
121 (** flavour, name, type, body
122 * - name is absent when an unnamed theorem is being proved, tipically in
124 * - body is present when its given along with the command, otherwise it
125 * will be given in proof editing mode using the tactical language
127 | Record of (string * Ast.term) list * string * Ast.term *
128 (string * Ast.term) list
130 type ('term,'obj) command =
131 | Default of loc * string * UriManager.uri list
132 | Include of loc * string
133 | Set of loc * string * string
137 * Name is needed when theorem was started without providing a name
139 | Coercion of loc * 'term
140 | Alias of loc * alias_spec
141 (** parameters, name, type, fields *)
143 | Notation of loc * direction option * Ast.term * Gramext.g_assoc *
145 (* direction, l1 pattern, associativity, precedence, l2 pattern *)
146 | Interpretation of loc *
147 string * (string * Ast.argument_pattern list) *
149 (* description (i.e. id), symbol, arg pattern, appl pattern *)
152 | Dump of loc (* dump grammar on stdout *)
154 | Render of loc * UriManager.uri (* render library object *)
156 type ('term, 'ident) tactical =
157 | Tactic of loc * ('term, 'ident) tactic
158 | Do of loc * int * ('term, 'ident) tactical
159 | Repeat of loc * ('term, 'ident) tactical
160 | Seq of loc * ('term, 'ident) tactical list (* sequential composition *)
161 | Then of loc * ('term, 'ident) tactical * ('term, 'ident) tactical list
162 | First of loc * ('term, 'ident) tactical list
163 (* try a sequence of loc * tacticals until one succeeds, fail otherwise *)
164 | Try of loc * ('term, 'ident) tactical (* try a tactical and mask failures *)
165 | Solve of loc * ('term, 'ident) tactical list
168 type ('term, 'obj, 'ident) code =
169 | Command of loc * ('term,'obj) command
170 | Macro of loc * 'term macro
171 | Tactical of loc * ('term, 'ident) tactical
173 type ('term, 'obj, 'ident) comment =
174 | Note of loc * string
175 | Code of loc * ('term, 'obj, 'ident) code
177 type ('term, 'obj, 'ident) statement =
178 | Executable of loc * ('term, 'obj, 'ident) code
179 | Comment of loc * ('term, 'obj, 'ident) comment