lean2/tests
Leonardo de Moura 6bcd8e3ee5 fix(library/expr_lt): use expression depth instead of size to obtain a monotonic total order on terms
It is not incorrect to use size, but it can easily overflow due to sharing.
The following script demonstrates the problem:

local f = Const("f")
local a = Const("a")
function mk_shared(d)
   if d == 0 then
      return a
   else
      local c = mk_shared(d-1)
      return f(c, c)
   end
end
print(mk_shared(33):size())

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-20 17:40:49 -08:00
..
lean feat(library/simplifier): memoize intermediate results 2014-01-20 17:03:44 -08:00
lua fix(library/expr_lt): use expression depth instead of size to obtain a monotonic total order on terms 2014-01-20 17:40:49 -08:00