]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_transformations/cicAst.ml
first moogle template checkin
[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 type location = int * int
27
28 type binder_kind = [ `Lambda | `Pi | `Exists | `Forall ]
29 type induction_kind = [ `Inductive | `CoInductive ]
30 type sort_kind = [ `Prop | `Set | `Type | `CProp ]
31
32 type term_attribute =
33   [ `Loc of location  (* source file location *)
34   | `IdRef of string  (* ACic pointer *)
35   ]
36
37 type term =
38   | AttributedTerm of term_attribute * term
39
40   | Appl of term list
41   | Binder of binder_kind * capture_variable * term (* kind, name, body *)
42   | Case of term * string option * term option * (case_pattern * term) list
43       (* what to match, inductive type, out type, <pattern,action> list *)
44   | LetIn of capture_variable * term * term  (* name, body, where *)
45   | LetRec of induction_kind * (capture_variable * term * int) list * term
46       (* (name, body, decreasing argument) list, where *)
47   | Ident of string * subst list option
48       (* literal, substitutions.
49       * Some [] -> user has given an empty explicit substitution list 
50       * None -> user has given no explicit substitution list *)
51   | Implicit
52   | Meta of int * meta_subst list
53   | Num of string * int (* literal, instance *)
54   | Sort of sort_kind
55   | Symbol of string * int  (* canonical name, instance *)
56
57 and capture_variable = Cic.name * term option (* name, type *)
58 and meta_subst = term option
59 and subst = string * term
60 and case_pattern = string * capture_variable list
61