The old kernel interpretes it simply as Type.
The new kernel as Typen.
| Ast.Sort `Prop -> "Prop"
| Ast.Sort (`Type _) -> "Type"
| Ast.Sort (`CProp _)-> "CProp"
+ | Ast.Sort (`NType s)-> "Type[" ^ s ^ "]"
| Ast.Symbol (name, _) -> "'" ^ name
| Ast.UserInput -> ""
type binder_kind = [ `Lambda | `Pi | `Exists | `Forall ]
type induction_kind = [ `Inductive | `CoInductive ]
-type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe]
+type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe | `NType of string]
type fold_kind = [ `Left | `Right ]
type location = Stdpp.location
| Cic.AProd (id,n,s,t) ->
let binder_kind =
match sort_of_id id with
- | `Set | `Type _ -> `Pi
+ | `Set | `Type _ | `NType _ -> `Pi
| `Prop | `CProp _ -> `Forall
in
idref id (Ast.Binder (binder_kind,
(* $Id$ *)
-type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe ]
+type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe | `NType of string ]
let string_of_sort = function
| `Prop -> "Prop"
| `Set -> "Set"
| `Type u -> "Type:" ^ string_of_int (CicUniv.univno u) ^ ":" ^ UriManager.string_of_uri (CicUniv.univuri u)
+ | `NType s -> "Type[" ^ s ^ "]"
| `CProp u -> "CProp:" ^ string_of_int (CicUniv.univno u) ^ ":" ^ UriManager.string_of_uri (CicUniv.univuri u)
{annsynthesized : Cic.annterm ; annexpected : Cic.annterm option}
;;
-type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe]
+type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe | `NType of string ]
val string_of_sort: sort_kind -> string
(*val sort_of_string: string -> sort_kind*)
| CicNotationPt.Sort `Prop -> Cic.Sort Cic.Prop
| CicNotationPt.Sort `Set -> Cic.Sort Cic.Set
| CicNotationPt.Sort (`Type u) -> Cic.Sort (Cic.Type u)
+ | CicNotationPt.Sort (`NType _) -> Cic.Sort (Cic.Type (CicUniv.fresh ()))
| CicNotationPt.Sort (`CProp u) -> Cic.Sort (Cic.CProp u)
| CicNotationPt.Symbol (symbol, instance) ->
Disambiguate.resolve ~mk_choice ~env
(DisambiguateTypes.Symbol (symbol, instance)) (`Args [])
- | _ -> assert false (* god bless Bologna *)
+ | CicNotationPt.Variable _
+ | CicNotationPt.Magic _
+ | CicNotationPt.Layout _
+ | CicNotationPt.Literal _ -> assert false (* god bless Bologna *)
and aux_option ~localize loc context annotation = function
| None -> Cic.Implicit annotation
| Some term -> aux ~localize loc context term
sort: [
[ "Prop" -> `Prop
| "Set" -> `Set
+ | "Type"; SYMBOL "["; n = NUMBER; SYMBOL "]" -> `NType n
| "Type" -> `Type (CicUniv.fresh ())
| "CProp" -> `CProp (CicUniv.fresh ())
]
val content2pres:
?skip_initial_lambdas:int -> ?skip_thm_and_qed:bool ->
- ids_to_inner_sorts:(Cic.id, Cic2acic.sort_kind) Hashtbl.t ->
+ ids_to_inner_sorts:(Cic.id, CicNotationPt.sort_kind) Hashtbl.t ->
Cic.annterm Content.cobj ->
CicNotationPres.boxml_markup
(***************************************************************************)
val sequent2pres :
- ids_to_inner_sorts:(Cic.id, Cic2acic.sort_kind) Hashtbl.t ->
+ ids_to_inner_sorts:(Cic.id, CicNotationPt.sort_kind) Hashtbl.t ->
Cic.annterm Content.conjecture ->
CicNotationPres.boxml_markup
| `Set -> "Set"
| `CProp _ -> "CProp"
| `Type _ -> "Type"
+ | `NType s -> "Type[" ^ s ^ "]"
let pp_ast0 t k =
let rec aux =
assert (uri = None);
let rec aux ~localize loc context = function
- t ->
- let res =
- match t with
| CicNotationPt.AttributedTerm (`Loc loc, term) ->
let res = aux ~localize loc context term in
if localize then
[false,NUri.uri_of_string "cic:/matita/pts/Type.univ"])
| CicNotationPt.Sort (`Type _u) -> NCic.Sort (NCic.Type
[false,NUri.uri_of_string "cic:/matita/pts/Type.univ"])
+ | CicNotationPt.Sort (`NType s) -> NCic.Sort (NCic.Type
+ [false,NUri.uri_of_string ("cic:/matita/pts/Type" ^ s ^ ".univ")])
| CicNotationPt.Sort (`CProp _u) -> NCic.Sort (NCic.Type
[false,NUri.uri_of_string "cic:/matita/pts/CProp.univ"])
| CicNotationPt.Symbol (symbol, instance) ->
Disambiguate.resolve ~env ~mk_choice
(Symbol (symbol, instance)) (`Args [])
- | _ -> assert false (* god bless Bologna *)
-
- in
-(* prerr_endline (NCicPp.ppterm ~metasenv:[] ~context:[] ~subst:[] res); *)
- res
+ | CicNotationPt.Variable _
+ | CicNotationPt.Magic _
+ | CicNotationPt.Layout _
+ | CicNotationPt.Literal _ -> assert false (* god bless Bologna *)
and aux_option ~localize loc context annotation = function
| None -> NCic.Implicit annotation
| Some (CicNotationPt.AttributedTerm (`Loc loc, term)) ->