lean2/tests/lua/big.lua
Leonardo de Moura 3f0279b88c refactor(frontends/lua): replace lean.lua.h with util.lua
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-26 19:49:26 -08:00

22 lines
371 B
Lua

import("util.lua")
f, a, b = Consts("f, a, b")
nodes = {}
function mk_big(num)
local r
if num == 0 then
r = f(a, b)
else
r = f(mk_big(num-1), mk_big(num-1))
end
return r
end
function size(e)
local r = 0
e:for_each(function(e, o) assert(e:is_app() or e:is_constant()); r = r + 1 end)
return r
end
local F = mk_big(14)
print(size(F))