X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic%2Fcic.ml;h=6e200cc310e1559db1e3b1875f6d44a7332294c6;hb=1a40d93d10be4ee71ae9474384af931d70918690;hp=4f705168860d66e4df77fc2c2d23eb18d7d58915;hpb=b24d13c4dcc96a204951857ddfa18c5ded4cecd0;p=helm.git diff --git a/helm/ocaml/cic/cic.ml b/helm/ocaml/cic/cic.ml index 4f7051688..6e200cc31 100644 --- a/helm/ocaml/cic/cic.ml +++ b/helm/ocaml/cic/cic.ml @@ -41,23 +41,44 @@ type 'term explicit_named_substitution = (UriManager.uri * 'term) list type implicit_annotation = [ `Closed | `Type | `Hole ] -type anntarget = - Object of annobj (* if annobj is a Constant, this is its type *) - | ConstantBody of annobj - | Term of annterm - | Conjecture of annconjecture - | Hypothesis of annhypothesis - (* INTERNAL REPRESENTATION OF CIC OBJECTS AND TERMS *) -and sort = + +type sort = Prop | Set | Type of CicUniv.universe | CProp -and name = - Name of string + +type name = + | Name of string | Anonymous -and term = + +type object_flavour = + [ `Definition + | `Fact + | `Lemma + | `Remark + | `Theorem + | `Variant + ] + +type object_class = + [ `Coercion + | `Elim of sort (** elimination principle; if sort is Type, the universe is + * not relevant *) + | `Record of (string * bool) list (** + inductive type that encodes a record; the arguments are + the record fields names and if they are coercions *) + | `Projection (** record projection *) + ] + +type attribute = + [ `Class of object_class + | `Flavour of object_flavour + | `Generated + ] + +type term = Rel of int (* DeBrujin index, 1 based*) | Var of UriManager.uri * (* uri, *) term explicit_named_substitution (* explicit named subst. *) @@ -88,13 +109,13 @@ and term = | CoFix of int * coInductiveFun list (* funno (0 based), funs *) and obj = Constant of string * term option * term * (* id, body, type, *) - UriManager.uri list (* parameters *) + UriManager.uri list * attribute list (* parameters *) | Variable of string * term option * term * (* name, body, type *) - UriManager.uri list (* parameters *) - | CurrentProof of string * metasenv * (* name, conjectures, *) - term * term * UriManager.uri list (* value, type, parameters *) + UriManager.uri list * attribute list (* parameters *) + | CurrentProof of string * metasenv * term * (* name, conjectures, body, *) + term * UriManager.uri list * attribute list (* type, parameters *) | InductiveDefinition of inductiveType list * (* inductive types, *) - UriManager.uri list * int (* params, left params no *) + UriManager.uri list * int * attribute list (* params, left params no *) and inductiveType = string * bool * term * (* typename, inductive, arity *) constructor list (* constructors *) @@ -153,16 +174,17 @@ and annterm = and annobj = AConstant of id * id option * string * (* name, *) annterm option * annterm * (* body, type, *) - UriManager.uri list (* parameters *) + UriManager.uri list * attribute list (* parameters *) | AVariable of id * string * annterm option * annterm * (* name, body, type *) - UriManager.uri list (* parameters *) + UriManager.uri list * attribute list (* parameters *) | ACurrentProof of id * id * string * annmetasenv * (* name, conjectures, *) - annterm * annterm * UriManager.uri list (* value,type,parameters *) + annterm * annterm * UriManager.uri list * (* body,type,parameters *) + attribute list | AInductiveDefinition of id * anninductiveType list * (* inductive types , *) - UriManager.uri list * int (* parameters,n ind. pars*) + UriManager.uri list * int * attribute list (* parameters,n ind. pars*) and anninductiveType = id * string * bool * annterm * (* typename, inductive, arity *) annconstructor list (* constructors *) @@ -193,3 +215,24 @@ and annhypothesis = and anncontext = annhypothesis list ;; + +type lazy_term = + context -> metasenv -> CicUniv.universe_graph -> + term * metasenv * CicUniv.universe_graph + +type anntarget = + Object of annobj (* if annobj is a Constant, this is its type *) + | ConstantBody of annobj + | Term of annterm + | Conjecture of annconjecture + | Hypothesis of annhypothesis + +module CicHash = + Hashtbl.Make + (struct + type t = term + let equal = (==) + let hash = Hashtbl.hash + end) +;; +