Term Rewriting System R: [x, y, n, u, v, w, z] minus(x, 0) -> x minus(s(x), s(y)) -> minus(x, y) quot(0, s(y)) -> 0 quot(s(x), s(y)) -> s(quot(minus(x, y), s(y))) app(nil, y) -> y app(add(n, x), y) -> add(n, app(x, y)) reverse(nil) -> nil reverse(add(n, x)) -> app(reverse(x), add(n, nil)) shuffle(nil) -> nil shuffle(add(n, x)) -> add(n, shuffle(reverse(x))) concat(leaf, y) -> y concat(cons(u, v), y) -> cons(u, concat(v, y)) less_leaves(x, leaf) -> false less_leaves(leaf, cons(w, z)) -> true less_leaves(cons(u, v), cons(w, z)) -> less_leaves(concat(u, v), concat(w, z)) 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: APP(add(n, x), y) -> APP(x, y) MINUS(s(x), s(y)) -> MINUS(x, y) LESS_LEAVES(cons(u, v), cons(w, z)) -> LESS_LEAVES(concat(u, v), concat(w, z)) LESS_LEAVES(cons(u, v), cons(w, z)) -> CONCAT(u, v) LESS_LEAVES(cons(u, v), cons(w, z)) -> CONCAT(w, z) QUOT(s(x), s(y)) -> QUOT(minus(x, y), s(y)) QUOT(s(x), s(y)) -> MINUS(x, y) CONCAT(cons(u, v), y) -> CONCAT(v, y) REVERSE(add(n, x)) -> APP(reverse(x), add(n, nil)) REVERSE(add(n, x)) -> REVERSE(x) SHUFFLE(add(n, x)) -> SHUFFLE(reverse(x)) SHUFFLE(add(n, x)) -> REVERSE(x) Furthermore, R contains seven SCCs. SCC1: APP(add(n, x), y) -> APP(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(add(x_1, x_2)) = 1 + x_1 + x_2 POL(APP(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: APP(add(n, x), y) -> APP(x, y) This transformation is resulting in no new subcycles. SCC2: MINUS(s(x), s(y)) -> MINUS(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(MINUS(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: MINUS(s(x), s(y)) -> MINUS(x, y) This transformation is resulting in no new subcycles. SCC3: CONCAT(cons(u, v), y) -> CONCAT(v, 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(CONCAT(x_1, x_2)) = 1 + x_1 + x_2 POL(cons(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: CONCAT(cons(u, v), y) -> CONCAT(v, y) This transformation is resulting in no new subcycles. SCC4: REVERSE(add(n, x)) -> REVERSE(x) 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(add(x_1, x_2)) = 1 + x_1 + x_2 POL(REVERSE(x_1)) = 1 + x_1 The following Dependency Pairs can be deleted: REVERSE(add(n, x)) -> REVERSE(x) This transformation is resulting in no new subcycles. SCC5: QUOT(s(x), s(y)) -> QUOT(minus(x, y), s(y)) By using a polynomial ordering, at least one Dependency Pair of this SCC can be strictly oriented. Additionally, the following rules can be oriented: minus(x, 0) -> x minus(s(x), s(y)) -> minus(x, y) Used ordering: Polynomial ordering with Polynomial interpretation: POL(s(x_1)) = 1 + x_1 POL(minus(x_1, x_2)) = x_1 POL(QUOT(x_1, x_2)) = x_1 + x_2 POL(0) = 1 resulting in no subcycles. SCC6: LESS_LEAVES(cons(u, v), cons(w, z)) -> LESS_LEAVES(concat(u, v), concat(w, z)) 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(concat(x_1, x_2)) = x_1 + x_2 POL(LESS_LEAVES(x_1, x_2)) = 1 + x_1 + x_2 POL(leaf) = 1 POL(cons(x_1, x_2)) = x_1 + x_2 No Dependency Pairs can be deleted. The following rules of R can be deleted: concat(leaf, y) -> y This transformation is resulting in one new subcycle: SCC6.MRR1: LESS_LEAVES(cons(u, v), cons(w, z)) -> LESS_LEAVES(concat(u, v), concat(w, z)) 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(concat(x_1, x_2)) = x_1 + x_2 POL(LESS_LEAVES(x_1, x_2)) = 1 + x_1 + x_2 POL(cons(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: LESS_LEAVES(cons(u, v), cons(w, z)) -> LESS_LEAVES(concat(u, v), concat(w, z)) This transformation is resulting in no new subcycles. SCC7: SHUFFLE(add(n, x)) -> SHUFFLE(reverse(x)) 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(add(x_1, x_2)) = 1 + x_1 + x_2 POL(nil) = 0 POL(reverse(x_1)) = x_1 POL(SHUFFLE(x_1)) = 1 + x_1 POL(app(x_1, x_2)) = x_1 + x_2 The following Dependency Pairs can be deleted: SHUFFLE(add(n, x)) -> SHUFFLE(reverse(x)) This transformation is resulting in no new subcycles. Termination of R successfully shown. Duration: 1.60 seconds.