lean2/tests/lua/env8.lua
Leonardo de Moura 00b1a84051 feat(library/kernel_bindings): expose environment::for_each method in the Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-05-20 10:16:19 -07:00

13 lines
356 B
Lua

local env = environment()
local nat = Const("nat")
env = add_inductive(env,
"nat", Type,
"zero", nat,
"succ", mk_arrow(nat, nat))
-- Display all declarations in the environment
env:for_each(function(d)
print(tostring(d:name()) .. " : " .. tostring(d:type()))
end
)