]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_transformations/cicAst.ml
added sample configuration file
[helm.git] / helm / ocaml / cic_transformations / cicAst.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   (* when an 'ident option is None, the default is to apply the tactic
27   to the current goal *)
28
29 type reduction_kind = [ `Reduce | `Simpl | `Whd ]
30
31 type 'term pattern =
32   | Pattern of 'term
33
34 type location = int * int
35
36 type ('term, 'ident) tactic =
37   | LocatedTactic of location * ('term, 'ident) tactic
38
39   | Absurd
40   | Apply of 'term
41   | Assumption
42   | Change of 'term * 'term * 'ident option (* what, with what, where *)
43   | Change_pattern of 'term pattern * 'term * 'ident option
44       (* what, with what, where *)
45   | Contradiction
46   | Cut of 'term
47   | Decompose of 'ident * 'ident list (* which hypothesis, which principles *)
48   | Discriminate of 'ident
49   | Elim of 'term * 'term option (* what to elim, which principle to use *)
50   | ElimType of 'term
51   | Exact of 'term
52   | Exists
53   | Fold of reduction_kind * 'term
54   | Fourier
55   | Injection of 'ident
56   | Intros of int option
57   | Left
58   | LetIn of 'term * 'ident (* TODO clashes with term below *)
59   | Named_intros of 'ident list
60   | Reduce of reduction_kind * 'term pattern * 'ident option (* what, where *)
61   | Reflexivity
62   | Replace of 'term * 'term (* what, with what *)
63   | Replace_pattern of 'term pattern * 'term
64   | RewriteLeft of 'term * 'ident option
65   | RewriteRight of 'term * 'ident option
66   | Right
67   | Ring
68   | Split
69   | Symmetry
70   | Transitivity of 'term
71
72 type 'tactic tactical =
73   | LocatedTactical of location * 'tactic tactical
74
75   | Fail
76   | For of int * 'tactic tactical
77   | IdTac
78   | Repeat of 'tactic tactical
79   | Seq of 'tactic tactical list (* sequential composition *)
80   | Tactic of 'tactic
81   | Then of 'tactic tactical * 'tactic tactical list
82   | Tries of 'tactic tactical list
83       (* try a sequence of tacticals until one succeeds, fail otherwise *)
84   | Try of 'tactic tactical (* try a tactical and mask failures *)
85
86 type binder_kind = [ `Lambda | `Pi | `Exists | `Forall ]
87 type induction_kind = [ `Inductive | `CoInductive ]
88 type sort_kind = [ `Prop | `Set | `Type | `CProp ]
89
90 type term_attribute =
91   [ `Loc of location  (* source file location *)
92   | `IdRef of string  (* ACic pointer *)
93   ]
94
95 type term =
96   | AttributedTerm of term_attribute * term
97
98   | Appl of term list
99   | Binder of binder_kind * capture_variable * term (* kind, name, body *)
100   | Case of term * string * term option * (case_pattern * term) list
101       (* what to match, inductive type, out type, <pattern,action> list *)
102   | LetIn of capture_variable * term * term  (* name, body, where *)
103   | LetRec of induction_kind * (capture_variable * term * int) list * term
104       (* (name, body, decreasing argument) list, where *)
105   | Ident of string * subst list  (* literal, substitutions *)
106   | Implicit
107   | Meta of int * meta_subst list
108   | Num of string * int (* literal, instance *)
109   | Sort of sort_kind
110   | Symbol of string * int  (* canonical name, instance *)
111
112 and capture_variable = Cic.name * term option (* name, type *)
113 and meta_subst = term option
114 and subst = string * term
115 and case_pattern = string * capture_variable list
116