1 (* Copyright (C) 2000, HELM Team.
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.
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.
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.
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,
22 * For details, see the HELM World-Wide-Web page,
23 * http://cs.unibo.it/helm/.
32 type implicit_annotation = [ `Closed | `Type | `Hole | `Term ]
34 type local_context = int * (term list) option (* shift (0 -> no shift),
35 subst (None means id) *)
37 | Rel of int (* DeBruijn index, 1 based *)
38 | Meta of int * local_context
39 | Appl of term list (* arguments *)
40 | Prod of string * term * term (* binder, source, target *)
41 | Lambda of string * term * term (* binder, source, target *)
42 | LetIn of string * term * term * term (* binder, type, term, body *)
43 (* Cast \def degenerate LetIn *)
44 | Const of NReference.reference (* reference contains indtypeno/constrno *)
45 | Sort of sort (* sort *)
46 | Implicit of implicit_annotation (* ... *)
47 | Match of NReference.reference * (* ind. reference, *)
48 term * term * (* outtype, ind. term *)
49 term list (* patterns *)
53 type context_entry = (* A declaration or definition *)
55 | Def of term * term option (* body, type (if known) *)
57 type hypothesis = string * context_entry (* None means no more accessible *)
59 type context = hypothesis list
61 type conjecture = int * string option * context * term
63 type metasenv = conjecture list
65 type substitution = (int * (string option * context * term * term)) list
71 string * int * term * term (* if coinductive, the int has no meaning and must be set to -1 *)
73 type constructor = string * term (* id, type *)
76 string * bool * term * (* typename, inductive, arity *)
77 constructor list (* constructors *)
79 type def_flavour = (* presentational *)
87 type def_pragma = (* pragmatic of the object *)
89 | `Elim of sort (** elimination principle; if sort is Type, the universe is not relevant *)
90 | `Projection (** record projection *)
91 | `InversionPrinciple (** inversion principle *)
95 type ind_pragma = (* pragmatic of the object *)
96 [ `Record of (string * bool * int) list (**
97 inductive type that encodes a record; the arguments are
98 the record fields names and if they are coercions and
99 then the coercion arity *)
102 type generated = [ `Generated | `Provided ]
104 type c_attr = generated * def_flavour * def_pragma
105 type f_attr = generated * def_flavour
106 type i_attr = generated * ind_pragma
109 | Constant of NUri.uri * metasenv * substitution * string * term option * term * c_attr
110 | Fixpoint of NUri.uri * metasenv * substitution * bool * inductiveFun list * f_attr
111 | Inductive of NUri.uri * metasenv * substitution * inductiveType list * i_attr