Type[0]. The same holds for CProp.
tests/ng_pts.ma defines some sorts, you may want to include it
| Ast.Sort (`Type _) -> "Type"
| Ast.Sort (`CProp _)-> "CProp"
| Ast.Sort (`NType s)-> "Type[" ^ s ^ "]"
+ | Ast.Sort (`NCProp s)-> "CProp[" ^ 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 | `NType of string]
+type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of
+CicUniv.universe | `NType of string |`NCProp of string]
type fold_kind = [ `Left | `Right ]
type location = Stdpp.location
let binder_kind =
match sort_of_id id with
| `Set | `Type _ | `NType _ -> `Pi
- | `Prop | `CProp _ -> `Forall
+ | `Prop | `CProp _ | `NCProp _ -> `Forall
in
idref id (Ast.Binder (binder_kind,
(CicNotationUtil.name_of_cic_name n, Some (k s)), k t))
-extractor.cmo:
-extractor.cmx:
-extractor_manager.cmo:
-extractor_manager.cmx:
-extractor.cmo:
-extractor.cmx:
-extractor_manager.cmo:
-extractor_manager.cmx:
-table_creator.cmo:
-table_creator.cmx:
-table_creator.cmo:
-table_creator.cmx:
gallina8Parser.cmi: types.cmo
grafiteParser.cmi: types.cmo
grafite.cmi: types.cmo
-engine.cmi:
-types.cmo:
-types.cmx:
-options.cmo:
-options.cmx:
gallina8Parser.cmo: types.cmo options.cmo gallina8Parser.cmi
gallina8Parser.cmx: types.cmx options.cmx gallina8Parser.cmi
gallina8Lexer.cmo: options.cmo gallina8Parser.cmi
gallina8Parser.cmi: types.cmx
grafiteParser.cmi: types.cmx
grafite.cmi: types.cmx
-engine.cmi:
-types.cmo:
-types.cmx:
-options.cmo:
-options.cmx:
gallina8Parser.cmo: types.cmx options.cmx gallina8Parser.cmi
gallina8Parser.cmx: types.cmx options.cmx gallina8Parser.cmi
gallina8Lexer.cmo: options.cmx gallina8Parser.cmi
(* $Id$ *)
-type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe | `NType of string ]
+type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe | `NType of string | `NCProp 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 ^ "]"
+ | `NCProp s -> "CProp[" ^ 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 | `NType of string ]
+type sort_kind = [ `Prop | `Set | `Type of CicUniv.universe | `CProp of CicUniv.universe | `NType of string | `NCProp of string]
val string_of_sort: sort_kind -> string
(*val sort_of_string: string -> sort_kind*)
| 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 (`NCProp _) -> Cic.Sort (Cic.CProp (CicUniv.fresh ()))
| CicNotationPt.Sort (`CProp u) -> Cic.Sort (Cic.CProp u)
| CicNotationPt.Symbol (symbol, instance) ->
Disambiguate.resolve ~mk_choice ~env
sort: [
[ "Prop" -> `Prop
| "Set" -> `Set
- | "Type"; SYMBOL "["; n = NUMBER; SYMBOL "]" -> `NType n
+ | "Type"; SYMBOL "["; n = NUMBER; SYMBOL "]" -> `NType n
| "Type" -> `Type (CicUniv.fresh ())
+ | "CProp"; SYMBOL "["; n = NUMBER; SYMBOL "]" -> `NCProp n
| "CProp" -> `CProp (CicUniv.fresh ())
]
];
| `CProp _ -> "CProp"
| `Type _ -> "Type"
| `NType s -> "Type[" ^ s ^ "]"
+ | `NCProp s -> "CProp[" ^ s ^ "]"
let map_space f l =
HExtlib.list_concat
(** To be increased each time the command type below changes, used for "safe"
* marshalling *)
-let magic = 19
+let magic = 20
type ('term,'obj) command =
| Index of loc * 'term option (* key *) * UriManager.uri (* value *)
| Print of loc * string
| Qed of loc
| NObj of loc * CicNotationPt.term CicNotationPt.obj
+ | NUnivConstraint of loc * bool * NUri.uri * NUri.uri
| NQed of loc
type punctuation_tactical =
| Print (_,s) -> "print " ^ s
| Set (_, name, value) -> Printf.sprintf "set \"%s\" \"%s\"" name value
| NObj (_,o) -> "not supported"
+ | NUnivConstraint (_) -> "not supported"
+ | NQed (_) -> "not supported"
+ | Pump (_) -> "not supported"
let pp_punctuation_tactical =
function
status, `Old [] (*CSC: TO BE FIXED *)
| GrafiteAst.Set (loc, name, value) -> status, `Old []
(* GrafiteTypes.set_option status name value,[] *)
+ | GrafiteAst.NUnivConstraint (loc,strict,u1,u2) ->
+ NCicEnvironment.add_constraint strict [false,u1] [false,u2];
+ status, `New [u1;u2]
| GrafiteAst.NObj (loc,obj) ->
let lexicon_status =
match status.GrafiteTypes.ng_status with
| GrafiteAst.Print _
| GrafiteAst.Qed _
| GrafiteAst.NQed _
+ | GrafiteAst.NUnivConstraint _
| GrafiteAst.Set _ as cmd ->
lexicon_status,metasenv,cmd
| GrafiteAst.Obj (loc,obj) ->
in
L.Number_alias (instance, dsc)
]
- ];
+ ];
argument: [
[ l = LIST0 [ SYMBOL <:unicode<eta>> (* η *); SYMBOL "." -> () ];
id = IDENT ->
ind_types
in
G.NObj (loc, N.Inductive (params, ind_types))
+ | IDENT "universe"; IDENT "constraint"; u1 = tactic_term;
+ strict = [ SYMBOL <:unicode<lt>> -> true
+ | SYMBOL <:unicode<leq>> -> false ];
+ u2 = tactic_term ->
+ let u1 =
+ match u1 with
+ | CicNotationPt.AttributedTerm (_, CicNotationPt.Sort (`NType i)) ->
+ NUri.uri_of_string ("cic:/matita/pts/Type"^i^".univ")
+ | CicNotationPt.AttributedTerm (_, CicNotationPt.Sort (`NCProp i)) ->
+ NUri.uri_of_string ("cic:/matita/pts/CProp"^i^".univ")
+ | _ -> raise (Failure "only a sort can be constrained")
+ in
+ let u2 =
+ match u2 with
+ | CicNotationPt.AttributedTerm (_, CicNotationPt.Sort (`NType i)) ->
+ NUri.uri_of_string ("cic:/matita/pts/Type"^i^".univ")
+ | CicNotationPt.AttributedTerm (_, CicNotationPt.Sort (`NCProp i)) ->
+ NUri.uri_of_string ("cic:/matita/pts/CProp"^i^".univ")
+ | _ -> raise (Failure "only a sort can be constrained")
+ in
+ G.NUnivConstraint (loc, strict,u1,u2)
| IDENT "coercion" ;
t = [ u = URI -> N.Uri (u,None) | t = tactic_term ; OPT "with" -> t ] ;
arity = OPT int ; saturations = OPT int;
| CicNotationPt.Ident (name, subst) ->
assert (subst = None);
(try
- NCic.Rel (find_in_context name context)
+ NCic.Rel (find_in_context name context)
with Not_found ->
try NCic.Const (List.assoc name obj_context)
with Not_found ->
| CicNotationPt.Sort `Set -> NCic.Sort (NCic.Type
[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"])
+ [false,NUri.uri_of_string "cic:/matita/pts/Type0.univ"])
| CicNotationPt.Sort (`NType s) -> NCic.Sort (NCic.Type
[false,NUri.uri_of_string ("cic:/matita/pts/Type" ^ s ^ ".univ")])
+ | CicNotationPt.Sort (`NCProp s) -> NCic.Sort (NCic.Type
+ [false,NUri.uri_of_string ("cic:/matita/pts/CProp" ^ s ^ ".univ")])
| CicNotationPt.Sort (`CProp _u) -> NCic.Sort (NCic.Type
- [false,NUri.uri_of_string "cic:/matita/pts/CProp.univ"])
+ [false,NUri.uri_of_string "cic:/matita/pts/CProp0.univ"])
| CicNotationPt.Symbol (symbol, instance) ->
Disambiguate.resolve ~env ~mk_choice
(Symbol (symbol, instance)) (`Args [])
in
List.map (function (a,b,c,d,_) -> a,b,c,d) res, b
;;
+(*
let _ =
let mk_type n =
if n = 0 then
NCicEnvironment.add_constraint false (mk_type 3) (mk_cprop 3);
;;
+*)
let le_constraints = ref [] (* strict,a,b *)
+let resolve_universe u =
+ HExtlib.list_findopt
+ (fun (_,a,b) _ ->
+ prerr_endline (NUri.name_of_uri a);
+ if NUri.name_of_uri a = u then Some a
+ else if NUri.name_of_uri b = u then Some b
+ else None)
+ !le_constraints
+;;
+
let rec le_path_uri avoid strict a b =
(not strict && NUri.eq a b) ||
List.exists
val sup : NCic.universe -> NCic.universe option
val pp_constraints: unit -> string
+val resolve_universe: string -> NUri.uri option
+
val get_checked_def:
NReference.reference ->
NCic.relevance * string * NCic.term * NCic.term * NCic.c_attr * int
-nTacStatus.cmi:
nTactics.cmi: nTacStatus.cmi
-nCicElim.cmi:
+nCicTacReduction.cmo: nCicTacReduction.cmi
+nCicTacReduction.cmx: nCicTacReduction.cmi
nTacStatus.cmo: nCicTacReduction.cmi nTacStatus.cmi
nTacStatus.cmx: nCicTacReduction.cmx nTacStatus.cmi
nTactics.cmo: nTacStatus.cmi nTactics.cmi
-nTacStatus.cmi:
nTactics.cmi: nTacStatus.cmi
-nCicElim.cmi:
+nCicTacReduction.cmo: nCicTacReduction.cmi
+nCicTacReduction.cmx: nCicTacReduction.cmi
nTacStatus.cmo: nCicTacReduction.cmi nTacStatus.cmi
nTacStatus.cmx: nCicTacReduction.cmx nTacStatus.cmi
nTactics.cmo: nTacStatus.cmi nTactics.cmi
(* *)
(**************************************************************************)
-include "nat/plus.ma".
+include "ng_pts.ma".
ndefinition thesis0: ∀A:Type.Type ≝ λA. A → A.
ndefinition Q: Prop ≝ NP.
+include "nat/nat.ma".
+
nlet rec nzero (n:nat) : nat ≝
match n with
[ O ⇒ O
[ mS n ⇒ nnzero n ].
nrecord pair (n: nat) (x: DT n) (label: Type): Type ≝
- { lbl:label; l: pair n x label; r: pair n x label}.
\ No newline at end of file
+ { lbl:label; l: pair n x label; r: pair n x label}.
(* *)
(**************************************************************************)
+include "ng_pts.ma".
+
ninductive nat: Type ≝
O: nat
| S: nat → nat.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+universe constraint Type[0] < Type[1].
+universe constraint Type[1] < Type[2].
+universe constraint CProp[0] < CProp[1].
+universe constraint CProp[1] < CProp[2].
+universe constraint Type[0] ≤ CProp[0].
+universe constraint CProp[0] ≤ Type[0].
+universe constraint Type[1] ≤ CProp[1].
+universe constraint CProp[1] ≤ Type[1].
+universe constraint Type[2] ≤ CProp[2].
+universe constraint CProp[2] ≤ Type[2].
\ No newline at end of file
(* *)
(**************************************************************************)
+include "ng_pts.ma".
include "nat/plus.ma".
ntheorem test1 : ∀n:nat.n = S n + n → S n = (S (S n)).