lean2/tests/lua/size.lua
Leonardo de Moura ac9f8f340d feat(kernel/expr): add efficient get_size() function for expressions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-20 12:28:37 -08:00

9 lines
233 B
Lua

local f = Const("f")
assert(f:size() == 1)
local x = Var(0)
assert(x:size() == 1)
assert(f(x):size() == 3)
local t = f(x)
assert(t(x):size() == 4)
assert(t(x)(f(x)):size() == 7)
assert(mk_lambda("x", Const("Nat"), f(x)):size() == 5)