type anntarget =
Object of annobj
| Term of annterm
+ | Conjecture of annconjecture
+ | Hypothesis of annhypothesis
(* INTERNAL REPRESENTATION OF CIC OBJECTS AND TERMS *)
and sort =
and term =
Rel of int (* DeBrujin index *)
| Var of UriManager.uri (* uri *)
- | Meta of int (* numeric id *)
+ | Meta of int * (term option) list (* numeric id, *)
+ (* local context *)
| Sort of sort (* sort *)
| Implicit (* *)
| Cast of term * term (* value, type *)
| LetIn of name * term * term (* binder, term, target *)
| Appl of term list (* arguments *)
| Const of UriManager.uri * int (* uri, number of cookings*)
- | Abst of UriManager.uri (* uri *)
| MutInd of UriManager.uri * int * int (* uri, cookingsno, typeno*)
+ (* typeno is 0 based *)
| MutConstruct of UriManager.uri * int * (* uri, cookingsno, *)
int * int (* typeno, consno *)
+ (* consno is 1 based *)
(*CSC: serve cookingsno?*)
| MutCase of UriManager.uri * int * (* ind. uri, cookingsno, *)
int * (* ind. typeno, *)
| Axiom of string * term *
(int * UriManager.uri list) list (* id, type, parameters *)
| Variable of string * term option * term (* name, body, type *)
- | CurrentProof of string * (int * term) list * (* name, conjectures, *)
+ | CurrentProof of string * metasenv * (* name, conjectures, *)
term * term (* value, type *)
| InductiveDefinition of inductiveType list * (* inductive types, *)
(int * UriManager.uri list) list * int (* parameters, n ind. pars *)
and coInductiveFun =
string * term * term (* name, type, body *)
+(* a metasenv is a list of declarations of metas *)
+and conjecture = int * context * term
+and metasenv = conjecture list
+
+(* a metasenv is a list of declarations of metas *)
+and annconjecture = id * int * anncontext * annterm
+and annmetasenv = annconjecture list
+
and annterm =
ARel of id * int * string (* DeBrujin index, binder *)
| AVar of id * UriManager.uri (* uri *)
- | AMeta of id * int (* numeric id *)
+ | AMeta of id * int * (annterm option) list (* numeric id, *)
+ (* local context *)
| ASort of id * sort (* sort *)
| AImplicit of id (* *)
| ACast of id * annterm * annterm (* value, type *)
| ALetIn of id * name * annterm * annterm (* binder, term, target *)
| AAppl of id * annterm list (* arguments *)
| AConst of id * UriManager.uri * int (* uri, number of cookings*)
- | AAbst of id * UriManager.uri (* uri *)
| AMutInd of id * UriManager.uri * int * int (* uri, cookingsno, typeno*)
+ (* typeno is 0 based *)
| AMutConstruct of id * UriManager.uri * int * (* uri, cookingsno, *)
int * int (* typeno, consno *)
+ (* consno is 1 based *)
(*CSC: serve cookingsno?*)
| AMutCase of id * UriManager.uri * int * (* ind. uri, cookingsno *)
int * (* ind. typeno, *)
| AVariable of id *
string * annterm option * annterm (* name, body, type *)
| ACurrentProof of id *
- string * (int * annterm) list * (* name, conjectures, *)
+ string * annmetasenv * (* name, conjectures, *)
annterm * annterm (* value, type *)
| AInductiveDefinition of id *
anninductiveType list * (* inductive types , *)
and 'a exactness =
Possible of 'a (* an approximation to something *)
| Actual of 'a (* something *)
-;;
+
+and context_entry = (* A declaration or definition *)
+ Decl of term
+ | Def of term
+
+and hypothesis =
+ (name * context_entry) option (* None means no more accessible *)
+
+and context = hypothesis list
+
+and anncontext_entry = (* A declaration or definition *)
+ ADecl of annterm
+ | ADef of annterm
+
+and annhypothesis =
+ id * (name * anncontext_entry) option (* None means no more accessible *)
+
+and anncontext = annhypothesis list;;