YES Problem: flatten(nil()) -> nil() flatten(unit(x)) -> flatten(x) flatten(++(x,y)) -> ++(flatten(x),flatten(y)) flatten(++(unit(x),y)) -> ++(flatten(x),flatten(y)) flatten(flatten(x)) -> flatten(x) rev(nil()) -> nil() rev(unit(x)) -> unit(x) rev(++(x,y)) -> ++(rev(y),rev(x)) rev(rev(x)) -> x ++(x,nil()) -> x ++(nil(),y) -> y ++(++(x,y),z) -> ++(x,++(y,z)) Proof: Matrix Interpretation Processor: dim=1 interpretation: [rev](x0) = 2x0, [flatten](x0) = x0, [++](x0, x1) = x0 + x1 + 4, [nil] = 3, [unit](x0) = x0 orientation: flatten(nil()) = 3 >= 3 = nil() flatten(unit(x)) = x >= x = flatten(x) flatten(++(x,y)) = x + y + 4 >= x + y + 4 = ++(flatten(x),flatten(y)) flatten(++(unit(x),y)) = x + y + 4 >= x + y + 4 = ++(flatten(x),flatten(y)) flatten(flatten(x)) = x >= x = flatten(x) rev(nil()) = 6 >= 3 = nil() rev(unit(x)) = 2x >= x = unit(x) rev(++(x,y)) = 2x + 2y + 8 >= 2x + 2y + 4 = ++(rev(y),rev(x)) rev(rev(x)) = 4x >= x = x ++(x,nil()) = x + 7 >= x = x ++(nil(),y) = y + 7 >= y = y ++(++(x,y),z) = x + y + z + 8 >= x + y + z + 8 = ++(x,++(y,z)) problem: flatten(nil()) -> nil() flatten(unit(x)) -> flatten(x) flatten(++(x,y)) -> ++(flatten(x),flatten(y)) flatten(++(unit(x),y)) -> ++(flatten(x),flatten(y)) flatten(flatten(x)) -> flatten(x) rev(unit(x)) -> unit(x) rev(rev(x)) -> x ++(++(x,y),z) -> ++(x,++(y,z)) Matrix Interpretation Processor: dim=3 interpretation: [rev](x0) = x0 , [1 0 1] [flatten](x0) = [0 1 0]x0 [0 1 0] , [1 0 1] [++](x0, x1) = [0 1 0]x0 + x1 [0 1 0] , [0] [nil] = [1] [1], [1 0 1] [1] [unit](x0) = [0 1 0]x0 + [0] [0 0 0] [0] orientation: [1] [0] flatten(nil()) = [1] >= [1] = nil() [1] [1] [1 0 1] [1] [1 0 1] flatten(unit(x)) = [0 1 0]x + [0] >= [0 1 0]x = flatten(x) [0 1 0] [0] [0 1 0] [1 1 1] [1 0 1] [1 1 1] [1 0 1] flatten(++(x,y)) = [0 1 0]x + [0 1 0]y >= [0 1 0]x + [0 1 0]y = ++(flatten(x),flatten(y)) [0 1 0] [0 1 0] [0 1 0] [0 1 0] [1 1 1] [1 0 1] [1] [1 1 1] [1 0 1] flatten(++(unit(x),y)) = [0 1 0]x + [0 1 0]y + [0] >= [0 1 0]x + [0 1 0]y = ++(flatten(x),flatten(y)) [0 1 0] [0 1 0] [0] [0 1 0] [0 1 0] [1 1 1] [1 0 1] flatten(flatten(x)) = [0 1 0]x >= [0 1 0]x = flatten(x) [0 1 0] [0 1 0] [1 0 1] [1] [1 0 1] [1] rev(unit(x)) = [0 1 0]x + [0] >= [0 1 0]x + [0] = unit(x) [0 0 0] [0] [0 0 0] [0] rev(rev(x)) = x >= x = x [1 1 1] [1 0 1] [1 0 1] [1 0 1] ++(++(x,y),z) = [0 1 0]x + [0 1 0]y + z >= [0 1 0]x + [0 1 0]y + z = ++(x,++(y,z)) [0 1 0] [0 1 0] [0 1 0] [0 1 0] problem: flatten(++(x,y)) -> ++(flatten(x),flatten(y)) flatten(flatten(x)) -> flatten(x) rev(unit(x)) -> unit(x) rev(rev(x)) -> x ++(++(x,y),z) -> ++(x,++(y,z)) Matrix Interpretation Processor: dim=1 interpretation: [rev](x0) = x0 + 1, [flatten](x0) = x0, [++](x0, x1) = 4x0 + x1 + 4, [unit](x0) = 4x0 + 4 orientation: flatten(++(x,y)) = 4x + y + 4 >= 4x + y + 4 = ++(flatten(x),flatten(y)) flatten(flatten(x)) = x >= x = flatten(x) rev(unit(x)) = 4x + 5 >= 4x + 4 = unit(x) rev(rev(x)) = x + 2 >= x = x ++(++(x,y),z) = 16x + 4y + z + 20 >= 4x + 4y + z + 8 = ++(x,++(y,z)) problem: flatten(++(x,y)) -> ++(flatten(x),flatten(y)) flatten(flatten(x)) -> flatten(x) Matrix Interpretation Processor: dim=1 interpretation: [flatten](x0) = 2x0 + 3, [++](x0, x1) = x0 + 2x1 + 6 orientation: flatten(++(x,y)) = 2x + 4y + 15 >= 2x + 4y + 15 = ++(flatten(x),flatten(y)) flatten(flatten(x)) = 4x + 9 >= 2x + 3 = flatten(x) problem: flatten(++(x,y)) -> ++(flatten(x),flatten(y)) Matrix Interpretation Processor: dim=1 interpretation: [flatten](x0) = 6x0 + 1, [++](x0, x1) = 5x0 + 5x1 + 2 orientation: flatten(++(x,y)) = 30x + 30y + 13 >= 30x + 30y + 12 = ++(flatten(x),flatten(y)) problem: Qed