Term Rewriting System R: [x, y, u, z] -(x, 0) -> x -(s(x), s(y)) -> -(x, y) <=(0, y) -> true <=(s(x), 0) -> false <=(s(x), s(y)) -> <=(x, y) if(true, x, y) -> x if(false, x, y) -> y perfectp(0) -> false perfectp(s(x)) -> f(x, s(0), s(x), s(x)) f(0, y, 0, u) -> true f(0, y, s(z), u) -> false f(s(x), 0, z, u) -> f(x, u, -(z, s(x)), u) f(s(x), s(y), z, u) -> if(<=(x, y), f(s(x), -(y, x), z, u), f(x, u, z, u)) Termination of R to be shown. This program has no overlaps, so it is sufficient to show innermost termination. R contains the following Dependency Pairs: F(s(x), 0, z, u) -> F(x, u, -(z, s(x)), u) F(s(x), 0, z, u) -> -'(z, s(x)) F(s(x), s(y), z, u) -> IF(<=(x, y), f(s(x), -(y, x), z, u), f(x, u, z, u)) F(s(x), s(y), z, u) -> <='(x, y) F(s(x), s(y), z, u) -> F(s(x), -(y, x), z, u) F(s(x), s(y), z, u) -> -'(y, x) F(s(x), s(y), z, u) -> F(x, u, z, u) -'(s(x), s(y)) -> -'(x, y) <='(s(x), s(y)) -> <='(x, y) PERFECTP(s(x)) -> F(x, s(0), s(x), s(x)) Furthermore, R contains three SCCs. SCC1: -'(s(x), s(y)) -> -'(x, y) Removing rules from R by ordering and analyzing Dependency Pairs, Usable Rules, and Usable Equations. This is possible by using the following (C_E-compatible) Polynomial ordering. Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(-'(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: -'(s(x), s(y)) -> -'(x, y) This transformation is resulting in no new subcycles. SCC2: <='(s(x), s(y)) -> <='(x, y) Removing rules from R by ordering and analyzing Dependency Pairs, Usable Rules, and Usable Equations. This is possible by using the following (C_E-compatible) Polynomial ordering. Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(<='(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: <='(s(x), s(y)) -> <='(x, y) This transformation is resulting in no new subcycles. SCC3: F(s(x), s(y), z, u) -> F(x, u, z, u) F(s(x), s(y), z, u) -> F(s(x), -(y, x), z, u) F(s(x), 0, z, u) -> F(x, u, -(z, s(x)), u) By using a polynomial ordering, at least one Dependency Pair of this SCC can be strictly oriented. No rules need to be oriented. Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(-(x_1, x_2)) = 0 POL(F(x_1, x_2, x_3, x_4)) = x_1 POL(0) = 0 resulting in one subcycle. SCC3.Polo1: F(s(x), s(y), z, u) -> F(s(x), -(y, x), z, u) By using a polynomial ordering, at least one Dependency Pair of this SCC can be strictly oriented. Additionally, the following rules can be oriented: -(x, 0) -> x -(s(x), s(y)) -> -(x, y) Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(-(x_1, x_2)) = x_1 POL(F(x_1, x_2, x_3, x_4)) = x_1 + x_2 + x_3 + x_4 POL(0) = 1 resulting in no subcycles. Termination of R successfully shown. Duration: 0.994 seconds.