/export/starexec/sandbox2/solver/bin/starexec_run_FirstOrder /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- YES We consider the system theBenchmark. We are asked to determine termination of the following first-order TRS. 0 : [] --> o active : [o] --> o add : [o * o] --> o cons : [o * o] --> o from : [o] --> o fst : [o * o] --> o len : [o] --> o mark : [o] --> o nil : [] --> o s : [o] --> o active(fst(0, X)) => mark(nil) active(fst(s(X), cons(Y, Z))) => mark(cons(Y, fst(X, Z))) active(from(X)) => mark(cons(X, from(s(X)))) active(add(0, X)) => mark(X) active(add(s(X), Y)) => mark(s(add(X, Y))) active(len(nil)) => mark(0) active(len(cons(X, Y))) => mark(s(len(Y))) mark(fst(X, Y)) => active(fst(mark(X), mark(Y))) mark(0) => active(0) mark(nil) => active(nil) mark(s(X)) => active(s(X)) mark(cons(X, Y)) => active(cons(mark(X), Y)) mark(from(X)) => active(from(mark(X))) mark(add(X, Y)) => active(add(mark(X), mark(Y))) mark(len(X)) => active(len(mark(X))) fst(mark(X), Y) => fst(X, Y) fst(X, mark(Y)) => fst(X, Y) fst(active(X), Y) => fst(X, Y) fst(X, active(Y)) => fst(X, Y) s(mark(X)) => s(X) s(active(X)) => s(X) cons(mark(X), Y) => cons(X, Y) cons(X, mark(Y)) => cons(X, Y) cons(active(X), Y) => cons(X, Y) cons(X, active(Y)) => cons(X, Y) from(mark(X)) => from(X) from(active(X)) => from(X) add(mark(X), Y) => add(X, Y) add(X, mark(Y)) => add(X, Y) add(active(X), Y) => add(X, Y) add(X, active(Y)) => add(X, Y) len(mark(X)) => len(X) len(active(X)) => len(X) We use the dependency pair framework as described in [Kop12, Ch. 6/7], with static dependency pairs (see [KusIsoSakBla09] and the adaptation for AFSMs in [Kop12, Ch. 7.8]). We thus obtain the following dependency pair problem (P_0, R_0, minimal, formative): Dependency Pairs P_0: 0] active#(fst(0, X)) =#> mark#(nil) 1] active#(fst(s(X), cons(Y, Z))) =#> mark#(cons(Y, fst(X, Z))) 2] active#(fst(s(X), cons(Y, Z))) =#> cons#(Y, fst(X, Z)) 3] active#(fst(s(X), cons(Y, Z))) =#> fst#(X, Z) 4] active#(from(X)) =#> mark#(cons(X, from(s(X)))) 5] active#(from(X)) =#> cons#(X, from(s(X))) 6] active#(from(X)) =#> from#(s(X)) 7] active#(from(X)) =#> s#(X) 8] active#(add(0, X)) =#> mark#(X) 9] active#(add(s(X), Y)) =#> mark#(s(add(X, Y))) 10] active#(add(s(X), Y)) =#> s#(add(X, Y)) 11] active#(add(s(X), Y)) =#> add#(X, Y) 12] active#(len(nil)) =#> mark#(0) 13] active#(len(cons(X, Y))) =#> mark#(s(len(Y))) 14] active#(len(cons(X, Y))) =#> s#(len(Y)) 15] active#(len(cons(X, Y))) =#> len#(Y) 16] mark#(fst(X, Y)) =#> active#(fst(mark(X), mark(Y))) 17] mark#(fst(X, Y)) =#> fst#(mark(X), mark(Y)) 18] mark#(fst(X, Y)) =#> mark#(X) 19] mark#(fst(X, Y)) =#> mark#(Y) 20] mark#(0) =#> active#(0) 21] mark#(nil) =#> active#(nil) 22] mark#(s(X)) =#> active#(s(X)) 23] mark#(s(X)) =#> s#(X) 24] mark#(cons(X, Y)) =#> active#(cons(mark(X), Y)) 25] mark#(cons(X, Y)) =#> cons#(mark(X), Y) 26] mark#(cons(X, Y)) =#> mark#(X) 27] mark#(from(X)) =#> active#(from(mark(X))) 28] mark#(from(X)) =#> from#(mark(X)) 29] mark#(from(X)) =#> mark#(X) 30] mark#(add(X, Y)) =#> active#(add(mark(X), mark(Y))) 31] mark#(add(X, Y)) =#> add#(mark(X), mark(Y)) 32] mark#(add(X, Y)) =#> mark#(X) 33] mark#(add(X, Y)) =#> mark#(Y) 34] mark#(len(X)) =#> active#(len(mark(X))) 35] mark#(len(X)) =#> len#(mark(X)) 36] mark#(len(X)) =#> mark#(X) 37] fst#(mark(X), Y) =#> fst#(X, Y) 38] fst#(X, mark(Y)) =#> fst#(X, Y) 39] fst#(active(X), Y) =#> fst#(X, Y) 40] fst#(X, active(Y)) =#> fst#(X, Y) 41] s#(mark(X)) =#> s#(X) 42] s#(active(X)) =#> s#(X) 43] cons#(mark(X), Y) =#> cons#(X, Y) 44] cons#(X, mark(Y)) =#> cons#(X, Y) 45] cons#(active(X), Y) =#> cons#(X, Y) 46] cons#(X, active(Y)) =#> cons#(X, Y) 47] from#(mark(X)) =#> from#(X) 48] from#(active(X)) =#> from#(X) 49] add#(mark(X), Y) =#> add#(X, Y) 50] add#(X, mark(Y)) =#> add#(X, Y) 51] add#(active(X), Y) =#> add#(X, Y) 52] add#(X, active(Y)) =#> add#(X, Y) 53] len#(mark(X)) =#> len#(X) 54] len#(active(X)) =#> len#(X) Rules R_0: active(fst(0, X)) => mark(nil) active(fst(s(X), cons(Y, Z))) => mark(cons(Y, fst(X, Z))) active(from(X)) => mark(cons(X, from(s(X)))) active(add(0, X)) => mark(X) active(add(s(X), Y)) => mark(s(add(X, Y))) active(len(nil)) => mark(0) active(len(cons(X, Y))) => mark(s(len(Y))) mark(fst(X, Y)) => active(fst(mark(X), mark(Y))) mark(0) => active(0) mark(nil) => active(nil) mark(s(X)) => active(s(X)) mark(cons(X, Y)) => active(cons(mark(X), Y)) mark(from(X)) => active(from(mark(X))) mark(add(X, Y)) => active(add(mark(X), mark(Y))) mark(len(X)) => active(len(mark(X))) fst(mark(X), Y) => fst(X, Y) fst(X, mark(Y)) => fst(X, Y) fst(active(X), Y) => fst(X, Y) fst(X, active(Y)) => fst(X, Y) s(mark(X)) => s(X) s(active(X)) => s(X) cons(mark(X), Y) => cons(X, Y) cons(X, mark(Y)) => cons(X, Y) cons(active(X), Y) => cons(X, Y) cons(X, active(Y)) => cons(X, Y) from(mark(X)) => from(X) from(active(X)) => from(X) add(mark(X), Y) => add(X, Y) add(X, mark(Y)) => add(X, Y) add(active(X), Y) => add(X, Y) add(X, active(Y)) => add(X, Y) len(mark(X)) => len(X) len(active(X)) => len(X) Thus, the original system is terminating if (P_0, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_0, R_0, minimal, formative). We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : 21 * 1 : 24, 25, 26 * 2 : 43, 45 * 3 : 37, 38, 39, 40 * 4 : 24, 25, 26 * 5 : 43, 45 * 6 : * 7 : 41, 42 * 8 : 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 * 9 : 22, 23 * 10 : * 11 : 49, 50, 51, 52 * 12 : 20 * 13 : 22, 23 * 14 : * 15 : 53, 54 * 16 : 0, 1, 2, 3 * 17 : 37, 38, 39, 40 * 18 : 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 * 19 : 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 * 20 : * 21 : * 22 : * 23 : 41, 42 * 24 : * 25 : 43, 44, 45, 46 * 26 : 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 * 27 : 4, 5, 6, 7 * 28 : 47, 48 * 29 : 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 * 30 : 8, 9, 10, 11 * 31 : 49, 50, 51, 52 * 32 : 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 * 33 : 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 * 34 : 12, 13, 14, 15 * 35 : 53, 54 * 36 : 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 * 37 : 37, 38, 39, 40 * 38 : 37, 38, 39, 40 * 39 : 37, 38, 39, 40 * 40 : 37, 38, 39, 40 * 41 : 41, 42 * 42 : 41, 42 * 43 : 43, 44, 45, 46 * 44 : 43, 44, 45, 46 * 45 : 43, 44, 45, 46 * 46 : 43, 44, 45, 46 * 47 : 47, 48 * 48 : 47, 48 * 49 : 49, 50, 51, 52 * 50 : 49, 50, 51, 52 * 51 : 49, 50, 51, 52 * 52 : 49, 50, 51, 52 * 53 : 53, 54 * 54 : 53, 54 This graph has the following strongly connected components: P_1: active#(fst(s(X), cons(Y, Z))) =#> mark#(cons(Y, fst(X, Z))) active#(from(X)) =#> mark#(cons(X, from(s(X)))) active#(add(0, X)) =#> mark#(X) mark#(fst(X, Y)) =#> active#(fst(mark(X), mark(Y))) mark#(fst(X, Y)) =#> mark#(X) mark#(fst(X, Y)) =#> mark#(Y) mark#(cons(X, Y)) =#> mark#(X) mark#(from(X)) =#> active#(from(mark(X))) mark#(from(X)) =#> mark#(X) mark#(add(X, Y)) =#> active#(add(mark(X), mark(Y))) mark#(add(X, Y)) =#> mark#(X) mark#(add(X, Y)) =#> mark#(Y) mark#(len(X)) =#> mark#(X) P_2: fst#(mark(X), Y) =#> fst#(X, Y) fst#(X, mark(Y)) =#> fst#(X, Y) fst#(active(X), Y) =#> fst#(X, Y) fst#(X, active(Y)) =#> fst#(X, Y) P_3: s#(mark(X)) =#> s#(X) s#(active(X)) =#> s#(X) P_4: cons#(mark(X), Y) =#> cons#(X, Y) cons#(X, mark(Y)) =#> cons#(X, Y) cons#(active(X), Y) =#> cons#(X, Y) cons#(X, active(Y)) =#> cons#(X, Y) P_5: from#(mark(X)) =#> from#(X) from#(active(X)) =#> from#(X) P_6: add#(mark(X), Y) =#> add#(X, Y) add#(X, mark(Y)) =#> add#(X, Y) add#(active(X), Y) =#> add#(X, Y) add#(X, active(Y)) =#> add#(X, Y) P_7: len#(mark(X)) =#> len#(X) len#(active(X)) =#> len#(X) By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_0, R_0, m, f) by (P_1, R_0, m, f), (P_2, R_0, m, f), (P_3, R_0, m, f), (P_4, R_0, m, f), (P_5, R_0, m, f), (P_6, R_0, m, f) and (P_7, R_0, m, f). Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative), (P_5, R_0, minimal, formative), (P_6, R_0, minimal, formative) and (P_7, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_7, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(len#) = 1 Thus, we can orient the dependency pairs as follows: nu(len#(mark(X))) = mark(X) |> X = nu(len#(X)) nu(len#(active(X))) = active(X) |> X = nu(len#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_7, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative), (P_5, R_0, minimal, formative) and (P_6, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_6, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(add#) = 1 Thus, we can orient the dependency pairs as follows: nu(add#(mark(X), Y)) = mark(X) |> X = nu(add#(X, Y)) nu(add#(X, mark(Y))) = X = X = nu(add#(X, Y)) nu(add#(active(X), Y)) = active(X) |> X = nu(add#(X, Y)) nu(add#(X, active(Y))) = X = X = nu(add#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_6, R_0, minimal, f) by (P_8, R_0, minimal, f), where P_8 contains: add#(X, mark(Y)) =#> add#(X, Y) add#(X, active(Y)) =#> add#(X, Y) Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative), (P_5, R_0, minimal, formative) and (P_8, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_8, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(add#) = 2 Thus, we can orient the dependency pairs as follows: nu(add#(X, mark(Y))) = mark(Y) |> Y = nu(add#(X, Y)) nu(add#(X, active(Y))) = active(Y) |> Y = nu(add#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_8, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative) and (P_5, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_5, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(from#) = 1 Thus, we can orient the dependency pairs as follows: nu(from#(mark(X))) = mark(X) |> X = nu(from#(X)) nu(from#(active(X))) = active(X) |> X = nu(from#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_5, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative) and (P_4, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_4, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(cons#) = 1 Thus, we can orient the dependency pairs as follows: nu(cons#(mark(X), Y)) = mark(X) |> X = nu(cons#(X, Y)) nu(cons#(X, mark(Y))) = X = X = nu(cons#(X, Y)) nu(cons#(active(X), Y)) = active(X) |> X = nu(cons#(X, Y)) nu(cons#(X, active(Y))) = X = X = nu(cons#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_4, R_0, minimal, f) by (P_9, R_0, minimal, f), where P_9 contains: cons#(X, mark(Y)) =#> cons#(X, Y) cons#(X, active(Y)) =#> cons#(X, Y) Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative) and (P_9, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_9, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(cons#) = 2 Thus, we can orient the dependency pairs as follows: nu(cons#(X, mark(Y))) = mark(Y) |> Y = nu(cons#(X, Y)) nu(cons#(X, active(Y))) = active(Y) |> Y = nu(cons#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_9, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative) and (P_3, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_3, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(s#) = 1 Thus, we can orient the dependency pairs as follows: nu(s#(mark(X))) = mark(X) |> X = nu(s#(X)) nu(s#(active(X))) = active(X) |> X = nu(s#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_3, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative) and (P_2, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_2, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(fst#) = 1 Thus, we can orient the dependency pairs as follows: nu(fst#(mark(X), Y)) = mark(X) |> X = nu(fst#(X, Y)) nu(fst#(X, mark(Y))) = X = X = nu(fst#(X, Y)) nu(fst#(active(X), Y)) = active(X) |> X = nu(fst#(X, Y)) nu(fst#(X, active(Y))) = X = X = nu(fst#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_2, R_0, minimal, f) by (P_10, R_0, minimal, f), where P_10 contains: fst#(X, mark(Y)) =#> fst#(X, Y) fst#(X, active(Y)) =#> fst#(X, Y) Thus, the original system is terminating if each of (P_1, R_0, minimal, formative) and (P_10, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_10, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(fst#) = 2 Thus, we can orient the dependency pairs as follows: nu(fst#(X, mark(Y))) = mark(Y) |> Y = nu(fst#(X, Y)) nu(fst#(X, active(Y))) = active(Y) |> Y = nu(fst#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_10, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if (P_1, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_1, R_0, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: active#(fst(s(X), cons(Y, Z))) >? mark#(cons(Y, fst(X, Z))) active#(from(X)) >? mark#(cons(X, from(s(X)))) active#(add(0, X)) >? mark#(X) mark#(fst(X, Y)) >? active#(fst(mark(X), mark(Y))) mark#(fst(X, Y)) >? mark#(X) mark#(fst(X, Y)) >? mark#(Y) mark#(cons(X, Y)) >? mark#(X) mark#(from(X)) >? active#(from(mark(X))) mark#(from(X)) >? mark#(X) mark#(add(X, Y)) >? active#(add(mark(X), mark(Y))) mark#(add(X, Y)) >? mark#(X) mark#(add(X, Y)) >? mark#(Y) mark#(len(X)) >? mark#(X) active(fst(0, X)) >= mark(nil) active(fst(s(X), cons(Y, Z))) >= mark(cons(Y, fst(X, Z))) active(from(X)) >= mark(cons(X, from(s(X)))) active(add(0, X)) >= mark(X) active(add(s(X), Y)) >= mark(s(add(X, Y))) active(len(nil)) >= mark(0) active(len(cons(X, Y))) >= mark(s(len(Y))) mark(fst(X, Y)) >= active(fst(mark(X), mark(Y))) mark(0) >= active(0) mark(nil) >= active(nil) mark(s(X)) >= active(s(X)) mark(cons(X, Y)) >= active(cons(mark(X), Y)) mark(from(X)) >= active(from(mark(X))) mark(add(X, Y)) >= active(add(mark(X), mark(Y))) mark(len(X)) >= active(len(mark(X))) fst(mark(X), Y) >= fst(X, Y) fst(X, mark(Y)) >= fst(X, Y) fst(active(X), Y) >= fst(X, Y) fst(X, active(Y)) >= fst(X, Y) s(mark(X)) >= s(X) s(active(X)) >= s(X) cons(mark(X), Y) >= cons(X, Y) cons(X, mark(Y)) >= cons(X, Y) cons(active(X), Y) >= cons(X, Y) cons(X, active(Y)) >= cons(X, Y) from(mark(X)) >= from(X) from(active(X)) >= from(X) add(mark(X), Y) >= add(X, Y) add(X, mark(Y)) >= add(X, Y) add(active(X), Y) >= add(X, Y) add(X, active(Y)) >= add(X, Y) len(mark(X)) >= len(X) len(active(X)) >= len(X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 active = \y0.y0 active# = \y0.2y0 add = \y0y1.2y0 + 2y1 cons = \y0y1.y0 from = \y0.2y0 fst = \y0y1.y0 + y1 len = \y0.1 + y0 mark = \y0.y0 mark# = \y0.2y0 nil = 0 s = \y0.0 Using this interpretation, the requirements translate to: [[active#(fst(s(_x0), cons(_x1, _x2)))]] = 2x1 >= 2x1 = [[mark#(cons(_x1, fst(_x0, _x2)))]] [[active#(from(_x0))]] = 4x0 >= 2x0 = [[mark#(cons(_x0, from(s(_x0))))]] [[active#(add(0, _x0))]] = 4x0 >= 2x0 = [[mark#(_x0)]] [[mark#(fst(_x0, _x1))]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[active#(fst(mark(_x0), mark(_x1)))]] [[mark#(fst(_x0, _x1))]] = 2x0 + 2x1 >= 2x0 = [[mark#(_x0)]] [[mark#(fst(_x0, _x1))]] = 2x0 + 2x1 >= 2x1 = [[mark#(_x1)]] [[mark#(cons(_x0, _x1))]] = 2x0 >= 2x0 = [[mark#(_x0)]] [[mark#(from(_x0))]] = 4x0 >= 4x0 = [[active#(from(mark(_x0)))]] [[mark#(from(_x0))]] = 4x0 >= 2x0 = [[mark#(_x0)]] [[mark#(add(_x0, _x1))]] = 4x0 + 4x1 >= 4x0 + 4x1 = [[active#(add(mark(_x0), mark(_x1)))]] [[mark#(add(_x0, _x1))]] = 4x0 + 4x1 >= 2x0 = [[mark#(_x0)]] [[mark#(add(_x0, _x1))]] = 4x0 + 4x1 >= 2x1 = [[mark#(_x1)]] [[mark#(len(_x0))]] = 2 + 2x0 > 2x0 = [[mark#(_x0)]] [[active(fst(0, _x0))]] = x0 >= 0 = [[mark(nil)]] [[active(fst(s(_x0), cons(_x1, _x2)))]] = x1 >= x1 = [[mark(cons(_x1, fst(_x0, _x2)))]] [[active(from(_x0))]] = 2x0 >= x0 = [[mark(cons(_x0, from(s(_x0))))]] [[active(add(0, _x0))]] = 2x0 >= x0 = [[mark(_x0)]] [[active(add(s(_x0), _x1))]] = 2x1 >= 0 = [[mark(s(add(_x0, _x1)))]] [[active(len(nil))]] = 1 >= 0 = [[mark(0)]] [[active(len(cons(_x0, _x1)))]] = 1 + x0 >= 0 = [[mark(s(len(_x1)))]] [[mark(fst(_x0, _x1))]] = x0 + x1 >= x0 + x1 = [[active(fst(mark(_x0), mark(_x1)))]] [[mark(0)]] = 0 >= 0 = [[active(0)]] [[mark(nil)]] = 0 >= 0 = [[active(nil)]] [[mark(s(_x0))]] = 0 >= 0 = [[active(s(_x0))]] [[mark(cons(_x0, _x1))]] = x0 >= x0 = [[active(cons(mark(_x0), _x1))]] [[mark(from(_x0))]] = 2x0 >= 2x0 = [[active(from(mark(_x0)))]] [[mark(add(_x0, _x1))]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[active(add(mark(_x0), mark(_x1)))]] [[mark(len(_x0))]] = 1 + x0 >= 1 + x0 = [[active(len(mark(_x0)))]] [[fst(mark(_x0), _x1)]] = x0 + x1 >= x0 + x1 = [[fst(_x0, _x1)]] [[fst(_x0, mark(_x1))]] = x0 + x1 >= x0 + x1 = [[fst(_x0, _x1)]] [[fst(active(_x0), _x1)]] = x0 + x1 >= x0 + x1 = [[fst(_x0, _x1)]] [[fst(_x0, active(_x1))]] = x0 + x1 >= x0 + x1 = [[fst(_x0, _x1)]] [[s(mark(_x0))]] = 0 >= 0 = [[s(_x0)]] [[s(active(_x0))]] = 0 >= 0 = [[s(_x0)]] [[cons(mark(_x0), _x1)]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(_x0, mark(_x1))]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(active(_x0), _x1)]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(_x0, active(_x1))]] = x0 >= x0 = [[cons(_x0, _x1)]] [[from(mark(_x0))]] = 2x0 >= 2x0 = [[from(_x0)]] [[from(active(_x0))]] = 2x0 >= 2x0 = [[from(_x0)]] [[add(mark(_x0), _x1)]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[add(_x0, _x1)]] [[add(_x0, mark(_x1))]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[add(_x0, _x1)]] [[add(active(_x0), _x1)]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[add(_x0, _x1)]] [[add(_x0, active(_x1))]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[add(_x0, _x1)]] [[len(mark(_x0))]] = 1 + x0 >= 1 + x0 = [[len(_x0)]] [[len(active(_x0))]] = 1 + x0 >= 1 + x0 = [[len(_x0)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_1, R_0, minimal, formative) by (P_11, R_0, minimal, formative), where P_11 consists of: active#(fst(s(X), cons(Y, Z))) =#> mark#(cons(Y, fst(X, Z))) active#(from(X)) =#> mark#(cons(X, from(s(X)))) active#(add(0, X)) =#> mark#(X) mark#(fst(X, Y)) =#> active#(fst(mark(X), mark(Y))) mark#(fst(X, Y)) =#> mark#(X) mark#(fst(X, Y)) =#> mark#(Y) mark#(cons(X, Y)) =#> mark#(X) mark#(from(X)) =#> active#(from(mark(X))) mark#(from(X)) =#> mark#(X) mark#(add(X, Y)) =#> active#(add(mark(X), mark(Y))) mark#(add(X, Y)) =#> mark#(X) mark#(add(X, Y)) =#> mark#(Y) Thus, the original system is terminating if (P_11, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_11, R_0, minimal, formative). The formative rules of (P_11, R_0) are R_1 ::= active(fst(0, X)) => mark(nil) active(fst(s(X), cons(Y, Z))) => mark(cons(Y, fst(X, Z))) active(from(X)) => mark(cons(X, from(s(X)))) active(add(0, X)) => mark(X) active(add(s(X), Y)) => mark(s(add(X, Y))) active(len(nil)) => mark(0) active(len(cons(X, Y))) => mark(s(len(Y))) mark(fst(X, Y)) => active(fst(mark(X), mark(Y))) mark(0) => active(0) mark(nil) => active(nil) mark(s(X)) => active(s(X)) mark(cons(X, Y)) => active(cons(mark(X), Y)) mark(from(X)) => active(from(mark(X))) mark(add(X, Y)) => active(add(mark(X), mark(Y))) mark(len(X)) => active(len(mark(X))) fst(mark(X), Y) => fst(X, Y) fst(X, mark(Y)) => fst(X, Y) fst(active(X), Y) => fst(X, Y) fst(X, active(Y)) => fst(X, Y) s(mark(X)) => s(X) s(active(X)) => s(X) cons(mark(X), Y) => cons(X, Y) cons(X, mark(Y)) => cons(X, Y) cons(active(X), Y) => cons(X, Y) cons(X, active(Y)) => cons(X, Y) from(mark(X)) => from(X) from(active(X)) => from(X) add(mark(X), Y) => add(X, Y) add(X, mark(Y)) => add(X, Y) add(active(X), Y) => add(X, Y) add(X, active(Y)) => add(X, Y) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_11, R_0, minimal, formative) by (P_11, R_1, minimal, formative). Thus, the original system is terminating if (P_11, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_11, R_1, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: active#(fst(s(X), cons(Y, Z))) >? mark#(cons(Y, fst(X, Z))) active#(from(X)) >? mark#(cons(X, from(s(X)))) active#(add(0, X)) >? mark#(X) mark#(fst(X, Y)) >? active#(fst(mark(X), mark(Y))) mark#(fst(X, Y)) >? mark#(X) mark#(fst(X, Y)) >? mark#(Y) mark#(cons(X, Y)) >? mark#(X) mark#(from(X)) >? active#(from(mark(X))) mark#(from(X)) >? mark#(X) mark#(add(X, Y)) >? active#(add(mark(X), mark(Y))) mark#(add(X, Y)) >? mark#(X) mark#(add(X, Y)) >? mark#(Y) active(fst(0, X)) >= mark(nil) active(fst(s(X), cons(Y, Z))) >= mark(cons(Y, fst(X, Z))) active(from(X)) >= mark(cons(X, from(s(X)))) active(add(0, X)) >= mark(X) active(add(s(X), Y)) >= mark(s(add(X, Y))) active(len(nil)) >= mark(0) active(len(cons(X, Y))) >= mark(s(len(Y))) mark(fst(X, Y)) >= active(fst(mark(X), mark(Y))) mark(0) >= active(0) mark(nil) >= active(nil) mark(s(X)) >= active(s(X)) mark(cons(X, Y)) >= active(cons(mark(X), Y)) mark(from(X)) >= active(from(mark(X))) mark(add(X, Y)) >= active(add(mark(X), mark(Y))) mark(len(X)) >= active(len(mark(X))) fst(mark(X), Y) >= fst(X, Y) fst(X, mark(Y)) >= fst(X, Y) fst(active(X), Y) >= fst(X, Y) fst(X, active(Y)) >= fst(X, Y) s(mark(X)) >= s(X) s(active(X)) >= s(X) cons(mark(X), Y) >= cons(X, Y) cons(X, mark(Y)) >= cons(X, Y) cons(active(X), Y) >= cons(X, Y) cons(X, active(Y)) >= cons(X, Y) from(mark(X)) >= from(X) from(active(X)) >= from(X) add(mark(X), Y) >= add(X, Y) add(X, mark(Y)) >= add(X, Y) add(active(X), Y) >= add(X, Y) add(X, active(Y)) >= add(X, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 active = \y0.y0 active# = \y0.y0 add = \y0y1.y0 + y1 cons = \y0y1.y0 from = \y0.2y0 fst = \y0y1.1 + 2y0 + 2y1 len = \y0.0 mark = \y0.y0 mark# = \y0.y0 nil = 0 s = \y0.0 Using this interpretation, the requirements translate to: [[active#(fst(s(_x0), cons(_x1, _x2)))]] = 1 + 2x1 > x1 = [[mark#(cons(_x1, fst(_x0, _x2)))]] [[active#(from(_x0))]] = 2x0 >= x0 = [[mark#(cons(_x0, from(s(_x0))))]] [[active#(add(0, _x0))]] = x0 >= x0 = [[mark#(_x0)]] [[mark#(fst(_x0, _x1))]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[active#(fst(mark(_x0), mark(_x1)))]] [[mark#(fst(_x0, _x1))]] = 1 + 2x0 + 2x1 > x0 = [[mark#(_x0)]] [[mark#(fst(_x0, _x1))]] = 1 + 2x0 + 2x1 > x1 = [[mark#(_x1)]] [[mark#(cons(_x0, _x1))]] = x0 >= x0 = [[mark#(_x0)]] [[mark#(from(_x0))]] = 2x0 >= 2x0 = [[active#(from(mark(_x0)))]] [[mark#(from(_x0))]] = 2x0 >= x0 = [[mark#(_x0)]] [[mark#(add(_x0, _x1))]] = x0 + x1 >= x0 + x1 = [[active#(add(mark(_x0), mark(_x1)))]] [[mark#(add(_x0, _x1))]] = x0 + x1 >= x0 = [[mark#(_x0)]] [[mark#(add(_x0, _x1))]] = x0 + x1 >= x1 = [[mark#(_x1)]] [[active(fst(0, _x0))]] = 1 + 2x0 >= 0 = [[mark(nil)]] [[active(fst(s(_x0), cons(_x1, _x2)))]] = 1 + 2x1 >= x1 = [[mark(cons(_x1, fst(_x0, _x2)))]] [[active(from(_x0))]] = 2x0 >= x0 = [[mark(cons(_x0, from(s(_x0))))]] [[active(add(0, _x0))]] = x0 >= x0 = [[mark(_x0)]] [[active(add(s(_x0), _x1))]] = x1 >= 0 = [[mark(s(add(_x0, _x1)))]] [[active(len(nil))]] = 0 >= 0 = [[mark(0)]] [[active(len(cons(_x0, _x1)))]] = 0 >= 0 = [[mark(s(len(_x1)))]] [[mark(fst(_x0, _x1))]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[active(fst(mark(_x0), mark(_x1)))]] [[mark(0)]] = 0 >= 0 = [[active(0)]] [[mark(nil)]] = 0 >= 0 = [[active(nil)]] [[mark(s(_x0))]] = 0 >= 0 = [[active(s(_x0))]] [[mark(cons(_x0, _x1))]] = x0 >= x0 = [[active(cons(mark(_x0), _x1))]] [[mark(from(_x0))]] = 2x0 >= 2x0 = [[active(from(mark(_x0)))]] [[mark(add(_x0, _x1))]] = x0 + x1 >= x0 + x1 = [[active(add(mark(_x0), mark(_x1)))]] [[mark(len(_x0))]] = 0 >= 0 = [[active(len(mark(_x0)))]] [[fst(mark(_x0), _x1)]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[fst(_x0, _x1)]] [[fst(_x0, mark(_x1))]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[fst(_x0, _x1)]] [[fst(active(_x0), _x1)]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[fst(_x0, _x1)]] [[fst(_x0, active(_x1))]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[fst(_x0, _x1)]] [[s(mark(_x0))]] = 0 >= 0 = [[s(_x0)]] [[s(active(_x0))]] = 0 >= 0 = [[s(_x0)]] [[cons(mark(_x0), _x1)]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(_x0, mark(_x1))]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(active(_x0), _x1)]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(_x0, active(_x1))]] = x0 >= x0 = [[cons(_x0, _x1)]] [[from(mark(_x0))]] = 2x0 >= 2x0 = [[from(_x0)]] [[from(active(_x0))]] = 2x0 >= 2x0 = [[from(_x0)]] [[add(mark(_x0), _x1)]] = x0 + x1 >= x0 + x1 = [[add(_x0, _x1)]] [[add(_x0, mark(_x1))]] = x0 + x1 >= x0 + x1 = [[add(_x0, _x1)]] [[add(active(_x0), _x1)]] = x0 + x1 >= x0 + x1 = [[add(_x0, _x1)]] [[add(_x0, active(_x1))]] = x0 + x1 >= x0 + x1 = [[add(_x0, _x1)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_11, R_1, minimal, formative) by (P_12, R_1, minimal, formative), where P_12 consists of: active#(from(X)) =#> mark#(cons(X, from(s(X)))) active#(add(0, X)) =#> mark#(X) mark#(fst(X, Y)) =#> active#(fst(mark(X), mark(Y))) mark#(cons(X, Y)) =#> mark#(X) mark#(from(X)) =#> active#(from(mark(X))) mark#(from(X)) =#> mark#(X) mark#(add(X, Y)) =#> active#(add(mark(X), mark(Y))) mark#(add(X, Y)) =#> mark#(X) mark#(add(X, Y)) =#> mark#(Y) Thus, the original system is terminating if (P_12, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_12, R_1, minimal, formative). We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : 3 * 1 : 2, 3, 4, 5, 6, 7, 8 * 2 : * 3 : 2, 3, 4, 5, 6, 7, 8 * 4 : 0 * 5 : 2, 3, 4, 5, 6, 7, 8 * 6 : 1 * 7 : 2, 3, 4, 5, 6, 7, 8 * 8 : 2, 3, 4, 5, 6, 7, 8 This graph has the following strongly connected components: P_13: active#(from(X)) =#> mark#(cons(X, from(s(X)))) active#(add(0, X)) =#> mark#(X) mark#(cons(X, Y)) =#> mark#(X) mark#(from(X)) =#> active#(from(mark(X))) mark#(from(X)) =#> mark#(X) mark#(add(X, Y)) =#> active#(add(mark(X), mark(Y))) mark#(add(X, Y)) =#> mark#(X) mark#(add(X, Y)) =#> mark#(Y) By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_12, R_1, m, f) by (P_13, R_1, m, f). Thus, the original system is terminating if (P_13, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_13, R_1, minimal, formative). The formative rules of (P_13, R_1) are R_2 ::= active(fst(0, X)) => mark(nil) active(fst(s(X), cons(Y, Z))) => mark(cons(Y, fst(X, Z))) active(from(X)) => mark(cons(X, from(s(X)))) active(add(0, X)) => mark(X) active(add(s(X), Y)) => mark(s(add(X, Y))) active(len(nil)) => mark(0) active(len(cons(X, Y))) => mark(s(len(Y))) mark(fst(X, Y)) => active(fst(mark(X), mark(Y))) mark(0) => active(0) mark(nil) => active(nil) mark(s(X)) => active(s(X)) mark(cons(X, Y)) => active(cons(mark(X), Y)) mark(from(X)) => active(from(mark(X))) mark(add(X, Y)) => active(add(mark(X), mark(Y))) mark(len(X)) => active(len(mark(X))) cons(mark(X), Y) => cons(X, Y) cons(X, mark(Y)) => cons(X, Y) cons(active(X), Y) => cons(X, Y) cons(X, active(Y)) => cons(X, Y) from(mark(X)) => from(X) from(active(X)) => from(X) add(mark(X), Y) => add(X, Y) add(X, mark(Y)) => add(X, Y) add(active(X), Y) => add(X, Y) add(X, active(Y)) => add(X, Y) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_13, R_1, minimal, formative) by (P_13, R_2, minimal, formative). Thus, the original system is terminating if (P_13, R_2, minimal, formative) is finite. We consider the dependency pair problem (P_13, R_2, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: active#(from(X)) >? mark#(cons(X, from(s(X)))) active#(add(0, X)) >? mark#(X) mark#(cons(X, Y)) >? mark#(X) mark#(from(X)) >? active#(from(mark(X))) mark#(from(X)) >? mark#(X) mark#(add(X, Y)) >? active#(add(mark(X), mark(Y))) mark#(add(X, Y)) >? mark#(X) mark#(add(X, Y)) >? mark#(Y) active(fst(0, X)) >= mark(nil) active(fst(s(X), cons(Y, Z))) >= mark(cons(Y, fst(X, Z))) active(from(X)) >= mark(cons(X, from(s(X)))) active(add(0, X)) >= mark(X) active(add(s(X), Y)) >= mark(s(add(X, Y))) active(len(nil)) >= mark(0) active(len(cons(X, Y))) >= mark(s(len(Y))) mark(fst(X, Y)) >= active(fst(mark(X), mark(Y))) mark(0) >= active(0) mark(nil) >= active(nil) mark(s(X)) >= active(s(X)) mark(cons(X, Y)) >= active(cons(mark(X), Y)) mark(from(X)) >= active(from(mark(X))) mark(add(X, Y)) >= active(add(mark(X), mark(Y))) mark(len(X)) >= active(len(mark(X))) cons(mark(X), Y) >= cons(X, Y) cons(X, mark(Y)) >= cons(X, Y) cons(active(X), Y) >= cons(X, Y) cons(X, active(Y)) >= cons(X, Y) from(mark(X)) >= from(X) from(active(X)) >= from(X) add(mark(X), Y) >= add(X, Y) add(X, mark(Y)) >= add(X, Y) add(active(X), Y) >= add(X, Y) add(X, active(Y)) >= add(X, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 active = \y0.y0 active# = \y0.y0 add = \y0y1.1 + y0 + y1 cons = \y0y1.2y0 from = \y0.2y0 fst = \y0y1.2y1 len = \y0.0 mark = \y0.y0 mark# = \y0.y0 nil = 0 s = \y0.0 Using this interpretation, the requirements translate to: [[active#(from(_x0))]] = 2x0 >= 2x0 = [[mark#(cons(_x0, from(s(_x0))))]] [[active#(add(0, _x0))]] = 1 + x0 > x0 = [[mark#(_x0)]] [[mark#(cons(_x0, _x1))]] = 2x0 >= x0 = [[mark#(_x0)]] [[mark#(from(_x0))]] = 2x0 >= 2x0 = [[active#(from(mark(_x0)))]] [[mark#(from(_x0))]] = 2x0 >= x0 = [[mark#(_x0)]] [[mark#(add(_x0, _x1))]] = 1 + x0 + x1 >= 1 + x0 + x1 = [[active#(add(mark(_x0), mark(_x1)))]] [[mark#(add(_x0, _x1))]] = 1 + x0 + x1 > x0 = [[mark#(_x0)]] [[mark#(add(_x0, _x1))]] = 1 + x0 + x1 > x1 = [[mark#(_x1)]] [[active(fst(0, _x0))]] = 2x0 >= 0 = [[mark(nil)]] [[active(fst(s(_x0), cons(_x1, _x2)))]] = 4x1 >= 2x1 = [[mark(cons(_x1, fst(_x0, _x2)))]] [[active(from(_x0))]] = 2x0 >= 2x0 = [[mark(cons(_x0, from(s(_x0))))]] [[active(add(0, _x0))]] = 1 + x0 >= x0 = [[mark(_x0)]] [[active(add(s(_x0), _x1))]] = 1 + x1 >= 0 = [[mark(s(add(_x0, _x1)))]] [[active(len(nil))]] = 0 >= 0 = [[mark(0)]] [[active(len(cons(_x0, _x1)))]] = 0 >= 0 = [[mark(s(len(_x1)))]] [[mark(fst(_x0, _x1))]] = 2x1 >= 2x1 = [[active(fst(mark(_x0), mark(_x1)))]] [[mark(0)]] = 0 >= 0 = [[active(0)]] [[mark(nil)]] = 0 >= 0 = [[active(nil)]] [[mark(s(_x0))]] = 0 >= 0 = [[active(s(_x0))]] [[mark(cons(_x0, _x1))]] = 2x0 >= 2x0 = [[active(cons(mark(_x0), _x1))]] [[mark(from(_x0))]] = 2x0 >= 2x0 = [[active(from(mark(_x0)))]] [[mark(add(_x0, _x1))]] = 1 + x0 + x1 >= 1 + x0 + x1 = [[active(add(mark(_x0), mark(_x1)))]] [[mark(len(_x0))]] = 0 >= 0 = [[active(len(mark(_x0)))]] [[cons(mark(_x0), _x1)]] = 2x0 >= 2x0 = [[cons(_x0, _x1)]] [[cons(_x0, mark(_x1))]] = 2x0 >= 2x0 = [[cons(_x0, _x1)]] [[cons(active(_x0), _x1)]] = 2x0 >= 2x0 = [[cons(_x0, _x1)]] [[cons(_x0, active(_x1))]] = 2x0 >= 2x0 = [[cons(_x0, _x1)]] [[from(mark(_x0))]] = 2x0 >= 2x0 = [[from(_x0)]] [[from(active(_x0))]] = 2x0 >= 2x0 = [[from(_x0)]] [[add(mark(_x0), _x1)]] = 1 + x0 + x1 >= 1 + x0 + x1 = [[add(_x0, _x1)]] [[add(_x0, mark(_x1))]] = 1 + x0 + x1 >= 1 + x0 + x1 = [[add(_x0, _x1)]] [[add(active(_x0), _x1)]] = 1 + x0 + x1 >= 1 + x0 + x1 = [[add(_x0, _x1)]] [[add(_x0, active(_x1))]] = 1 + x0 + x1 >= 1 + x0 + x1 = [[add(_x0, _x1)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_13, R_2, minimal, formative) by (P_14, R_2, minimal, formative), where P_14 consists of: active#(from(X)) =#> mark#(cons(X, from(s(X)))) mark#(cons(X, Y)) =#> mark#(X) mark#(from(X)) =#> active#(from(mark(X))) mark#(from(X)) =#> mark#(X) mark#(add(X, Y)) =#> active#(add(mark(X), mark(Y))) Thus, the original system is terminating if (P_14, R_2, minimal, formative) is finite. We consider the dependency pair problem (P_14, R_2, minimal, formative). We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : 1 * 1 : 1, 2, 3, 4 * 2 : 0 * 3 : 1, 2, 3, 4 * 4 : This graph has the following strongly connected components: P_15: active#(from(X)) =#> mark#(cons(X, from(s(X)))) mark#(cons(X, Y)) =#> mark#(X) mark#(from(X)) =#> active#(from(mark(X))) mark#(from(X)) =#> mark#(X) By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_14, R_2, m, f) by (P_15, R_2, m, f). Thus, the original system is terminating if (P_15, R_2, minimal, formative) is finite. We consider the dependency pair problem (P_15, R_2, minimal, formative). The formative rules of (P_15, R_2) are R_3 ::= active(fst(0, X)) => mark(nil) active(fst(s(X), cons(Y, Z))) => mark(cons(Y, fst(X, Z))) active(from(X)) => mark(cons(X, from(s(X)))) active(add(0, X)) => mark(X) active(add(s(X), Y)) => mark(s(add(X, Y))) active(len(nil)) => mark(0) active(len(cons(X, Y))) => mark(s(len(Y))) mark(fst(X, Y)) => active(fst(mark(X), mark(Y))) mark(0) => active(0) mark(nil) => active(nil) mark(s(X)) => active(s(X)) mark(cons(X, Y)) => active(cons(mark(X), Y)) mark(from(X)) => active(from(mark(X))) mark(add(X, Y)) => active(add(mark(X), mark(Y))) mark(len(X)) => active(len(mark(X))) cons(mark(X), Y) => cons(X, Y) cons(X, mark(Y)) => cons(X, Y) cons(active(X), Y) => cons(X, Y) cons(X, active(Y)) => cons(X, Y) from(mark(X)) => from(X) from(active(X)) => from(X) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_15, R_2, minimal, formative) by (P_15, R_3, minimal, formative). Thus, the original system is terminating if (P_15, R_3, minimal, formative) is finite. We consider the dependency pair problem (P_15, R_3, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: active#(from(X)) >? mark#(cons(X, from(s(X)))) mark#(cons(X, Y)) >? mark#(X) mark#(from(X)) >? active#(from(mark(X))) mark#(from(X)) >? mark#(X) active(fst(0, X)) >= mark(nil) active(fst(s(X), cons(Y, Z))) >= mark(cons(Y, fst(X, Z))) active(from(X)) >= mark(cons(X, from(s(X)))) active(add(0, X)) >= mark(X) active(add(s(X), Y)) >= mark(s(add(X, Y))) active(len(nil)) >= mark(0) active(len(cons(X, Y))) >= mark(s(len(Y))) mark(fst(X, Y)) >= active(fst(mark(X), mark(Y))) mark(0) >= active(0) mark(nil) >= active(nil) mark(s(X)) >= active(s(X)) mark(cons(X, Y)) >= active(cons(mark(X), Y)) mark(from(X)) >= active(from(mark(X))) mark(add(X, Y)) >= active(add(mark(X), mark(Y))) mark(len(X)) >= active(len(mark(X))) cons(mark(X), Y) >= cons(X, Y) cons(X, mark(Y)) >= cons(X, Y) cons(active(X), Y) >= cons(X, Y) cons(X, active(Y)) >= cons(X, Y) from(mark(X)) >= from(X) from(active(X)) >= from(X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 active = \y0.y0 active# = \y0.y0 add = \y0y1.y1 cons = \y0y1.y0 from = \y0.1 + 2y0 fst = \y0y1.2 + y1 len = \y0.2 + 3y0 mark = \y0.y0 mark# = \y0.y0 nil = 2 s = \y0.0 Using this interpretation, the requirements translate to: [[active#(from(_x0))]] = 1 + 2x0 > x0 = [[mark#(cons(_x0, from(s(_x0))))]] [[mark#(cons(_x0, _x1))]] = x0 >= x0 = [[mark#(_x0)]] [[mark#(from(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[active#(from(mark(_x0)))]] [[mark#(from(_x0))]] = 1 + 2x0 > x0 = [[mark#(_x0)]] [[active(fst(0, _x0))]] = 2 + x0 >= 2 = [[mark(nil)]] [[active(fst(s(_x0), cons(_x1, _x2)))]] = 2 + x1 >= x1 = [[mark(cons(_x1, fst(_x0, _x2)))]] [[active(from(_x0))]] = 1 + 2x0 >= x0 = [[mark(cons(_x0, from(s(_x0))))]] [[active(add(0, _x0))]] = x0 >= x0 = [[mark(_x0)]] [[active(add(s(_x0), _x1))]] = x1 >= 0 = [[mark(s(add(_x0, _x1)))]] [[active(len(nil))]] = 8 >= 0 = [[mark(0)]] [[active(len(cons(_x0, _x1)))]] = 2 + 3x0 >= 0 = [[mark(s(len(_x1)))]] [[mark(fst(_x0, _x1))]] = 2 + x1 >= 2 + x1 = [[active(fst(mark(_x0), mark(_x1)))]] [[mark(0)]] = 0 >= 0 = [[active(0)]] [[mark(nil)]] = 2 >= 2 = [[active(nil)]] [[mark(s(_x0))]] = 0 >= 0 = [[active(s(_x0))]] [[mark(cons(_x0, _x1))]] = x0 >= x0 = [[active(cons(mark(_x0), _x1))]] [[mark(from(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[active(from(mark(_x0)))]] [[mark(add(_x0, _x1))]] = x1 >= x1 = [[active(add(mark(_x0), mark(_x1)))]] [[mark(len(_x0))]] = 2 + 3x0 >= 2 + 3x0 = [[active(len(mark(_x0)))]] [[cons(mark(_x0), _x1)]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(_x0, mark(_x1))]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(active(_x0), _x1)]] = x0 >= x0 = [[cons(_x0, _x1)]] [[cons(_x0, active(_x1))]] = x0 >= x0 = [[cons(_x0, _x1)]] [[from(mark(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[from(_x0)]] [[from(active(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[from(_x0)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_15, R_3, minimal, formative) by (P_16, R_3, minimal, formative), where P_16 consists of: mark#(cons(X, Y)) =#> mark#(X) mark#(from(X)) =#> active#(from(mark(X))) Thus, the original system is terminating if (P_16, R_3, minimal, formative) is finite. We consider the dependency pair problem (P_16, R_3, minimal, formative). We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : 0, 1 * 1 : This graph has the following strongly connected components: P_17: mark#(cons(X, Y)) =#> mark#(X) By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_16, R_3, m, f) by (P_17, R_3, m, f). Thus, the original system is terminating if (P_17, R_3, minimal, formative) is finite. We consider the dependency pair problem (P_17, R_3, minimal, formative). We apply the subterm criterion with the following projection function: nu(mark#) = 1 Thus, we can orient the dependency pairs as follows: nu(mark#(cons(X, Y))) = cons(X, Y) |> X = nu(mark#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_17, R_3, minimal, f) by ({}, R_3, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. As all dependency pair problems were succesfully simplified with sound (and complete) processors until nothing remained, we conclude termination. +++ Citations +++ [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. [KusIsoSakBla09] K. Kusakari, Y. Isogai, M. Sakai, and F. Blanqui. Static Dependency Pair Method Based On Strong Computability for Higher-Order Rewrite Systems. In volume 92(10) of IEICE Transactions on Information and Systems. 2007--2015, 2009.