]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_transformations/tacticAst.ml
rebuilt against ocaml 3.08.3
[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   (* everywhere includes goal and hypotheses *)
31 type 'term pattern = [ `Goal | `Everywhere ]
32
33   (* when an 'ident option is None, the default is to apply the tactic
34   to the current goal *)
35
36 type ('term, 'ident) tactic =
37   | LocatedTactic of CicAst.location * ('term, 'ident) tactic
38
39   | Absurd of 'term
40   | Apply of 'term
41   | Auto
42   | Assumption
43   | Change of 'term * 'term * 'ident option (* what, with what, where *)
44   | Change_pattern of 'term pattern * 'term * 'ident option
45       (* what, with what, where *)
46   | Contradiction
47   | Cut of 'term
48   | Decompose of 'ident * 'ident list (* where, which principles *)
49   | Discriminate of 'ident
50   | Elim of 'term * 'term option (* what to elim, which principle to use *)
51   | ElimType of 'term
52   | Exact of 'term
53   | Exists
54   | Fold of reduction_kind * 'term
55   | Fourier
56   | Hint
57   | Injection of 'ident
58   | Intros of int option * 'ident list
59   | Left
60   | LetIn of 'term * 'ident
61 (*   | Named_intros of 'ident list (* joined with Intros above *) *)
62 (*   | Reduce of reduction_kind * 'term pattern * 'ident option (* what, where *) *)
63   | Reduce of reduction_kind * ('term list * 'term pattern) option
64       (* kind, (what, where)
65       * if second argument is None, reduction is applied to the current goal,
66       * otherwise to each occurrence of terms given in list occuring in term
67       * pattern *)
68   | Reflexivity
69   | Replace of 'term * 'term (* what, with what *)
70   | Replace_pattern of 'term pattern * 'term
71   | Rewrite of direction * 'term * 'ident option
72   | Right
73   | Ring
74   | Split
75   | Symmetry
76   | Transitivity of 'term
77
78 type thm_flavour =
79   [ `Definition
80   | `Fact
81   | `Goal
82   | `Lemma
83   | `Remark
84   | `Theorem
85   ]
86
87   (** <name, inductive/coinductive, type, constructor list>
88   * true means inductive, false coinductive *)
89 type 'term inductive_type = string * bool * 'term * (string * 'term) list
90
91 type search_kind = [ `Locate | `Hint | `Match | `Elim ]
92
93 type print_kind = [ `Env | `Coer ]
94
95 type 'term command =
96   | Abort
97   | Baseuri of string option (** get/set base uri *)
98   | Basedir of string option (** get/set base dir *)
99   | Check of 'term 
100   | Search_pat of search_kind * string  (* searches with string pattern *)
101   | Search_term of search_kind * 'term  (* searches with term pattern *)
102   | Proof
103   | Qed of string option
104       (** name.
105        * Name is needed when theorem was started without providing a name
106        *)
107   | Quit
108   | Inductive of (string * 'term) list * 'term inductive_type list
109       (** parameters, list of mutual inductive types *)
110   | Theorem of thm_flavour * string option * 'term * 'term option
111       (** flavour, name, type, body
112        * - name is absent when an unnamed theorem is being proved, tipically in
113        *   interactive usage
114        * - body is present when its given along with the command, otherwise it
115        *   will be given in proof editing mode using the tactical language
116        *)
117   | Coercion of 'term
118   | Redo of int option
119   | Undo of int option
120   | Print of print_kind
121
122 type ('term, 'ident) tactical =
123   | LocatedTactical of CicAst.location * ('term, 'ident) tactical
124
125   | Tactic of ('term, 'ident) tactic
126   | Command of 'term command
127
128   | Fail
129   | Do of int * ('term, 'ident) tactical
130   | IdTac
131   | Repeat of ('term, 'ident) tactical
132   | Seq of ('term, 'ident) tactical list (* sequential composition *)
133   | Then of ('term, 'ident) tactical * ('term, 'ident) tactical list
134   | Tries of ('term, 'ident) tactical list
135       (* try a sequence of tacticals until one succeeds, fail otherwise *)
136   | Try of ('term, 'ident) tactical (* try a tactical and mask failures *)
137