/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 cons : [o * o] --> o filter : [o * o * o] --> o mark : [o] --> o nats : [o] --> o ok : [o] --> o proper : [o] --> o s : [o] --> o sieve : [o] --> o top : [o] --> o zprimes : [] --> o active(filter(cons(X, Y), 0, Z)) => mark(cons(0, filter(Y, Z, Z))) active(filter(cons(X, Y), s(Z), U)) => mark(cons(X, filter(Y, Z, U))) active(sieve(cons(0, X))) => mark(cons(0, sieve(X))) active(sieve(cons(s(X), Y))) => mark(cons(s(X), sieve(filter(Y, X, X)))) active(nats(X)) => mark(cons(X, nats(s(X)))) active(zprimes) => mark(sieve(nats(s(s(0))))) active(filter(X, Y, Z)) => filter(active(X), Y, Z) active(filter(X, Y, Z)) => filter(X, active(Y), Z) active(filter(X, Y, Z)) => filter(X, Y, active(Z)) active(cons(X, Y)) => cons(active(X), Y) active(s(X)) => s(active(X)) active(sieve(X)) => sieve(active(X)) active(nats(X)) => nats(active(X)) filter(mark(X), Y, Z) => mark(filter(X, Y, Z)) filter(X, mark(Y), Z) => mark(filter(X, Y, Z)) filter(X, Y, mark(Z)) => mark(filter(X, Y, Z)) cons(mark(X), Y) => mark(cons(X, Y)) s(mark(X)) => mark(s(X)) sieve(mark(X)) => mark(sieve(X)) nats(mark(X)) => mark(nats(X)) proper(filter(X, Y, Z)) => filter(proper(X), proper(Y), proper(Z)) proper(cons(X, Y)) => cons(proper(X), proper(Y)) proper(0) => ok(0) proper(s(X)) => s(proper(X)) proper(sieve(X)) => sieve(proper(X)) proper(nats(X)) => nats(proper(X)) proper(zprimes) => ok(zprimes) filter(ok(X), ok(Y), ok(Z)) => ok(filter(X, Y, Z)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) s(ok(X)) => ok(s(X)) sieve(ok(X)) => ok(sieve(X)) nats(ok(X)) => ok(nats(X)) top(mark(X)) => top(proper(X)) top(ok(X)) => top(active(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#(filter(cons(X, Y), 0, Z)) =#> cons#(0, filter(Y, Z, Z)) 1] active#(filter(cons(X, Y), 0, Z)) =#> filter#(Y, Z, Z) 2] active#(filter(cons(X, Y), s(Z), U)) =#> cons#(X, filter(Y, Z, U)) 3] active#(filter(cons(X, Y), s(Z), U)) =#> filter#(Y, Z, U) 4] active#(sieve(cons(0, X))) =#> cons#(0, sieve(X)) 5] active#(sieve(cons(0, X))) =#> sieve#(X) 6] active#(sieve(cons(s(X), Y))) =#> cons#(s(X), sieve(filter(Y, X, X))) 7] active#(sieve(cons(s(X), Y))) =#> s#(X) 8] active#(sieve(cons(s(X), Y))) =#> sieve#(filter(Y, X, X)) 9] active#(sieve(cons(s(X), Y))) =#> filter#(Y, X, X) 10] active#(nats(X)) =#> cons#(X, nats(s(X))) 11] active#(nats(X)) =#> nats#(s(X)) 12] active#(nats(X)) =#> s#(X) 13] active#(zprimes) =#> sieve#(nats(s(s(0)))) 14] active#(zprimes) =#> nats#(s(s(0))) 15] active#(zprimes) =#> s#(s(0)) 16] active#(zprimes) =#> s#(0) 17] active#(filter(X, Y, Z)) =#> filter#(active(X), Y, Z) 18] active#(filter(X, Y, Z)) =#> active#(X) 19] active#(filter(X, Y, Z)) =#> filter#(X, active(Y), Z) 20] active#(filter(X, Y, Z)) =#> active#(Y) 21] active#(filter(X, Y, Z)) =#> filter#(X, Y, active(Z)) 22] active#(filter(X, Y, Z)) =#> active#(Z) 23] active#(cons(X, Y)) =#> cons#(active(X), Y) 24] active#(cons(X, Y)) =#> active#(X) 25] active#(s(X)) =#> s#(active(X)) 26] active#(s(X)) =#> active#(X) 27] active#(sieve(X)) =#> sieve#(active(X)) 28] active#(sieve(X)) =#> active#(X) 29] active#(nats(X)) =#> nats#(active(X)) 30] active#(nats(X)) =#> active#(X) 31] filter#(mark(X), Y, Z) =#> filter#(X, Y, Z) 32] filter#(X, mark(Y), Z) =#> filter#(X, Y, Z) 33] filter#(X, Y, mark(Z)) =#> filter#(X, Y, Z) 34] cons#(mark(X), Y) =#> cons#(X, Y) 35] s#(mark(X)) =#> s#(X) 36] sieve#(mark(X)) =#> sieve#(X) 37] nats#(mark(X)) =#> nats#(X) 38] proper#(filter(X, Y, Z)) =#> filter#(proper(X), proper(Y), proper(Z)) 39] proper#(filter(X, Y, Z)) =#> proper#(X) 40] proper#(filter(X, Y, Z)) =#> proper#(Y) 41] proper#(filter(X, Y, Z)) =#> proper#(Z) 42] proper#(cons(X, Y)) =#> cons#(proper(X), proper(Y)) 43] proper#(cons(X, Y)) =#> proper#(X) 44] proper#(cons(X, Y)) =#> proper#(Y) 45] proper#(s(X)) =#> s#(proper(X)) 46] proper#(s(X)) =#> proper#(X) 47] proper#(sieve(X)) =#> sieve#(proper(X)) 48] proper#(sieve(X)) =#> proper#(X) 49] proper#(nats(X)) =#> nats#(proper(X)) 50] proper#(nats(X)) =#> proper#(X) 51] filter#(ok(X), ok(Y), ok(Z)) =#> filter#(X, Y, Z) 52] cons#(ok(X), ok(Y)) =#> cons#(X, Y) 53] s#(ok(X)) =#> s#(X) 54] sieve#(ok(X)) =#> sieve#(X) 55] nats#(ok(X)) =#> nats#(X) 56] top#(mark(X)) =#> top#(proper(X)) 57] top#(mark(X)) =#> proper#(X) 58] top#(ok(X)) =#> top#(active(X)) 59] top#(ok(X)) =#> active#(X) Rules R_0: active(filter(cons(X, Y), 0, Z)) => mark(cons(0, filter(Y, Z, Z))) active(filter(cons(X, Y), s(Z), U)) => mark(cons(X, filter(Y, Z, U))) active(sieve(cons(0, X))) => mark(cons(0, sieve(X))) active(sieve(cons(s(X), Y))) => mark(cons(s(X), sieve(filter(Y, X, X)))) active(nats(X)) => mark(cons(X, nats(s(X)))) active(zprimes) => mark(sieve(nats(s(s(0))))) active(filter(X, Y, Z)) => filter(active(X), Y, Z) active(filter(X, Y, Z)) => filter(X, active(Y), Z) active(filter(X, Y, Z)) => filter(X, Y, active(Z)) active(cons(X, Y)) => cons(active(X), Y) active(s(X)) => s(active(X)) active(sieve(X)) => sieve(active(X)) active(nats(X)) => nats(active(X)) filter(mark(X), Y, Z) => mark(filter(X, Y, Z)) filter(X, mark(Y), Z) => mark(filter(X, Y, Z)) filter(X, Y, mark(Z)) => mark(filter(X, Y, Z)) cons(mark(X), Y) => mark(cons(X, Y)) s(mark(X)) => mark(s(X)) sieve(mark(X)) => mark(sieve(X)) nats(mark(X)) => mark(nats(X)) proper(filter(X, Y, Z)) => filter(proper(X), proper(Y), proper(Z)) proper(cons(X, Y)) => cons(proper(X), proper(Y)) proper(0) => ok(0) proper(s(X)) => s(proper(X)) proper(sieve(X)) => sieve(proper(X)) proper(nats(X)) => nats(proper(X)) proper(zprimes) => ok(zprimes) filter(ok(X), ok(Y), ok(Z)) => ok(filter(X, Y, Z)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) s(ok(X)) => ok(s(X)) sieve(ok(X)) => ok(sieve(X)) nats(ok(X)) => ok(nats(X)) top(mark(X)) => top(proper(X)) top(ok(X)) => top(active(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 : * 1 : 31, 32, 33, 51 * 2 : 34, 52 * 3 : 31, 32, 33, 51 * 4 : * 5 : 36, 54 * 6 : 34, 52 * 7 : 35, 53 * 8 : 36, 54 * 9 : 31, 32, 33, 51 * 10 : 34, 52 * 11 : 37, 55 * 12 : 35, 53 * 13 : 36, 54 * 14 : 37, 55 * 15 : 35, 53 * 16 : * 17 : 31, 32, 33, 51 * 18 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 * 19 : 31, 32, 33, 51 * 20 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 * 21 : 31, 32, 33, 51 * 22 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 * 23 : 34, 52 * 24 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 * 25 : 35, 53 * 26 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 * 27 : 36, 54 * 28 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 * 29 : 37, 55 * 30 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 * 31 : 31, 32, 33, 51 * 32 : 31, 32, 33, 51 * 33 : 31, 32, 33, 51 * 34 : 34, 52 * 35 : 35, 53 * 36 : 36, 54 * 37 : 37, 55 * 38 : 31, 32, 33, 51 * 39 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 40 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 41 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 42 : 34, 52 * 43 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 44 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 45 : 35, 53 * 46 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 47 : 36, 54 * 48 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 49 : 37, 55 * 50 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 51 : 31, 32, 33, 51 * 52 : 34, 52 * 53 : 35, 53 * 54 : 36, 54 * 55 : 37, 55 * 56 : 56, 57, 58, 59 * 57 : 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 * 58 : 56, 57, 58, 59 * 59 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 This graph has the following strongly connected components: P_1: active#(filter(X, Y, Z)) =#> active#(X) active#(filter(X, Y, Z)) =#> active#(Y) active#(filter(X, Y, Z)) =#> active#(Z) active#(cons(X, Y)) =#> active#(X) active#(s(X)) =#> active#(X) active#(sieve(X)) =#> active#(X) active#(nats(X)) =#> active#(X) P_2: filter#(mark(X), Y, Z) =#> filter#(X, Y, Z) filter#(X, mark(Y), Z) =#> filter#(X, Y, Z) filter#(X, Y, mark(Z)) =#> filter#(X, Y, Z) filter#(ok(X), ok(Y), ok(Z)) =#> filter#(X, Y, Z) P_3: cons#(mark(X), Y) =#> cons#(X, Y) cons#(ok(X), ok(Y)) =#> cons#(X, Y) P_4: s#(mark(X)) =#> s#(X) s#(ok(X)) =#> s#(X) P_5: sieve#(mark(X)) =#> sieve#(X) sieve#(ok(X)) =#> sieve#(X) P_6: nats#(mark(X)) =#> nats#(X) nats#(ok(X)) =#> nats#(X) P_7: proper#(filter(X, Y, Z)) =#> proper#(X) proper#(filter(X, Y, Z)) =#> proper#(Y) proper#(filter(X, Y, Z)) =#> proper#(Z) proper#(cons(X, Y)) =#> proper#(X) proper#(cons(X, Y)) =#> proper#(Y) proper#(s(X)) =#> proper#(X) proper#(sieve(X)) =#> proper#(X) proper#(nats(X)) =#> proper#(X) P_8: top#(mark(X)) =#> top#(proper(X)) top#(ok(X)) =#> top#(active(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), (P_7, R_0, m, f) and (P_8, 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), (P_7, 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). The formative rules of (P_8, R_0) are R_1 ::= active(filter(cons(X, Y), 0, Z)) => mark(cons(0, filter(Y, Z, Z))) active(filter(cons(X, Y), s(Z), U)) => mark(cons(X, filter(Y, Z, U))) active(sieve(cons(0, X))) => mark(cons(0, sieve(X))) active(sieve(cons(s(X), Y))) => mark(cons(s(X), sieve(filter(Y, X, X)))) active(nats(X)) => mark(cons(X, nats(s(X)))) active(zprimes) => mark(sieve(nats(s(s(0))))) active(filter(X, Y, Z)) => filter(active(X), Y, Z) active(filter(X, Y, Z)) => filter(X, active(Y), Z) active(filter(X, Y, Z)) => filter(X, Y, active(Z)) active(cons(X, Y)) => cons(active(X), Y) active(s(X)) => s(active(X)) active(sieve(X)) => sieve(active(X)) active(nats(X)) => nats(active(X)) filter(mark(X), Y, Z) => mark(filter(X, Y, Z)) filter(X, mark(Y), Z) => mark(filter(X, Y, Z)) filter(X, Y, mark(Z)) => mark(filter(X, Y, Z)) cons(mark(X), Y) => mark(cons(X, Y)) s(mark(X)) => mark(s(X)) sieve(mark(X)) => mark(sieve(X)) nats(mark(X)) => mark(nats(X)) proper(filter(X, Y, Z)) => filter(proper(X), proper(Y), proper(Z)) proper(cons(X, Y)) => cons(proper(X), proper(Y)) proper(0) => ok(0) proper(s(X)) => s(proper(X)) proper(sieve(X)) => sieve(proper(X)) proper(nats(X)) => nats(proper(X)) proper(zprimes) => ok(zprimes) filter(ok(X), ok(Y), ok(Z)) => ok(filter(X, Y, Z)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) s(ok(X)) => ok(s(X)) sieve(ok(X)) => ok(sieve(X)) nats(ok(X)) => ok(nats(X)) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_8, R_0, minimal, formative) by (P_8, R_1, minimal, formative). 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), (P_7, R_0, minimal, formative) and (P_8, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_8, 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: top#(mark(X)) >? top#(proper(X)) top#(ok(X)) >? top#(active(X)) active(filter(cons(X, Y), 0, Z)) >= mark(cons(0, filter(Y, Z, Z))) active(filter(cons(X, Y), s(Z), U)) >= mark(cons(X, filter(Y, Z, U))) active(sieve(cons(0, X))) >= mark(cons(0, sieve(X))) active(sieve(cons(s(X), Y))) >= mark(cons(s(X), sieve(filter(Y, X, X)))) active(nats(X)) >= mark(cons(X, nats(s(X)))) active(zprimes) >= mark(sieve(nats(s(s(0))))) active(filter(X, Y, Z)) >= filter(active(X), Y, Z) active(filter(X, Y, Z)) >= filter(X, active(Y), Z) active(filter(X, Y, Z)) >= filter(X, Y, active(Z)) active(cons(X, Y)) >= cons(active(X), Y) active(s(X)) >= s(active(X)) active(sieve(X)) >= sieve(active(X)) active(nats(X)) >= nats(active(X)) filter(mark(X), Y, Z) >= mark(filter(X, Y, Z)) filter(X, mark(Y), Z) >= mark(filter(X, Y, Z)) filter(X, Y, mark(Z)) >= mark(filter(X, Y, Z)) cons(mark(X), Y) >= mark(cons(X, Y)) s(mark(X)) >= mark(s(X)) sieve(mark(X)) >= mark(sieve(X)) nats(mark(X)) >= mark(nats(X)) proper(filter(X, Y, Z)) >= filter(proper(X), proper(Y), proper(Z)) proper(cons(X, Y)) >= cons(proper(X), proper(Y)) proper(0) >= ok(0) proper(s(X)) >= s(proper(X)) proper(sieve(X)) >= sieve(proper(X)) proper(nats(X)) >= nats(proper(X)) proper(zprimes) >= ok(zprimes) filter(ok(X), ok(Y), ok(Z)) >= ok(filter(X, Y, Z)) cons(ok(X), ok(Y)) >= ok(cons(X, Y)) s(ok(X)) >= ok(s(X)) sieve(ok(X)) >= ok(sieve(X)) nats(ok(X)) >= ok(nats(X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 active = \y0.y0 cons = \y0y1.2y0 filter = \y0y1y2.1 + y0 + y2 + 2y1 mark = \y0.1 + y0 nats = \y0.1 + 2y0 ok = \y0.y0 proper = \y0.y0 s = \y0.2y0 sieve = \y0.1 + y0 top# = \y0.y0 zprimes = 3 Using this interpretation, the requirements translate to: [[top#(mark(_x0))]] = 1 + x0 > x0 = [[top#(proper(_x0))]] [[top#(ok(_x0))]] = x0 >= x0 = [[top#(active(_x0))]] [[active(filter(cons(_x0, _x1), 0, _x2))]] = 1 + x2 + 2x0 >= 1 = [[mark(cons(0, filter(_x1, _x2, _x2)))]] [[active(filter(cons(_x0, _x1), s(_x2), _x3))]] = 1 + x3 + 2x0 + 4x2 >= 1 + 2x0 = [[mark(cons(_x0, filter(_x1, _x2, _x3)))]] [[active(sieve(cons(0, _x0)))]] = 1 >= 1 = [[mark(cons(0, sieve(_x0)))]] [[active(sieve(cons(s(_x0), _x1)))]] = 1 + 4x0 >= 1 + 4x0 = [[mark(cons(s(_x0), sieve(filter(_x1, _x0, _x0))))]] [[active(nats(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[mark(cons(_x0, nats(s(_x0))))]] [[active(zprimes)]] = 3 >= 3 = [[mark(sieve(nats(s(s(0)))))]] [[active(filter(_x0, _x1, _x2))]] = 1 + x0 + x2 + 2x1 >= 1 + x0 + x2 + 2x1 = [[filter(active(_x0), _x1, _x2)]] [[active(filter(_x0, _x1, _x2))]] = 1 + x0 + x2 + 2x1 >= 1 + x0 + x2 + 2x1 = [[filter(_x0, active(_x1), _x2)]] [[active(filter(_x0, _x1, _x2))]] = 1 + x0 + x2 + 2x1 >= 1 + x0 + x2 + 2x1 = [[filter(_x0, _x1, active(_x2))]] [[active(cons(_x0, _x1))]] = 2x0 >= 2x0 = [[cons(active(_x0), _x1)]] [[active(s(_x0))]] = 2x0 >= 2x0 = [[s(active(_x0))]] [[active(sieve(_x0))]] = 1 + x0 >= 1 + x0 = [[sieve(active(_x0))]] [[active(nats(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[nats(active(_x0))]] [[filter(mark(_x0), _x1, _x2)]] = 2 + x0 + x2 + 2x1 >= 2 + x0 + x2 + 2x1 = [[mark(filter(_x0, _x1, _x2))]] [[filter(_x0, mark(_x1), _x2)]] = 3 + x0 + x2 + 2x1 >= 2 + x0 + x2 + 2x1 = [[mark(filter(_x0, _x1, _x2))]] [[filter(_x0, _x1, mark(_x2))]] = 2 + x0 + x2 + 2x1 >= 2 + x0 + x2 + 2x1 = [[mark(filter(_x0, _x1, _x2))]] [[cons(mark(_x0), _x1)]] = 2 + 2x0 >= 1 + 2x0 = [[mark(cons(_x0, _x1))]] [[s(mark(_x0))]] = 2 + 2x0 >= 1 + 2x0 = [[mark(s(_x0))]] [[sieve(mark(_x0))]] = 2 + x0 >= 2 + x0 = [[mark(sieve(_x0))]] [[nats(mark(_x0))]] = 3 + 2x0 >= 2 + 2x0 = [[mark(nats(_x0))]] [[proper(filter(_x0, _x1, _x2))]] = 1 + x0 + x2 + 2x1 >= 1 + x0 + x2 + 2x1 = [[filter(proper(_x0), proper(_x1), proper(_x2))]] [[proper(cons(_x0, _x1))]] = 2x0 >= 2x0 = [[cons(proper(_x0), proper(_x1))]] [[proper(0)]] = 0 >= 0 = [[ok(0)]] [[proper(s(_x0))]] = 2x0 >= 2x0 = [[s(proper(_x0))]] [[proper(sieve(_x0))]] = 1 + x0 >= 1 + x0 = [[sieve(proper(_x0))]] [[proper(nats(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[nats(proper(_x0))]] [[proper(zprimes)]] = 3 >= 3 = [[ok(zprimes)]] [[filter(ok(_x0), ok(_x1), ok(_x2))]] = 1 + x0 + x2 + 2x1 >= 1 + x0 + x2 + 2x1 = [[ok(filter(_x0, _x1, _x2))]] [[cons(ok(_x0), ok(_x1))]] = 2x0 >= 2x0 = [[ok(cons(_x0, _x1))]] [[s(ok(_x0))]] = 2x0 >= 2x0 = [[ok(s(_x0))]] [[sieve(ok(_x0))]] = 1 + x0 >= 1 + x0 = [[ok(sieve(_x0))]] [[nats(ok(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[ok(nats(_x0))]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_8, R_1, minimal, formative) by (P_9, R_1, minimal, formative), where P_9 consists of: top#(ok(X)) =#> top#(active(X)) 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), (P_7, R_0, minimal, formative) and (P_9, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_9, R_1, minimal, formative). The formative rules of (P_9, R_1) are R_2 ::= active(filter(X, Y, Z)) => filter(active(X), Y, Z) active(filter(X, Y, Z)) => filter(X, active(Y), Z) active(filter(X, Y, Z)) => filter(X, Y, active(Z)) active(cons(X, Y)) => cons(active(X), Y) active(s(X)) => s(active(X)) active(sieve(X)) => sieve(active(X)) active(nats(X)) => nats(active(X)) proper(filter(X, Y, Z)) => filter(proper(X), proper(Y), proper(Z)) proper(cons(X, Y)) => cons(proper(X), proper(Y)) proper(0) => ok(0) proper(s(X)) => s(proper(X)) proper(sieve(X)) => sieve(proper(X)) proper(nats(X)) => nats(proper(X)) proper(zprimes) => ok(zprimes) filter(ok(X), ok(Y), ok(Z)) => ok(filter(X, Y, Z)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) s(ok(X)) => ok(s(X)) sieve(ok(X)) => ok(sieve(X)) nats(ok(X)) => ok(nats(X)) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_9, R_1, minimal, formative) by (P_9, R_2, minimal, formative). 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), (P_7, R_0, minimal, formative) and (P_9, R_2, minimal, formative) is finite. We consider the dependency pair problem (P_9, R_2, minimal, formative). We will use the reduction pair processor with usable rules [Kop12, Thm. 7.44]. The usable rules of (P_9, R_2) are: active(filter(X, Y, Z)) => filter(active(X), Y, Z) active(filter(X, Y, Z)) => filter(X, active(Y), Z) active(filter(X, Y, Z)) => filter(X, Y, active(Z)) active(cons(X, Y)) => cons(active(X), Y) active(s(X)) => s(active(X)) active(sieve(X)) => sieve(active(X)) active(nats(X)) => nats(active(X)) filter(ok(X), ok(Y), ok(Z)) => ok(filter(X, Y, Z)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) s(ok(X)) => ok(s(X)) sieve(ok(X)) => ok(sieve(X)) nats(ok(X)) => ok(nats(X)) It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: top#(ok(X)) >? top#(active(X)) active(filter(X, Y, Z)) >= filter(active(X), Y, Z) active(filter(X, Y, Z)) >= filter(X, active(Y), Z) active(filter(X, Y, Z)) >= filter(X, Y, active(Z)) active(cons(X, Y)) >= cons(active(X), Y) active(s(X)) >= s(active(X)) active(sieve(X)) >= sieve(active(X)) active(nats(X)) >= nats(active(X)) filter(ok(X), ok(Y), ok(Z)) >= ok(filter(X, Y, Z)) cons(ok(X), ok(Y)) >= ok(cons(X, Y)) s(ok(X)) >= ok(s(X)) sieve(ok(X)) >= ok(sieve(X)) nats(ok(X)) >= ok(nats(X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: active = \y0.1 + 2y0 cons = \y0y1.2y1 filter = \y0y1y2.y0 nats = \y0.y0 ok = \y0.3 + 2y0 s = \y0.y0 sieve = \y0.y0 top# = \y0.3y0 Using this interpretation, the requirements translate to: [[top#(ok(_x0))]] = 9 + 6x0 > 3 + 6x0 = [[top#(active(_x0))]] [[active(filter(_x0, _x1, _x2))]] = 1 + 2x0 >= 1 + 2x0 = [[filter(active(_x0), _x1, _x2)]] [[active(filter(_x0, _x1, _x2))]] = 1 + 2x0 >= x0 = [[filter(_x0, active(_x1), _x2)]] [[active(filter(_x0, _x1, _x2))]] = 1 + 2x0 >= x0 = [[filter(_x0, _x1, active(_x2))]] [[active(cons(_x0, _x1))]] = 1 + 4x1 >= 2x1 = [[cons(active(_x0), _x1)]] [[active(s(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[s(active(_x0))]] [[active(sieve(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[sieve(active(_x0))]] [[active(nats(_x0))]] = 1 + 2x0 >= 1 + 2x0 = [[nats(active(_x0))]] [[filter(ok(_x0), ok(_x1), ok(_x2))]] = 3 + 2x0 >= 3 + 2x0 = [[ok(filter(_x0, _x1, _x2))]] [[cons(ok(_x0), ok(_x1))]] = 6 + 4x1 >= 3 + 4x1 = [[ok(cons(_x0, _x1))]] [[s(ok(_x0))]] = 3 + 2x0 >= 3 + 2x0 = [[ok(s(_x0))]] [[sieve(ok(_x0))]] = 3 + 2x0 >= 3 + 2x0 = [[ok(sieve(_x0))]] [[nats(ok(_x0))]] = 3 + 2x0 >= 3 + 2x0 = [[ok(nats(_x0))]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_9, R_2) by ({}, R_2). 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), (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(proper#) = 1 Thus, we can orient the dependency pairs as follows: nu(proper#(filter(X, Y, Z))) = filter(X, Y, Z) |> X = nu(proper#(X)) nu(proper#(filter(X, Y, Z))) = filter(X, Y, Z) |> Y = nu(proper#(Y)) nu(proper#(filter(X, Y, Z))) = filter(X, Y, Z) |> Z = nu(proper#(Z)) nu(proper#(cons(X, Y))) = cons(X, Y) |> X = nu(proper#(X)) nu(proper#(cons(X, Y))) = cons(X, Y) |> Y = nu(proper#(Y)) nu(proper#(s(X))) = s(X) |> X = nu(proper#(X)) nu(proper#(sieve(X))) = sieve(X) |> X = nu(proper#(X)) nu(proper#(nats(X))) = nats(X) |> X = nu(proper#(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(nats#) = 1 Thus, we can orient the dependency pairs as follows: nu(nats#(mark(X))) = mark(X) |> X = nu(nats#(X)) nu(nats#(ok(X))) = ok(X) |> X = nu(nats#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_6, 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(sieve#) = 1 Thus, we can orient the dependency pairs as follows: nu(sieve#(mark(X))) = mark(X) |> X = nu(sieve#(X)) nu(sieve#(ok(X))) = ok(X) |> X = nu(sieve#(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(s#) = 1 Thus, we can orient the dependency pairs as follows: nu(s#(mark(X))) = mark(X) |> X = nu(s#(X)) nu(s#(ok(X))) = ok(X) |> X = nu(s#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_4, 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(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#(ok(X), ok(Y))) = ok(X) |> X = nu(cons#(X, Y)) 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(filter#) = 1 Thus, we can orient the dependency pairs as follows: nu(filter#(mark(X), Y, Z)) = mark(X) |> X = nu(filter#(X, Y, Z)) nu(filter#(X, mark(Y), Z)) = X = X = nu(filter#(X, Y, Z)) nu(filter#(X, Y, mark(Z))) = X = X = nu(filter#(X, Y, Z)) nu(filter#(ok(X), ok(Y), ok(Z))) = ok(X) |> X = nu(filter#(X, Y, Z)) 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: filter#(X, mark(Y), Z) =#> filter#(X, Y, Z) filter#(X, Y, mark(Z)) =#> filter#(X, Y, Z) 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(filter#) = 2 Thus, we can orient the dependency pairs as follows: nu(filter#(X, mark(Y), Z)) = mark(Y) |> Y = nu(filter#(X, Y, Z)) nu(filter#(X, Y, mark(Z))) = Y = Y = nu(filter#(X, Y, Z)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_10, R_0, minimal, f) by (P_11, R_0, minimal, f), where P_11 contains: filter#(X, Y, mark(Z)) =#> filter#(X, Y, Z) Thus, the original system is terminating if each of (P_1, R_0, minimal, formative) and (P_11, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_11, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(filter#) = 3 Thus, we can orient the dependency pairs as follows: nu(filter#(X, Y, mark(Z))) = mark(Z) |> Z = nu(filter#(X, Y, Z)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_11, 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 apply the subterm criterion with the following projection function: nu(active#) = 1 Thus, we can orient the dependency pairs as follows: nu(active#(filter(X, Y, Z))) = filter(X, Y, Z) |> X = nu(active#(X)) nu(active#(filter(X, Y, Z))) = filter(X, Y, Z) |> Y = nu(active#(Y)) nu(active#(filter(X, Y, Z))) = filter(X, Y, Z) |> Z = nu(active#(Z)) nu(active#(cons(X, Y))) = cons(X, Y) |> X = nu(active#(X)) nu(active#(s(X))) = s(X) |> X = nu(active#(X)) nu(active#(sieve(X))) = sieve(X) |> X = nu(active#(X)) nu(active#(nats(X))) = nats(X) |> X = nu(active#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_1, R_0, minimal, f) by ({}, R_0, 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.