2014-07-22 16:43:18 +00:00
|
|
|
definition Prop [inline] : Type.{1} := Type.{0}
|
2014-06-13 22:13:32 +00:00
|
|
|
variable N : Type.{1}
|
|
|
|
check N
|
|
|
|
variable a : N
|
|
|
|
check a
|
2014-07-22 16:43:18 +00:00
|
|
|
check Prop → Prop
|
2014-06-13 22:13:32 +00:00
|
|
|
variable F.{l} : Type.{l} → Type.{l}
|
|
|
|
check F.{2}
|
|
|
|
universe u
|
|
|
|
check F.{u}
|
|
|
|
variable vec.{l} (A : Type.{l}) (n : N) : Type.{l}
|
|
|
|
variable f (a b : N) : N
|
|
|
|
variable len.{l} (A : Type.{l}) (n : N) (v : vec.{l} A n) : N
|
|
|
|
check f
|
|
|
|
check len.{1}
|
|
|
|
section
|
|
|
|
variable A : Type
|
2014-07-22 16:43:18 +00:00
|
|
|
variable B : Prop
|
2014-06-13 22:13:32 +00:00
|
|
|
hypothesis H : B
|
2014-06-23 00:51:00 +00:00
|
|
|
parameter {C : Type}
|
2014-06-13 22:13:32 +00:00
|
|
|
check B -> B
|
|
|
|
check A → A
|
|
|
|
check C
|
|
|
|
end
|
|
|
|
check A -- Error: A is part of the section
|
|
|
|
|
|
|
|
variable R : Type → Type
|
|
|
|
check R.{1 0}
|
|
|
|
|
|
|
|
check fun x y : N, x
|
|
|
|
|
|
|
|
namespace tst
|
|
|
|
variable N : Type.{2}
|
|
|
|
variable M : Type.{2}
|
|
|
|
print raw N -- Two possible interpretations N and tst.N
|
|
|
|
print raw tst.N -- Only one interpretation
|
2014-08-07 23:59:08 +00:00
|
|
|
end tst
|
2014-06-13 22:13:32 +00:00
|
|
|
print raw N -- Only one interpretation
|
|
|
|
namespace foo
|
|
|
|
variable M : Type.{3}
|
|
|
|
print raw M -- Only one interpretation
|
2014-08-07 23:59:08 +00:00
|
|
|
end foo
|
2014-06-13 22:13:32 +00:00
|
|
|
check tst.M
|
|
|
|
check foo.M
|
|
|
|
namespace foo
|
|
|
|
check M
|
2014-08-07 23:59:08 +00:00
|
|
|
end foo
|
2014-06-13 22:13:32 +00:00
|
|
|
check M -- Error
|
|
|
|
|
|
|
|
print "ok"
|
|
|
|
(*
|
|
|
|
local env = get_env()
|
|
|
|
print("Declarations:")
|
|
|
|
env:for_each_decl(function(d) print(d:name()) end)
|
|
|
|
print("-------------")
|
|
|
|
*)
|
|
|
|
|
|
|
|
universe l_1
|
|
|
|
variable T1 : Type -- T1 parameter is going to be called l_2
|