lean2/tests/lua/slow/t1.lua
Leonardo de Moura 3a924a5fb1 perf(lua/name): improve to_name_ext performance
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 18:06:09 -08:00

12 lines
285 B
Lua

function mk_big(f, depth, val)
if depth == 1 then
return Const{"foo", val}
else
return f(mk_big(f, depth - 1, 2 * val), mk_big(f, depth - 1, 2 * val + 1))
end
end
local f = Const("f")
local r1 = mk_big(f, 20, 0)
local r2 = mk_big(f, 20, 0)
assert(r1 == r2)