]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_kernel/nCic.ml
factorized common components of objects
[helm.git] / helm / software / components / ng_kernel / nCic.ml
index 6691acd479c5e8c36f92d447cb3812546e72d51e..19a8a227b9cf8dfe49af5a3b41431d4f4c1c2d9a 100644 (file)
@@ -66,24 +66,27 @@ type substitution = (int * (string option * context * term * term)) list
 
 (******************************** OBJECTS **********************************)
 
-type inductiveFun = string * int * term * term 
+type relevance = bool list (* relevance of arguments for conversion *)
+
+type inductiveFun = relevance * string * int * term * term 
   (* if coinductive, the int has no meaning and must be set to -1 *)
 
-type constructor = string * term  (* id, type *)
+type constructor = relevance * string * term  (* id, type *)
 
 type inductiveType = 
- string * bool * term * int * (* typename, inductive, arity, leftno *)
constructor list             (* constructors                       *)
+ relevance * string * term * constructor list    
(* relevance, typename, arity, constructors *)
 
 type def_flavour = (* presentational *)
-  [ `Definition | `Fact | `Lemma | `Remark | `Theorem | `Corollary ]
+  [ `Definition | `Fact | `Lemma | `Theorem | `Corollary | `Example ]
 
 type def_pragma = (* pragmatic of the object *)
   [ `Coercion of int
   | `Elim of sort       (* elimination principle; universe is not relevant *)
   | `Projection         (* record projection *)
   | `InversionPrinciple (* inversion principle *)
-  | `Variant ]
+  | `Variant 
+  | `Local ]            (* Local = hidden technicality *)
  
 type ind_pragma = (* pragmatic of the object *)
   [ `Record of (string * bool * int) list ]
@@ -97,8 +100,10 @@ type f_attr = generated * def_flavour
 type i_attr = generated * ind_pragma
 
  (* invariant: metasenv and substitution have disjoint domains *)
-type obj =
- | Constant  of NUri.uri * metasenv * substitution * string * term option * term * c_attr
- | Fixpoint  of NUri.uri * metasenv * substitution * bool * inductiveFun list * f_attr
- | Inductive of NUri.uri * metasenv * substitution * inductiveType list * i_attr
+type obj_kind =
+ | Constant  of relevance * string * term option * term * c_attr
+ | Fixpoint  of bool * inductiveFun list * f_attr
+ | Inductive of bool * int * inductiveType list * i_attr
+                (* (co)inductive, leftno, types *)
 
+type obj = NUri.uri * int * metasenv * substitution * obj_kind