]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_transformations/tacticAst.ml
833e1b1c4beed5c35bb7788e0520b6134d2a6715
[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 location = int * int
27
28 type direction = [ `Left | `Right ]
29 type reduction_kind = [ `Reduce | `Simpl | `Whd ]
30 type 'term pattern = Pattern of 'term
31
32   (* when an 'ident option is None, the default is to apply the tactic
33   to the current goal *)
34
35 type ('term, 'ident) tactic =
36   | LocatedTactic of location * ('term, 'ident) tactic
37
38   | Absurd
39   | Apply of 'term
40   | Assumption
41   | Change of 'term * 'term * 'ident option (* what, with what, where *)
42   | Change_pattern of 'term pattern * 'term * 'ident option
43       (* what, with what, where *)
44   | Contradiction
45   | Cut of 'term
46   | Decompose of 'ident * 'ident list (* where, which principles *)
47   | Discriminate of 'ident
48   | Elim of 'term * 'term option (* what to elim, which principle to use *)
49   | ElimType of 'term
50   | Exact of 'term
51   | Exists
52   | Fold of reduction_kind * 'term
53   | Fourier
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 'tactic tactical =
71   | LocatedTactical of location * 'tactic tactical
72
73   | Fail
74   | Do of int * 'tactic tactical
75   | IdTac
76   | Repeat of 'tactic tactical
77   | Seq of 'tactic tactical list (* sequential composition *)
78   | Tactic of 'tactic
79   | Then of 'tactic tactical * 'tactic tactical list
80   | Tries of 'tactic tactical list
81       (* try a sequence of tacticals until one succeeds, fail otherwise *)
82   | Try of 'tactic tactical (* try a tactical and mask failures *)
83