]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic/cic.ml
Conjectures and Hypotheses inside every conjecture and in the sequents now
[helm.git] / helm / ocaml / cic / cic.ml
index 64b7f857cce087cc7f5925654939c2a613768434..a556aadca6b184b213d0f2915bd2143964a10080 100644 (file)
@@ -40,6 +40,8 @@ type id = string  (* the abstract type of the (annotated) node identifiers *)
 type anntarget =
    Object of annobj
  | Term of annterm
+ | Conjecture of annconjecture
+ | Hypothesis of annhypothesis
 
 (* INTERNAL REPRESENTATION OF CIC OBJECTS AND TERMS *)
 and sort =
@@ -52,7 +54,8 @@ and name =
 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 *)
@@ -78,7 +81,7 @@ and obj =
  | 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 *)
@@ -92,10 +95,19 @@ and inductiveFun =
 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 *)
@@ -124,7 +136,7 @@ and annobj =
  | 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 ,      *)
@@ -143,4 +155,21 @@ and annotation =
 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;;