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/.
26 (******************************************************************************)
30 (* Claudio Sacerdoti Coen <sacerdot@cs.unibo.it> *)
33 (* This module defines the internal representation of the objects (variables, *)
34 (* blocks of (co)inductive definitions and constants) and the terms of cic *)
36 (******************************************************************************)
38 (* STUFF TO MANAGE IDENTIFIERS *)
39 type id = string (* the abstract type of the (annotated) node identifiers *)
44 (* INTERNAL REPRESENTATION OF CIC OBJECTS AND TERMS *)
53 Rel of int (* DeBrujin index *)
54 | Var of UriManager.uri (* uri *)
55 | Meta of int (* numeric id *)
56 | Sort of sort (* sort *)
58 | Cast of term * term (* value, type *)
59 | Prod of name * term * term (* binder, source, target *)
60 | Lambda of name * term * term (* binder, source, target *)
61 | LetIn of name * term * term (* binder, term, target *)
62 | Appl of term list (* arguments *)
63 | Const of UriManager.uri * int (* uri, number of cookings*)
64 | Abst of UriManager.uri (* uri *)
65 | MutInd of UriManager.uri * int * int (* uri, cookingsno, typeno*)
66 | MutConstruct of UriManager.uri * int * (* uri, cookingsno, *)
67 int * int (* typeno, consno *)
68 (*CSC: serve cookingsno?*)
69 | MutCase of UriManager.uri * int * (* ind. uri, cookingsno, *)
70 int * (* ind. typeno, *)
71 term * term * (* outtype, ind. term *)
72 term list (* patterns *)
73 | Fix of int * inductiveFun list (* funno, functions *)
74 | CoFix of int * coInductiveFun list (* funno, functions *)
76 Definition of string * term * term * (* id, value, type, *)
77 (int * UriManager.uri list) list (* parameters *)
78 | Axiom of string * term *
79 (int * UriManager.uri list) list (* id, type, parameters *)
80 | Variable of string * term option * term (* name, body, type *)
81 | CurrentProof of string * (int * term) list * (* name, conjectures, *)
82 term * term (* value, type *)
83 | InductiveDefinition of inductiveType list * (* inductive types, *)
84 (int * UriManager.uri list) list * int (* parameters, n ind. pars *)
86 string * bool * term * (* typename, inductive, arity *)
87 constructor list (* constructors *)
89 string * term * bool list option ref (* id, type, really recursive *)
91 string * int * term * term (* name, ind. index, type, body *)
93 string * term * term (* name, type, body *)
96 ARel of id * int * string (* DeBrujin index, binder *)
97 | AVar of id * UriManager.uri (* uri *)
98 | AMeta of id * int (* numeric id *)
99 | ASort of id * sort (* sort *)
100 | AImplicit of id (* *)
101 | ACast of id * annterm * annterm (* value, type *)
102 | AProd of id * name * annterm * annterm (* binder, source, target *)
103 | ALambda of id * name * annterm * annterm (* binder, source, target *)
104 | ALetIn of id * name * annterm * annterm (* binder, term, target *)
105 | AAppl of id * annterm list (* arguments *)
106 | AConst of id * UriManager.uri * int (* uri, number of cookings*)
107 | AAbst of id * UriManager.uri (* uri *)
108 | AMutInd of id * UriManager.uri * int * int (* uri, cookingsno, typeno*)
109 | AMutConstruct of id * UriManager.uri * int * (* uri, cookingsno, *)
110 int * int (* typeno, consno *)
111 (*CSC: serve cookingsno?*)
112 | AMutCase of id * UriManager.uri * int * (* ind. uri, cookingsno *)
113 int * (* ind. typeno, *)
114 annterm * annterm * (* outtype, ind. term *)
115 annterm list (* patterns *)
116 | AFix of id * int * anninductiveFun list (* funno, functions *)
117 | ACoFix of id * int * anncoInductiveFun list (* funno, functions *)
119 ADefinition of id * string * (* id, *)
120 annterm * annterm * (* value, type, *)
121 (int * UriManager.uri list) list exactness (* parameters *)
122 | AAxiom of id * string * annterm * (* id, type *)
123 (int * UriManager.uri list) list (* parameters *)
125 string * annterm option * annterm (* name, body, type *)
126 | ACurrentProof of id *
127 string * (int * annterm) list * (* name, conjectures, *)
128 annterm * annterm (* value, type *)
129 | AInductiveDefinition of id *
130 anninductiveType list * (* inductive types , *)
131 (int * UriManager.uri list) list * int (* parameters,n ind. pars*)
132 and anninductiveType =
133 string * bool * annterm * (* typename, inductive, arity *)
134 annconstructor list (* constructors *)
136 string * annterm * bool list option ref (* id, type, really recursive *)
137 and anninductiveFun =
138 string * int * annterm * annterm (* name, ind. index, type, body *)
139 and anncoInductiveFun =
140 string * annterm * annterm (* name, type, body *)
144 Possible of 'a (* an approximation to something *)
145 | Actual of 'a (* something *)