lean2/tests/lua/sect1b.lua
Leonardo de Moura b6d2328c1d fix(library/scope): make sure local levels are added in the beginning of the universe parameter list
The idea is to make sure it is consistent with the behavior used for regular local parameters.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-02 14:06:31 -07:00

12 lines
417 B
Lua

local env = environment()
env = env:begin_section_scope()
env = env:add_global_level("l")
local l = mk_global_univ("l")
local l1 = mk_param_univ("l1")
env = add_decl(env, mk_definition("A", {l1}, mk_sort(max_univ(l, l1)+1), mk_sort(max_univ(l, l1))))
env = env:end_scope()
local ls = env:find("A"):univ_params()
assert(#ls == 2)
print(ls:head())
assert(ls:head() == name("l"))
assert(ls:tail():head() == name("l1"))