]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_transformations/tacticAst.ml
bumped changelog line to match upload date
[helm.git] / helm / ocaml / cic_transformations / tacticAst.ml
1 (* Copyright (C) 2004, HELM Team.
2  * 
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.
6  * 
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.
11  * 
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.
16  *
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,
20  * MA  02111-1307, USA.
21  * 
22  * For details, see the HELM World-Wide-Web page,
23  * http://helm.cs.unibo.it/
24  *)
25
26 type direction = [ `Left | `Right ]
27 type reduction_kind = [ `Reduce | `Simpl | `Whd ]
28 type 'term pattern = Pattern of 'term
29
30   (* when an 'ident option is None, the default is to apply the tactic
31   to the current goal *)
32
33 type ('term, 'ident) tactic =
34   | LocatedTactic of CicAst.location * ('term, 'ident) tactic
35
36   | Absurd of 'term
37   | Apply of 'term
38   | Auto
39   | Assumption
40   | Change of 'term * 'term * 'ident option (* what, with what, where *)
41   | Change_pattern of 'term pattern * 'term * 'ident option
42       (* what, with what, where *)
43   | Contradiction
44   | Cut of 'term
45   | Decompose of 'ident * 'ident list (* where, which principles *)
46   | Discriminate of 'ident
47   | Elim of 'term * 'term option (* what to elim, which principle to use *)
48   | ElimType of 'term
49   | Exact of 'term
50   | Exists
51   | Fold of reduction_kind * 'term
52   | Fourier
53   | Hint
54   | Injection of 'ident
55   | Intros of int option * 'ident list
56   | Left
57   | LetIn of 'term * 'ident
58 (*   | Named_intros of 'ident list (* joined with Intros above *) *)
59   | Reduce of reduction_kind * 'term pattern * 'ident option (* what, where *)
60   | Reflexivity
61   | Replace of 'term * 'term (* what, with what *)
62   | Replace_pattern of 'term pattern * 'term
63   | Rewrite of direction * 'term * 'ident option
64   | Right
65   | Ring
66   | Split
67   | Symmetry
68   | Transitivity of 'term
69
70 type thm_flavour =
71   [ `Definition
72   | `Fact
73   | `Goal
74   | `Lemma
75   | `Remark
76   | `Theorem
77   ]
78
79 type 'term command =
80   | Abort
81   | Baseuri of string option (** get/set base uri *)
82   | Check of 'term
83   | Proof
84   | Qed of string option
85       (** name.
86        * Name is needed when theorem was started without providing a name
87        *)
88   | Quit
89   | Theorem of thm_flavour * string option * 'term * 'term option
90       (** flavour, name, type, body
91        * - name is absent when an unnamed theorem is being proved, tipically in
92        *   interactive usage
93        * - body is present when its given along with the command, otherwise it
94        *   will be given in proof editing mode using the tactical language
95        *)
96   | Redo of int option
97   | Undo of int option
98
99 type ('term, 'ident) tactical =
100   | LocatedTactical of CicAst.location * ('term, 'ident) tactical
101
102   | Tactic of ('term, 'ident) tactic
103   | Command of 'term command
104
105   | Fail
106   | Do of int * ('term, 'ident) tactical
107   | IdTac
108   | Repeat of ('term, 'ident) tactical
109   | Seq of ('term, 'ident) tactical list (* sequential composition *)
110   | Then of ('term, 'ident) tactical * ('term, 'ident) tactical list
111   | Tries of ('term, 'ident) tactical list
112       (* try a sequence of tacticals until one succeeds, fail otherwise *)
113   | Try of ('term, 'ident) tactical (* try a tactical and mask failures *)
114