YES TRS: 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)) linear polynomial interpretations on N: flatten_A(x1) = x1 flatten#_A(x1) = x1 nil_A = 1 nil#_A = 1 unit_A(x1) = x1 + 1 unit#_A(x1) = x1 + 1 ++_A(x1,x2) = x1 + x2 + 1 ++#_A(x1,x2) = x1 + x2 + 1 rev_A(x1) = x1 rev#_A(x1) = x1 precedence: flatten = nil = ++ = rev > unit