2013-12-27 03:49:04 +00:00
|
|
|
import("util.lua")
|
2013-11-17 21:48:29 +00:00
|
|
|
local env = environment()
|
|
|
|
parse_lean_cmds([[
|
2014-01-05 20:05:08 +00:00
|
|
|
variable N : Type
|
|
|
|
variables x y : N
|
|
|
|
variable f : N -> N -> N
|
|
|
|
setoption pp::colors false
|
2013-11-17 21:48:29 +00:00
|
|
|
]], env)
|
|
|
|
local f, x, y = Consts("f, x, y")
|
2013-12-22 19:51:38 +00:00
|
|
|
print(env:type_check(f(x, y)))
|
|
|
|
assert(env:type_check(f(x, y)) == Const("N"))
|
2013-11-17 21:48:29 +00:00
|
|
|
assert(not get_options():get{"pp", "colors"})
|
|
|
|
parse_lean_cmds([[
|
2014-01-05 20:05:08 +00:00
|
|
|
setoption pp::colors true
|
2013-11-17 21:48:29 +00:00
|
|
|
]], env)
|
|
|
|
assert(get_options():get{"pp", "colors"})
|
|
|
|
local o = get_options()
|
|
|
|
o:update({"lean", "pp", "notation"}, false)
|
|
|
|
assert(not o:get{"lean", "pp", "notation"})
|
|
|
|
o = parse_lean_cmds([[
|
2014-01-05 20:05:08 +00:00
|
|
|
check fun x : N, y
|
|
|
|
setoption pp::notation true
|
|
|
|
check fun x : N, y
|
2013-11-17 21:48:29 +00:00
|
|
|
]], env, o)
|
|
|
|
print(o)
|
|
|
|
assert(o:get{"lean", "pp", "notation"})
|
|
|
|
assert(parse_lean("f x y", env) == f(x, y))
|