Term Rewriting System R: [x, y, v, w, z] sort(nil) -> nil sort(cons(x, y)) -> insert(x, sort(y)) insert(x, nil) -> cons(x, nil) insert(x, cons(v, w)) -> choose(x, cons(v, w), x, v) choose(x, cons(v, w), y, 0) -> cons(x, cons(v, w)) choose(x, cons(v, w), 0, s(z)) -> cons(v, insert(x, w)) choose(x, cons(v, w), s(y), s(z)) -> choose(x, cons(v, w), y, 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: CHOOSE(x, cons(v, w), s(y), s(z)) -> CHOOSE(x, cons(v, w), y, z) CHOOSE(x, cons(v, w), 0, s(z)) -> INSERT(x, w) INSERT(x, cons(v, w)) -> CHOOSE(x, cons(v, w), x, v) SORT(cons(x, y)) -> INSERT(x, sort(y)) SORT(cons(x, y)) -> SORT(y) Furthermore, R contains two SCCs. SCC1: INSERT(x, cons(v, w)) -> CHOOSE(x, cons(v, w), x, v) CHOOSE(x, cons(v, w), 0, s(z)) -> INSERT(x, w) CHOOSE(x, cons(v, w), s(y), s(z)) -> CHOOSE(x, cons(v, w), y, z) 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(CHOOSE(x_1, x_2, x_3, x_4)) = x_2 POL(s(x_1)) = 0 POL(INSERT(x_1, x_2)) = 1 + x_2 POL(0) = 0 POL(cons(x_1, x_2)) = 1 + x_2 resulting in one subcycle. SCC1.Polo1: CHOOSE(x, cons(v, w), s(y), s(z)) -> CHOOSE(x, cons(v, w), y, 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(CHOOSE(x_1, x_2, x_3, x_4)) = 1 + x_1 + x_2 + x_3 + x_4 POL(s(x_1)) = 1 + x_1 POL(cons(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: CHOOSE(x, cons(v, w), s(y), s(z)) -> CHOOSE(x, cons(v, w), y, z) This transformation is resulting in no new subcycles. SCC2: SORT(cons(x, y)) -> SORT(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(SORT(x_1)) = 1 + x_1 POL(cons(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: SORT(cons(x, y)) -> SORT(y) This transformation is resulting in no new subcycles. Termination of R successfully shown. Duration: 0.682 seconds.