Here are two pieces of code that I think are equivalent, except for the second, which has more lines, then it should:
fun
move_ul
{i:nat}
(
p: int(i)
, ms: list0(Int)
): list0(Int) =
if p - 5 >= 0 andalso p % 4 != 0 then
move_ul(p - 5, cons0(p - 5, ms))
else
ms
fun
move_ul
{i:nat}
(
p: int(i)
, ms: list0(Int)
): list0(Int) =
if p % 4 != 0 then
if p - 5 >= 0 then
move_ul(p - 5, cons0(p - 5, ms))
else
ms
else
ms
For some reason, the second is waiting for type checking, but the first is failing (inability to satisfy the constraints) ... can someone tell me why?
source
share