lean2/tests/lua/replace1.lua
Leonardo de Moura 1c96373c1a feat(library/kernel_bindings): expose replace_fn in the Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-04 15:26:55 -07:00

10 lines
274 B
Lua

local f = Const("f")
local a = Const("a")
local b = Const("b")
local t = f(a, f(a))
local new_t = t:replace(function(e)
if e == a then
return b
end
end)
print(new_t)