Term Rewriting System R: [n, x, m, y] sum(cons(s(n), x), cons(m, y)) -> sum(cons(n, x), cons(s(m), y)) sum(cons(0, x), y) -> sum(x, y) sum(nil, y) -> y weight(cons(n, cons(m, x))) -> weight(sum(cons(n, cons(m, x)), cons(0, x))) weight(cons(n, nil)) -> n 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: WEIGHT(cons(n, cons(m, x))) -> WEIGHT(sum(cons(n, cons(m, x)), cons(0, x))) WEIGHT(cons(n, cons(m, x))) -> SUM(cons(n, cons(m, x)), cons(0, x)) SUM(cons(s(n), x), cons(m, y)) -> SUM(cons(n, x), cons(s(m), y)) SUM(cons(0, x), y) -> SUM(x, y) Furthermore, R contains two SCCs. SCC1: SUM(cons(0, x), y) -> SUM(x, y) SUM(cons(s(n), x), cons(m, y)) -> SUM(cons(n, x), cons(s(m), 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)) = x_1 POL(SUM(x_1, x_2)) = 1 + x_1 + x_2 POL(0) = 1 POL(cons(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: SUM(cons(0, x), y) -> SUM(x, y) No rules of R can be deleted. This transformation is resulting in one new subcycle: SCC1.MRR1: SUM(cons(s(n), x), cons(m, y)) -> SUM(cons(n, x), cons(s(m), y)) 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(SUM(x_1, x_2)) = 1 + x_1 POL(cons(x_1, x_2)) = x_1 + x_2 resulting in no subcycles. SCC2: WEIGHT(cons(n, cons(m, x))) -> WEIGHT(sum(cons(n, cons(m, x)), cons(0, x))) By using a polynomial ordering, at least one Dependency Pair of this SCC can be strictly oriented. Additionally, the following rules can be oriented: sum(cons(s(n), x), cons(m, y)) -> sum(cons(n, x), cons(s(m), y)) sum(cons(0, x), y) -> sum(x, y) sum(nil, y) -> y Used ordering: Polynomial ordering with Polynomial interpretation: POL(nil) = 0 POL(s(x_1)) = 0 POL(sum(x_1, x_2)) = x_2 POL(WEIGHT(x_1)) = 1 + x_1 POL(0) = 0 POL(cons(x_1, x_2)) = 1 + x_2 resulting in no subcycles. Termination of R successfully shown. Duration: 0.767 seconds.