Term Rewriting System R: [X, Y, Z, X1, X2] active(first(0, X)) -> mark(nil) active(first(s(X), cons(Y, Z))) -> mark(cons(Y, first(X, Z))) active(from(X)) -> mark(cons(X, from(s(X)))) active(first(X1, X2)) -> first(active(X1), X2) active(first(X1, X2)) -> first(X1, active(X2)) active(s(X)) -> s(active(X)) active(cons(X1, X2)) -> cons(active(X1), X2) active(from(X)) -> from(active(X)) first(mark(X1), X2) -> mark(first(X1, X2)) first(X1, mark(X2)) -> mark(first(X1, X2)) first(ok(X1), ok(X2)) -> ok(first(X1, X2)) s(mark(X)) -> mark(s(X)) s(ok(X)) -> ok(s(X)) cons(mark(X1), X2) -> mark(cons(X1, X2)) cons(ok(X1), ok(X2)) -> ok(cons(X1, X2)) from(mark(X)) -> mark(from(X)) from(ok(X)) -> ok(from(X)) proper(first(X1, X2)) -> first(proper(X1), proper(X2)) proper(0) -> ok(0) proper(nil) -> ok(nil) proper(s(X)) -> s(proper(X)) proper(cons(X1, X2)) -> cons(proper(X1), proper(X2)) proper(from(X)) -> from(proper(X)) top(mark(X)) -> top(proper(X)) top(ok(X)) -> top(active(X)) Termination of R to be shown. R contains the following Dependency Pairs: ACTIVE(cons(X1, X2)) -> CONS(active(X1), X2) ACTIVE(cons(X1, X2)) -> ACTIVE(X1) ACTIVE(from(X)) -> FROM(active(X)) ACTIVE(from(X)) -> ACTIVE(X) ACTIVE(from(X)) -> CONS(X, from(s(X))) ACTIVE(from(X)) -> FROM(s(X)) ACTIVE(from(X)) -> S(X) ACTIVE(first(s(X), cons(Y, Z))) -> CONS(Y, first(X, Z)) ACTIVE(first(s(X), cons(Y, Z))) -> FIRST(X, Z) ACTIVE(first(X1, X2)) -> FIRST(active(X1), X2) ACTIVE(first(X1, X2)) -> ACTIVE(X1) ACTIVE(first(X1, X2)) -> FIRST(X1, active(X2)) ACTIVE(first(X1, X2)) -> ACTIVE(X2) ACTIVE(s(X)) -> S(active(X)) ACTIVE(s(X)) -> ACTIVE(X) CONS(mark(X1), X2) -> CONS(X1, X2) CONS(ok(X1), ok(X2)) -> CONS(X1, X2) TOP(mark(X)) -> TOP(proper(X)) TOP(mark(X)) -> PROPER(X) TOP(ok(X)) -> TOP(active(X)) TOP(ok(X)) -> ACTIVE(X) PROPER(first(X1, X2)) -> FIRST(proper(X1), proper(X2)) PROPER(first(X1, X2)) -> PROPER(X1) PROPER(first(X1, X2)) -> PROPER(X2) PROPER(cons(X1, X2)) -> CONS(proper(X1), proper(X2)) PROPER(cons(X1, X2)) -> PROPER(X1) PROPER(cons(X1, X2)) -> PROPER(X2) PROPER(from(X)) -> FROM(proper(X)) PROPER(from(X)) -> PROPER(X) PROPER(s(X)) -> S(proper(X)) PROPER(s(X)) -> PROPER(X) FIRST(X1, mark(X2)) -> FIRST(X1, X2) FIRST(ok(X1), ok(X2)) -> FIRST(X1, X2) FIRST(mark(X1), X2) -> FIRST(X1, X2) FROM(mark(X)) -> FROM(X) FROM(ok(X)) -> FROM(X) S(ok(X)) -> S(X) S(mark(X)) -> S(X) Furthermore, R contains seven SCCs. SCC1: CONS(ok(X1), ok(X2)) -> CONS(X1, X2) CONS(mark(X1), X2) -> CONS(X1, X2) 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(mark(x_1)) = 1 + x_1 POL(ok(x_1)) = 1 + x_1 POL(CONS(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: CONS(ok(X1), ok(X2)) -> CONS(X1, X2) CONS(mark(X1), X2) -> CONS(X1, X2) This transformation is resulting in no new subcycles. SCC2: FROM(ok(X)) -> FROM(X) FROM(mark(X)) -> FROM(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(FROM(x_1)) = 1 + x_1 POL(mark(x_1)) = 1 + x_1 POL(ok(x_1)) = 1 + x_1 The following Dependency Pairs can be deleted: FROM(ok(X)) -> FROM(X) FROM(mark(X)) -> FROM(X) This transformation is resulting in no new subcycles. SCC3: S(mark(X)) -> S(X) S(ok(X)) -> S(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(S(x_1)) = 1 + x_1 POL(mark(x_1)) = 1 + x_1 POL(ok(x_1)) = 1 + x_1 The following Dependency Pairs can be deleted: S(mark(X)) -> S(X) S(ok(X)) -> S(X) This transformation is resulting in no new subcycles. SCC4: FIRST(mark(X1), X2) -> FIRST(X1, X2) FIRST(ok(X1), ok(X2)) -> FIRST(X1, X2) FIRST(X1, mark(X2)) -> FIRST(X1, X2) 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(mark(x_1)) = 1 + x_1 POL(ok(x_1)) = 1 + x_1 POL(FIRST(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: FIRST(mark(X1), X2) -> FIRST(X1, X2) FIRST(ok(X1), ok(X2)) -> FIRST(X1, X2) FIRST(X1, mark(X2)) -> FIRST(X1, X2) This transformation is resulting in no new subcycles. SCC5: ACTIVE(s(X)) -> ACTIVE(X) ACTIVE(first(X1, X2)) -> ACTIVE(X2) ACTIVE(first(X1, X2)) -> ACTIVE(X1) ACTIVE(from(X)) -> ACTIVE(X) ACTIVE(cons(X1, X2)) -> ACTIVE(X1) 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(first(x_1, x_2)) = 1 + x_1 + x_2 POL(s(x_1)) = 1 + x_1 POL(from(x_1)) = 1 + x_1 POL(ACTIVE(x_1)) = 1 + x_1 POL(cons(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: ACTIVE(s(X)) -> ACTIVE(X) ACTIVE(first(X1, X2)) -> ACTIVE(X2) ACTIVE(first(X1, X2)) -> ACTIVE(X1) ACTIVE(from(X)) -> ACTIVE(X) ACTIVE(cons(X1, X2)) -> ACTIVE(X1) This transformation is resulting in no new subcycles. SCC6: PROPER(s(X)) -> PROPER(X) PROPER(from(X)) -> PROPER(X) PROPER(cons(X1, X2)) -> PROPER(X2) PROPER(cons(X1, X2)) -> PROPER(X1) PROPER(first(X1, X2)) -> PROPER(X2) PROPER(first(X1, X2)) -> PROPER(X1) 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(first(x_1, x_2)) = 1 + x_1 + x_2 POL(PROPER(x_1)) = 1 + x_1 POL(s(x_1)) = 1 + x_1 POL(from(x_1)) = 1 + x_1 POL(cons(x_1, x_2)) = 1 + x_1 + x_2 The following Dependency Pairs can be deleted: PROPER(s(X)) -> PROPER(X) PROPER(from(X)) -> PROPER(X) PROPER(cons(X1, X2)) -> PROPER(X2) PROPER(cons(X1, X2)) -> PROPER(X1) PROPER(first(X1, X2)) -> PROPER(X2) PROPER(first(X1, X2)) -> PROPER(X1) This transformation is resulting in no new subcycles. SCC7: TOP(ok(X)) -> TOP(active(X)) TOP(mark(X)) -> TOP(proper(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: active(cons(X1, X2)) -> cons(active(X1), X2) active(from(X)) -> from(active(X)) active(from(X)) -> mark(cons(X, from(s(X)))) active(first(s(X), cons(Y, Z))) -> mark(cons(Y, first(X, Z))) active(first(X1, X2)) -> first(active(X1), X2) active(first(0, X)) -> mark(nil) active(first(X1, X2)) -> first(X1, active(X2)) active(s(X)) -> s(active(X)) proper(nil) -> ok(nil) proper(first(X1, X2)) -> first(proper(X1), proper(X2)) proper(cons(X1, X2)) -> cons(proper(X1), proper(X2)) proper(from(X)) -> from(proper(X)) proper(s(X)) -> s(proper(X)) proper(0) -> ok(0) cons(mark(X1), X2) -> mark(cons(X1, X2)) cons(ok(X1), ok(X2)) -> ok(cons(X1, X2)) from(mark(X)) -> mark(from(X)) from(ok(X)) -> ok(from(X)) s(ok(X)) -> ok(s(X)) s(mark(X)) -> mark(s(X)) first(X1, mark(X2)) -> mark(first(X1, X2)) first(ok(X1), ok(X2)) -> ok(first(X1, X2)) first(mark(X1), X2) -> mark(first(X1, X2)) Used ordering: Polynomial ordering with Polynomial interpretation: POL(active(x_1)) = x_1 POL(first(x_1, x_2)) = x_1 + x_2 POL(nil) = 0 POL(proper(x_1)) = x_1 POL(s(x_1)) = 1 + x_1 POL(TOP(x_1)) = 1 + x_1 POL(mark(x_1)) = 1 + x_1 POL(from(x_1)) = 1 + x_1 POL(ok(x_1)) = x_1 POL(0) = 1 POL(cons(x_1, x_2)) = x_1 resulting in one subcycle. SCC7.Polo1: TOP(ok(X)) -> TOP(active(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: active(cons(X1, X2)) -> cons(active(X1), X2) active(from(X)) -> from(active(X)) active(from(X)) -> mark(cons(X, from(s(X)))) active(first(s(X), cons(Y, Z))) -> mark(cons(Y, first(X, Z))) active(first(X1, X2)) -> first(active(X1), X2) active(first(0, X)) -> mark(nil) active(first(X1, X2)) -> first(X1, active(X2)) active(s(X)) -> s(active(X)) cons(mark(X1), X2) -> mark(cons(X1, X2)) cons(ok(X1), ok(X2)) -> ok(cons(X1, X2)) from(mark(X)) -> mark(from(X)) from(ok(X)) -> ok(from(X)) s(ok(X)) -> ok(s(X)) s(mark(X)) -> mark(s(X)) first(X1, mark(X2)) -> mark(first(X1, X2)) first(ok(X1), ok(X2)) -> ok(first(X1, X2)) first(mark(X1), X2) -> mark(first(X1, X2)) Used ordering: Polynomial ordering with Polynomial interpretation: POL(active(x_1)) = x_1 POL(first(x_1, x_2)) = x_1 POL(nil) = 0 POL(s(x_1)) = x_1 POL(TOP(x_1)) = 1 + x_1 POL(mark(x_1)) = 0 POL(from(x_1)) = x_1 POL(ok(x_1)) = 1 + x_1 POL(0) = 0 POL(cons(x_1, x_2)) = x_2 resulting in no subcycles. Termination of R successfully shown. Duration: 5.679 seconds.