]> matita.cs.unibo.it Git - helm.git/blob - helm/ocaml/cic_transformations/cicAst.mli
fix
[helm.git] / helm / ocaml / cic_transformations / cicAst.mli
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 (** {2 Parsing related types} *)
27
28 type location = Lexing.position * Lexing.position
29 val pp_location: location -> string
30
31   (** maps old style (i.e. <= 3.07) lexer location to new style location,
32   * padding with dummy values where needed *)
33 val floc_of_loc: int * int -> location
34
35   (* the other way round *)
36 val loc_of_floc: location -> int * int
37
38   (* dummy location *)
39 val dummy_floc: location
40
41 (** {2 Cic Ast} *)
42
43 type binder_kind = [ `Lambda | `Pi | `Exists | `Forall ]
44 type induction_kind = [ `Inductive | `CoInductive ]
45 type sort_kind = [ `Prop | `Set | `Type | `CProp ]
46
47 type term_attribute =
48   [ `Loc of location  (* source file location *)
49   | `IdRef of string  (* ACic pointer *)
50   ]
51
52 type term =
53   | AttributedTerm of term_attribute * term
54   | Appl of term list
55   | Binder of binder_kind * capture_variable * term (* kind, name, body *)
56   | Case of term * string option * term option * (case_pattern * term) list
57       (* what to match, inductive type, out type, <pattern,action> list *)
58   | LetIn of capture_variable * term * term  (* name, body, where *)
59   | LetRec of induction_kind * (capture_variable * term * int) list * term
60       (* (name, body, decreasing argument) list, where *)
61   | Ident of string * subst list option
62       (* literal, substitutions.
63       * Some [] -> user has given an empty explicit substitution list 
64       * None -> user has given no explicit substitution list *)
65   | Implicit
66   | Meta of int * meta_subst list
67   | Num of string * int (* literal, instance *)
68   | Sort of sort_kind
69   | Symbol of string * int  (* canonical name, instance *)
70
71   | UserInput (* place holder for user input, used by MatitaConsole, not to be
72               used elsewhere *)
73   | Uri of string * subst list option (* as Ident, for long names *)
74
75 and capture_variable = Cic.name * term option (* name, type *)
76 and meta_subst = term option
77 and subst = string * term
78 and case_pattern = string * capture_variable list
79
80 val pack: term list -> term
81 val unpack: term -> term list
82