We consider the system Applicative_first_order_05__#3.18. Alphabet: 0 : [] --> a cons : [c * d] --> d double : [a] --> a false : [] --> b filter : [c -> b * d] --> d filter2 : [b * c -> b * c * d] --> d map : [c -> c * d] --> d minus : [a * a] --> a nil : [] --> d plus : [a * a] --> a s : [a] --> a true : [] --> b Rules: minus(x, 0) => x minus(s(x), s(y)) => minus(x, y) double(0) => 0 double(s(x)) => s(s(double(x))) plus(0, x) => x plus(s(x), y) => s(plus(x, y)) plus(s(x), y) => plus(x, s(y)) plus(s(x), y) => s(plus(minus(x, y), double(y))) map(f, nil) => nil map(f, cons(x, y)) => cons(f x, map(f, y)) filter(f, nil) => nil filter(f, cons(x, y)) => filter2(f x, f, x, y) filter2(true, f, x, y) => cons(x, filter(f, y)) filter2(false, f, x, y) => filter(f, y) This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). We use the dependency pair framework as described in [Kop12, Ch. 6/7], with static dependency pairs (see [KusIsoSakBla09] and the adaptation for AFSMs and accessible arguments in [Kop13]). We thus obtain the following dependency pair problem (P_0, R_0, static, formative): Dependency Pairs P_0: 0] minus#(s(X), s(Y)) =#> minus#(X, Y) 1] double#(s(X)) =#> double#(X) 2] plus#(s(X), Y) =#> plus#(X, Y) 3] plus#(s(X), Y) =#> plus#(X, s(Y)) 4] plus#(s(X), Y) =#> plus#(minus(X, Y), double(Y)) 5] plus#(s(X), Y) =#> minus#(X, Y) 6] plus#(s(X), Y) =#> double#(Y) 7] map#(F, cons(X, Y)) =#> map#(F, Y) 8] filter#(F, cons(X, Y)) =#> filter2#(F X, F, X, Y) 9] filter2#(true, F, X, Y) =#> filter#(F, Y) 10] filter2#(false, F, X, Y) =#> filter#(F, Y) Rules R_0: minus(X, 0) => X minus(s(X), s(Y)) => minus(X, Y) double(0) => 0 double(s(X)) => s(s(double(X))) plus(0, X) => X plus(s(X), Y) => s(plus(X, Y)) plus(s(X), Y) => plus(X, s(Y)) plus(s(X), Y) => s(plus(minus(X, Y), double(Y))) map(F, nil) => nil map(F, cons(X, Y)) => cons(F X, map(F, Y)) filter(F, nil) => nil filter(F, cons(X, Y)) => filter2(F X, F, X, Y) filter2(true, F, X, Y) => cons(X, filter(F, Y)) filter2(false, F, X, Y) => filter(F, Y) Thus, the original system is terminating if (P_0, R_0, static, formative) is finite. We consider the dependency pair problem (P_0, R_0, static, 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 * 2 : 2, 3, 4, 5, 6 * 3 : 2, 3, 4, 5, 6 * 4 : 2, 3, 4, 5, 6 * 5 : 0 * 6 : 1 * 7 : 7 * 8 : 9, 10 * 9 : 8 * 10 : 8 This graph has the following strongly connected components: P_1: minus#(s(X), s(Y)) =#> minus#(X, Y) P_2: double#(s(X)) =#> double#(X) P_3: plus#(s(X), Y) =#> plus#(X, Y) plus#(s(X), Y) =#> plus#(X, s(Y)) plus#(s(X), Y) =#> plus#(minus(X, Y), double(Y)) P_4: map#(F, cons(X, Y)) =#> map#(F, Y) P_5: filter#(F, cons(X, Y)) =#> filter2#(F X, F, X, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) filter2#(false, F, X, Y) =#> filter#(F, Y) 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) and (P_5, R_0, m, f). Thus, the original system is terminating if each of (P_1, R_0, static, formative), (P_2, R_0, static, formative), (P_3, R_0, static, formative), (P_4, R_0, static, formative) and (P_5, R_0, static, formative) is finite. We consider the dependency pair problem (P_5, R_0, static, 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: filter#(F, cons(X, Y)) >? filter2#(F X, F, X, Y) filter2#(true, F, X, Y) >? filter#(F, Y) filter2#(false, F, X, Y) >? filter#(F, Y) minus(X, 0) >= X minus(s(X), s(Y)) >= minus(X, Y) double(0) >= 0 double(s(X)) >= s(s(double(X))) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X, Y), double(Y))) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filter2(F X, F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 cons = \y0y1.1 + y1 double = \y0.0 false = 3 filter = \G0y1.y1 filter2 = \y0G1y2y3.1 + y3 filter2# = \y0G1y2y3.y3 filter# = \G0y1.y1 map = \G0y1.1 + y1 minus = \y0y1.y0 nil = 0 plus = \y0y1.y1 s = \y0.y0 true = 3 Using this interpretation, the requirements translate to: [[filter#(_F0, cons(_x1, _x2))]] = 1 + x2 > x2 = [[filter2#(_F0 _x1, _F0, _x1, _x2)]] [[filter2#(true, _F0, _x1, _x2)]] = x2 >= x2 = [[filter#(_F0, _x2)]] [[filter2#(false, _F0, _x1, _x2)]] = x2 >= x2 = [[filter#(_F0, _x2)]] [[minus(_x0, 0)]] = x0 >= x0 = [[_x0]] [[minus(s(_x0), s(_x1))]] = x0 >= x0 = [[minus(_x0, _x1)]] [[double(0)]] = 0 >= 0 = [[0]] [[double(s(_x0))]] = 0 >= 0 = [[s(s(double(_x0)))]] [[plus(0, _x0)]] = x0 >= x0 = [[_x0]] [[plus(s(_x0), _x1)]] = x1 >= x1 = [[s(plus(_x0, _x1))]] [[plus(s(_x0), _x1)]] = x1 >= x1 = [[plus(_x0, s(_x1))]] [[plus(s(_x0), _x1)]] = x1 >= 0 = [[s(plus(minus(_x0, _x1), double(_x1)))]] [[map(_F0, nil)]] = 1 >= 0 = [[nil]] [[map(_F0, cons(_x1, _x2))]] = 2 + x2 >= 2 + x2 = [[cons(_F0 _x1, map(_F0, _x2))]] [[filter(_F0, nil)]] = 0 >= 0 = [[nil]] [[filter(_F0, cons(_x1, _x2))]] = 1 + x2 >= 1 + x2 = [[filter2(_F0 _x1, _F0, _x1, _x2)]] [[filter2(true, _F0, _x1, _x2)]] = 1 + x2 >= 1 + x2 = [[cons(_x1, filter(_F0, _x2))]] [[filter2(false, _F0, _x1, _x2)]] = 1 + x2 >= x2 = [[filter(_F0, _x2)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_5, R_0, static, formative) by (P_6, R_0, static, formative), where P_6 consists of: filter2#(true, F, X, Y) =#> filter#(F, Y) filter2#(false, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if each of (P_1, R_0, static, formative), (P_2, R_0, static, formative), (P_3, R_0, static, formative), (P_4, R_0, static, formative) and (P_6, R_0, static, formative) is finite. We consider the dependency pair problem (P_6, R_0, static, 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 : This graph has no strongly connected components. By [Kop12, Thm. 7.31], this implies finiteness of the dependency pair problem. Thus, the original system is terminating if each of (P_1, R_0, static, formative), (P_2, R_0, static, formative), (P_3, R_0, static, formative) and (P_4, R_0, static, formative) is finite. We consider the dependency pair problem (P_4, R_0, static, 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: map#(F, cons(X, Y)) >? map#(F, Y) minus(X, 0) >= X minus(s(X), s(Y)) >= minus(X, Y) double(0) >= 0 double(s(X)) >= s(s(double(X))) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X, Y), double(Y))) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filter2(F X, F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 cons = \y0y1.1 + 2y1 double = \y0.0 false = 3 filter = \G0y1.y1 filter2 = \y0G1y2y3.1 + 2y3 map = \G0y1.y1 map# = \G0y1.y1 + 2y1G0(y1) minus = \y0y1.y0 nil = 0 plus = \y0y1.y1 s = \y0.y0 true = 3 Using this interpretation, the requirements translate to: [[map#(_F0, cons(_x1, _x2))]] = 1 + 2x2 + 2F0(1 + 2x2) + 4x2F0(1 + 2x2) > x2 + 2x2F0(x2) = [[map#(_F0, _x2)]] [[minus(_x0, 0)]] = x0 >= x0 = [[_x0]] [[minus(s(_x0), s(_x1))]] = x0 >= x0 = [[minus(_x0, _x1)]] [[double(0)]] = 0 >= 0 = [[0]] [[double(s(_x0))]] = 0 >= 0 = [[s(s(double(_x0)))]] [[plus(0, _x0)]] = x0 >= x0 = [[_x0]] [[plus(s(_x0), _x1)]] = x1 >= x1 = [[s(plus(_x0, _x1))]] [[plus(s(_x0), _x1)]] = x1 >= x1 = [[plus(_x0, s(_x1))]] [[plus(s(_x0), _x1)]] = x1 >= 0 = [[s(plus(minus(_x0, _x1), double(_x1)))]] [[map(_F0, nil)]] = 0 >= 0 = [[nil]] [[map(_F0, cons(_x1, _x2))]] = 1 + 2x2 >= 1 + 2x2 = [[cons(_F0 _x1, map(_F0, _x2))]] [[filter(_F0, nil)]] = 0 >= 0 = [[nil]] [[filter(_F0, cons(_x1, _x2))]] = 1 + 2x2 >= 1 + 2x2 = [[filter2(_F0 _x1, _F0, _x1, _x2)]] [[filter2(true, _F0, _x1, _x2)]] = 1 + 2x2 >= 1 + 2x2 = [[cons(_x1, filter(_F0, _x2))]] [[filter2(false, _F0, _x1, _x2)]] = 1 + 2x2 >= x2 = [[filter(_F0, _x2)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_4, R_0) by ({}, R_0). 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, static, formative), (P_2, R_0, static, formative) and (P_3, R_0, static, formative) is finite. We consider the dependency pair problem (P_3, R_0, static, 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: plus#(s(X), Y) >? plus#(X, Y) plus#(s(X), Y) >? plus#(X, s(Y)) plus#(s(X), Y) >? plus#(minus(X, Y), double(Y)) minus(X, 0) >= X minus(s(X), s(Y)) >= minus(X, Y) double(0) >= 0 double(s(X)) >= s(s(double(X))) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X, Y), double(Y))) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filter2(F X, F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) Since this representation is not advantageous for the higher-order recursive path ordering, we present the strict requirements in their unextended form, which is not problematic since for any F, s and substituion gamma: (F s)gamma beta-reduces to F(s)gamma.) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[cons(x_1, x_2)]] = x_2 [[filter2(x_1, x_2, x_3, x_4)]] = filter2(x_2, x_4) [[minus(x_1, x_2)]] = minus(x_1) [[nil]] = _|_ [[plus#(x_1, x_2)]] = plus#(x_1) We choose Lex = {plus} and Mul = {@_{o -> o}, double, false, filter, filter2, map, minus, plus#, s, true}, and the following precedence: @_{o -> o} > false > map > true > filter = filter2 > plus > double > s > minus > plus# Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: plus#(s(X)) >= plus#(X) plus#(s(X)) >= plus#(X) plus#(s(X)) > plus#(minus(X)) minus(X) >= X minus(s(X)) >= minus(X) double(_|_) >= _|_ double(s(X)) >= s(s(double(X))) plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X), double(Y))) map(F, _|_) >= _|_ map(F, X) >= map(F, X) filter(F, _|_) >= _|_ filter(F, X) >= filter2(F, X) filter2(F, X) >= filter(F, X) filter2(F, X) >= filter(F, X) With these choices, we have: 1] plus#(s(X)) >= plus#(X) because plus# in Mul and [2], by (Fun) 2] s(X) >= X because [3], by (Star) 3] s*(X) >= X because [4], by (Select) 4] X >= X by (Meta) 5] plus#(s(X)) >= plus#(X) because plus# in Mul and [6], by (Fun) 6] s(X) >= X because [7], by (Star) 7] s*(X) >= X because [8], by (Select) 8] X >= X by (Meta) 9] plus#(s(X)) > plus#(minus(X)) because [10], by definition 10] plus#*(s(X)) >= plus#(minus(X)) because [11], by (Select) 11] s(X) >= plus#(minus(X)) because [12], by (Star) 12] s*(X) >= plus#(minus(X)) because s > plus# and [13], by (Copy) 13] s*(X) >= minus(X) because s > minus and [14], by (Copy) 14] s*(X) >= X because [15], by (Select) 15] X >= X by (Meta) 16] minus(X) >= X because [17], by (Star) 17] minus*(X) >= X because [18], by (Select) 18] X >= X by (Meta) 19] minus(s(X)) >= minus(X) because [20], by (Star) 20] minus*(s(X)) >= minus(X) because [21], by (Select) 21] s(X) >= minus(X) because [22], by (Star) 22] s*(X) >= minus(X) because s > minus and [23], by (Copy) 23] s*(X) >= X because [24], by (Select) 24] X >= X by (Meta) 25] double(_|_) >= _|_ by (Bot) 26] double(s(X)) >= s(s(double(X))) because [27], by (Star) 27] double*(s(X)) >= s(s(double(X))) because double > s and [28], by (Copy) 28] double*(s(X)) >= s(double(X)) because double > s and [29], by (Copy) 29] double*(s(X)) >= double(X) because double in Mul and [30], by (Stat) 30] s(X) > X because [31], by definition 31] s*(X) >= X because [32], by (Select) 32] X >= X by (Meta) 33] plus(_|_, X) >= X because [34], by (Star) 34] plus*(_|_, X) >= X because [35], by (Select) 35] X >= X by (Meta) 36] plus(s(X), Y) >= s(plus(X, Y)) because [37], by (Star) 37] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [38], by (Copy) 38] plus*(s(X), Y) >= plus(X, Y) because [39], [41] and [42], by (Stat) 39] s(X) > X because [40], by definition 40] s*(X) >= X because [4], by (Select) 41] plus*(s(X), Y) >= X because [2], by (Select) 42] plus*(s(X), Y) >= Y because [43], by (Select) 43] Y >= Y by (Meta) 44] plus(s(X), Y) >= plus(X, s(Y)) because [45], by (Star) 45] plus*(s(X), Y) >= plus(X, s(Y)) because [46], [48] and [49], by (Stat) 46] s(X) > X because [47], by definition 47] s*(X) >= X because [8], by (Select) 48] plus*(s(X), Y) >= X because [6], by (Select) 49] plus*(s(X), Y) >= s(Y) because plus > s and [50], by (Copy) 50] plus*(s(X), Y) >= Y because [51], by (Select) 51] Y >= Y by (Meta) 52] plus(s(X), Y) >= s(plus(minus(X), double(Y))) because [53], by (Star) 53] plus*(s(X), Y) >= s(plus(minus(X), double(Y))) because plus > s and [54], by (Copy) 54] plus*(s(X), Y) >= plus(minus(X), double(Y)) because [55], [56] and [59], by (Stat) 55] s(X) > minus(X) because [13], by definition 56] plus*(s(X), Y) >= minus(X) because plus > minus and [57], by (Copy) 57] plus*(s(X), Y) >= X because [58], by (Select) 58] s(X) >= X because [14], by (Star) 59] plus*(s(X), Y) >= double(Y) because plus > double and [60], by (Copy) 60] plus*(s(X), Y) >= Y because [61], by (Select) 61] Y >= Y by (Meta) 62] map(F, _|_) >= _|_ by (Bot) 63] map(F, X) >= map(F, X) because map in Mul, [64] and [65], by (Fun) 64] F >= F by (Meta) 65] X >= X by (Meta) 66] filter(F, _|_) >= _|_ by (Bot) 67] filter(F, X) >= filter2(F, X) because filter = filter2, filter in Mul, [68] and [69], by (Fun) 68] F >= F by (Meta) 69] X >= X by (Meta) 70] filter2(F, X) >= filter(F, X) because filter2 = filter, filter2 in Mul, [71] and [72], by (Fun) 71] F >= F by (Meta) 72] X >= X by (Meta) 73] filter2(F, X) >= filter(F, X) because filter2 = filter, filter2 in Mul, [74] and [75], by (Fun) 74] F >= F by (Meta) 75] X >= X by (Meta) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_3, R_0, static, formative) by (P_7, R_0, static, formative), where P_7 consists of: plus#(s(X), Y) =#> plus#(X, Y) plus#(s(X), Y) =#> plus#(X, s(Y)) Thus, the original system is terminating if each of (P_1, R_0, static, formative), (P_2, R_0, static, formative) and (P_7, R_0, static, formative) is finite. We consider the dependency pair problem (P_7, R_0, static, 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: plus#(s(X), Y) >? plus#(X, Y) plus#(s(X), Y) >? plus#(X, s(Y)) minus(X, 0) >= X minus(s(X), s(Y)) >= minus(X, Y) double(0) >= 0 double(s(X)) >= s(s(double(X))) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X, Y), double(Y))) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filter2(F X, F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) Since this representation is not advantageous for the higher-order recursive path ordering, we present the strict requirements in their unextended form, which is not problematic since for any F, s and substituion gamma: (F s)gamma beta-reduces to F(s)gamma.) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[filter2(x_1, x_2, x_3, x_4)]] = filter2(x_2, x_3, x_4) [[minus(x_1, x_2)]] = minus(x_1) [[nil]] = _|_ [[plus#(x_1, x_2)]] = plus#(x_1) We choose Lex = {plus} and Mul = {@_{o -> o}, cons, double, false, filter, filter2, map, minus, plus#, s, true}, and the following precedence: false > filter = filter2 > map > @_{o -> o} > plus > double > cons > s > minus > true > plus# Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: plus#(s(X)) > plus#(X) plus#(s(X)) >= plus#(X) minus(X) >= X minus(s(X)) >= minus(X) double(_|_) >= _|_ double(s(X)) >= s(s(double(X))) plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X), double(Y))) map(F, _|_) >= _|_ map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) filter(F, _|_) >= _|_ filter(F, cons(X, Y)) >= filter2(F, X, Y) filter2(F, X, Y) >= cons(X, filter(F, Y)) filter2(F, X, Y) >= filter(F, Y) With these choices, we have: 1] plus#(s(X)) > plus#(X) because [2], by definition 2] plus#*(s(X)) >= plus#(X) because plus# in Mul and [3], by (Stat) 3] s(X) > X because [4], by definition 4] s*(X) >= X because [5], by (Select) 5] X >= X by (Meta) 6] plus#(s(X)) >= plus#(X) because [7], by (Star) 7] plus#*(s(X)) >= plus#(X) because plus# in Mul and [8], by (Stat) 8] s(X) > X because [9], by definition 9] s*(X) >= X because [10], by (Select) 10] X >= X by (Meta) 11] minus(X) >= X because [12], by (Star) 12] minus*(X) >= X because [13], by (Select) 13] X >= X by (Meta) 14] minus(s(X)) >= minus(X) because [15], by (Star) 15] minus*(s(X)) >= minus(X) because minus in Mul and [16], by (Stat) 16] s(X) > X because [17], by definition 17] s*(X) >= X because [18], by (Select) 18] X >= X by (Meta) 19] double(_|_) >= _|_ by (Bot) 20] double(s(X)) >= s(s(double(X))) because [21], by (Star) 21] double*(s(X)) >= s(s(double(X))) because double > s and [22], by (Copy) 22] double*(s(X)) >= s(double(X)) because double > s and [23], by (Copy) 23] double*(s(X)) >= double(X) because double in Mul and [24], by (Stat) 24] s(X) > X because [25], by definition 25] s*(X) >= X because [26], by (Select) 26] X >= X by (Meta) 27] plus(_|_, X) >= X because [28], by (Star) 28] plus*(_|_, X) >= X because [29], by (Select) 29] X >= X by (Meta) 30] plus(s(X), Y) >= s(plus(X, Y)) because [31], by (Star) 31] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [32], by (Copy) 32] plus*(s(X), Y) >= plus(X, Y) because [3], [33] and [35], by (Stat) 33] plus*(s(X), Y) >= X because [34], by (Select) 34] s(X) >= X because [4], by (Star) 35] plus*(s(X), Y) >= Y because [36], by (Select) 36] Y >= Y by (Meta) 37] plus(s(X), Y) >= plus(X, s(Y)) because [38], by (Star) 38] plus*(s(X), Y) >= plus(X, s(Y)) because [8], [39] and [41], by (Stat) 39] plus*(s(X), Y) >= X because [40], by (Select) 40] s(X) >= X because [9], by (Star) 41] plus*(s(X), Y) >= s(Y) because plus > s and [42], by (Copy) 42] plus*(s(X), Y) >= Y because [43], by (Select) 43] Y >= Y by (Meta) 44] plus(s(X), Y) >= s(plus(minus(X), double(Y))) because [45], by (Star) 45] plus*(s(X), Y) >= s(plus(minus(X), double(Y))) because plus > s and [46], by (Copy) 46] plus*(s(X), Y) >= plus(minus(X), double(Y)) because [47], [51] and [54], by (Stat) 47] s(X) > minus(X) because [48], by definition 48] s*(X) >= minus(X) because s > minus and [49], by (Copy) 49] s*(X) >= X because [50], by (Select) 50] X >= X by (Meta) 51] plus*(s(X), Y) >= minus(X) because plus > minus and [52], by (Copy) 52] plus*(s(X), Y) >= X because [53], by (Select) 53] s(X) >= X because [49], by (Star) 54] plus*(s(X), Y) >= double(Y) because plus > double and [55], by (Copy) 55] plus*(s(X), Y) >= Y because [56], by (Select) 56] Y >= Y by (Meta) 57] map(F, _|_) >= _|_ by (Bot) 58] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [59], by (Star) 59] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [60] and [67], by (Copy) 60] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [61] and [63], by (Copy) 61] map*(F, cons(X, Y)) >= F because [62], by (Select) 62] F >= F by (Meta) 63] map*(F, cons(X, Y)) >= X because [64], by (Select) 64] cons(X, Y) >= X because [65], by (Star) 65] cons*(X, Y) >= X because [66], by (Select) 66] X >= X by (Meta) 67] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [68] and [69], by (Stat) 68] F >= F by (Meta) 69] cons(X, Y) > Y because [70], by definition 70] cons*(X, Y) >= Y because [71], by (Select) 71] Y >= Y by (Meta) 72] filter(F, _|_) >= _|_ by (Bot) 73] filter(F, cons(X, Y)) >= filter2(F, X, Y) because [74], by (Star) 74] filter*(F, cons(X, Y)) >= filter2(F, X, Y) because filter = filter2, filter in Mul, [75], [76] and [79], by (Stat) 75] F >= F by (Meta) 76] cons(X, Y) > X because [77], by definition 77] cons*(X, Y) >= X because [78], by (Select) 78] X >= X by (Meta) 79] cons(X, Y) > Y because [80], by definition 80] cons*(X, Y) >= Y because [81], by (Select) 81] Y >= Y by (Meta) 82] filter2(F, X, Y) >= cons(X, filter(F, Y)) because [83], by (Star) 83] filter2*(F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [84] and [86], by (Copy) 84] filter2*(F, X, Y) >= X because [85], by (Select) 85] X >= X by (Meta) 86] filter2*(F, X, Y) >= filter(F, Y) because filter2 = filter, filter2 in Mul, [87] and [88], by (Stat) 87] F >= F by (Meta) 88] Y >= Y by (Meta) 89] filter2(F, X, Y) >= filter(F, Y) because [90], by (Star) 90] filter2*(F, X, Y) >= filter(F, Y) because filter2 = filter, filter2 in Mul, [91] and [92], by (Stat) 91] F >= F by (Meta) 92] Y >= Y by (Meta) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_7, R_0, static, formative) by (P_8, R_0, static, formative), where P_8 consists of: plus#(s(X), Y) =#> plus#(X, s(Y)) Thus, the original system is terminating if each of (P_1, R_0, static, formative), (P_2, R_0, static, formative) and (P_8, R_0, static, formative) is finite. We consider the dependency pair problem (P_8, R_0, static, 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: plus#(s(X), Y) >? plus#(X, s(Y)) minus(X, 0) >= X minus(s(X), s(Y)) >= minus(X, Y) double(0) >= 0 double(s(X)) >= s(s(double(X))) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X, Y), double(Y))) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filter2(F X, F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) Since this representation is not advantageous for the higher-order recursive path ordering, we present the strict requirements in their unextended form, which is not problematic since for any F, s and substituion gamma: (F s)gamma beta-reduces to F(s)gamma.) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[cons(x_1, x_2)]] = _|_ [[filter(x_1, x_2)]] = _|_ [[filter2(x_1, x_2, x_3, x_4)]] = _|_ [[map(x_1, x_2)]] = map [[minus(x_1, x_2)]] = minus(x_1) [[nil]] = _|_ We choose Lex = {plus, plus#} and Mul = {@_{o -> o}, double, false, map, minus, s, true}, and the following precedence: @_{o -> o} > false > map > plus > double > plus# > s > minus > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: plus#(s(X), Y) > plus#(X, s(Y)) minus(X) >= X minus(s(X)) >= minus(X) double(_|_) >= _|_ double(s(X)) >= s(s(double(X))) plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X), double(Y))) map >= _|_ map >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ With these choices, we have: 1] plus#(s(X), Y) > plus#(X, s(Y)) because [2], by definition 2] plus#*(s(X), Y) >= plus#(X, s(Y)) because [3], [6] and [8], by (Stat) 3] s(X) > X because [4], by definition 4] s*(X) >= X because [5], by (Select) 5] X >= X by (Meta) 6] plus#*(s(X), Y) >= X because [7], by (Select) 7] s(X) >= X because [4], by (Star) 8] plus#*(s(X), Y) >= s(Y) because plus# > s and [9], by (Copy) 9] plus#*(s(X), Y) >= Y because [10], by (Select) 10] Y >= Y by (Meta) 11] minus(X) >= X because [12], by (Star) 12] minus*(X) >= X because [13], by (Select) 13] X >= X by (Meta) 14] minus(s(X)) >= minus(X) because [15], by (Star) 15] minus*(s(X)) >= minus(X) because minus in Mul and [16], by (Stat) 16] s(X) > X because [17], by definition 17] s*(X) >= X because [18], by (Select) 18] X >= X by (Meta) 19] double(_|_) >= _|_ by (Bot) 20] double(s(X)) >= s(s(double(X))) because [21], by (Star) 21] double*(s(X)) >= s(s(double(X))) because double > s and [22], by (Copy) 22] double*(s(X)) >= s(double(X)) because double > s and [23], by (Copy) 23] double*(s(X)) >= double(X) because double in Mul and [24], by (Stat) 24] s(X) > X because [25], by definition 25] s*(X) >= X because [26], by (Select) 26] X >= X by (Meta) 27] plus(_|_, X) >= X because [28], by (Star) 28] plus*(_|_, X) >= X because [29], by (Select) 29] X >= X by (Meta) 30] plus(s(X), Y) >= s(plus(X, Y)) because [31], by (Star) 31] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [32], by (Copy) 32] plus*(s(X), Y) >= plus(X, Y) because [33], [36] and [38], by (Stat) 33] s(X) > X because [34], by definition 34] s*(X) >= X because [35], by (Select) 35] X >= X by (Meta) 36] plus*(s(X), Y) >= X because [37], by (Select) 37] s(X) >= X because [34], by (Star) 38] plus*(s(X), Y) >= Y because [39], by (Select) 39] Y >= Y by (Meta) 40] plus(s(X), Y) >= plus(X, s(Y)) because [41], by (Star) 41] plus*(s(X), Y) >= plus(X, s(Y)) because [3], [42] and [43], by (Stat) 42] plus*(s(X), Y) >= X because [7], by (Select) 43] plus*(s(X), Y) >= s(Y) because plus > s and [44], by (Copy) 44] plus*(s(X), Y) >= Y because [10], by (Select) 45] plus(s(X), Y) >= s(plus(minus(X), double(Y))) because [46], by (Star) 46] plus*(s(X), Y) >= s(plus(minus(X), double(Y))) because plus > s and [47], by (Copy) 47] plus*(s(X), Y) >= plus(minus(X), double(Y)) because [48], [52] and [54], by (Stat) 48] s(X) > minus(X) because [49], by definition 49] s*(X) >= minus(X) because s > minus and [50], by (Copy) 50] s*(X) >= X because [51], by (Select) 51] X >= X by (Meta) 52] plus*(s(X), Y) >= minus(X) because [53], by (Select) 53] s(X) >= minus(X) because [49], by (Star) 54] plus*(s(X), Y) >= double(Y) because plus > double and [55], by (Copy) 55] plus*(s(X), Y) >= Y because [56], by (Select) 56] Y >= Y by (Meta) 57] map >= _|_ by (Bot) 58] map >= _|_ by (Bot) 59] _|_ >= _|_ by (Bot) 60] _|_ >= _|_ by (Bot) 61] _|_ >= _|_ by (Bot) 62] _|_ >= _|_ by (Bot) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_8, R_0) by ({}, R_0). 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, static, formative) and (P_2, R_0, static, formative) is finite. We consider the dependency pair problem (P_2, R_0, static, 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: double#(s(X)) >? double#(X) minus(X, 0) >= X minus(s(X), s(Y)) >= minus(X, Y) double(0) >= 0 double(s(X)) >= s(s(double(X))) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X, Y), double(Y))) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filter2(F X, F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) Since this representation is not advantageous for the higher-order recursive path ordering, we present the strict requirements in their unextended form, which is not problematic since for any F, s and substituion gamma: (F s)gamma beta-reduces to F(s)gamma.) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[cons(x_1, x_2)]] = _|_ [[filter(x_1, x_2)]] = _|_ [[filter2(x_1, x_2, x_3, x_4)]] = _|_ [[map(x_1, x_2)]] = map [[minus(x_1, x_2)]] = minus(x_1) [[nil]] = _|_ We choose Lex = {plus} and Mul = {@_{o -> o}, double, double#, false, map, minus, s, true}, and the following precedence: @_{o -> o} > map > plus > double > s > double# > minus > true > false Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: double#(s(X)) > double#(X) minus(X) >= X minus(s(X)) >= minus(X) double(_|_) >= _|_ double(s(X)) >= s(s(double(X))) plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X), double(Y))) map >= _|_ map >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ With these choices, we have: 1] double#(s(X)) > double#(X) because [2], by definition 2] double#*(s(X)) >= double#(X) because [3], by (Select) 3] s(X) >= double#(X) because [4], by (Star) 4] s*(X) >= double#(X) because s > double# and [5], by (Copy) 5] s*(X) >= X because [6], by (Select) 6] X >= X by (Meta) 7] minus(X) >= X because [8], by (Star) 8] minus*(X) >= X because [9], by (Select) 9] X >= X by (Meta) 10] minus(s(X)) >= minus(X) because [11], by (Star) 11] minus*(s(X)) >= minus(X) because minus in Mul and [12], by (Stat) 12] s(X) > X because [13], by definition 13] s*(X) >= X because [14], by (Select) 14] X >= X by (Meta) 15] double(_|_) >= _|_ by (Bot) 16] double(s(X)) >= s(s(double(X))) because [17], by (Star) 17] double*(s(X)) >= s(s(double(X))) because double > s and [18], by (Copy) 18] double*(s(X)) >= s(double(X)) because double > s and [19], by (Copy) 19] double*(s(X)) >= double(X) because double in Mul and [20], by (Stat) 20] s(X) > X because [5], by definition 21] plus(_|_, X) >= X because [22], by (Star) 22] plus*(_|_, X) >= X because [23], by (Select) 23] X >= X by (Meta) 24] plus(s(X), Y) >= s(plus(X, Y)) because [25], by (Star) 25] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [26], by (Copy) 26] plus*(s(X), Y) >= plus(X, Y) because [27], [30] and [32], by (Stat) 27] s(X) > X because [28], by definition 28] s*(X) >= X because [29], by (Select) 29] X >= X by (Meta) 30] plus*(s(X), Y) >= X because [31], by (Select) 31] s(X) >= X because [28], by (Star) 32] plus*(s(X), Y) >= Y because [33], by (Select) 33] Y >= Y by (Meta) 34] plus(s(X), Y) >= plus(X, s(Y)) because [35], by (Star) 35] plus*(s(X), Y) >= plus(X, s(Y)) because [36], [39] and [41], by (Stat) 36] s(X) > X because [37], by definition 37] s*(X) >= X because [38], by (Select) 38] X >= X by (Meta) 39] plus*(s(X), Y) >= X because [40], by (Select) 40] s(X) >= X because [37], by (Star) 41] plus*(s(X), Y) >= s(Y) because plus > s and [42], by (Copy) 42] plus*(s(X), Y) >= Y because [43], by (Select) 43] Y >= Y by (Meta) 44] plus(s(X), Y) >= s(plus(minus(X), double(Y))) because [45], by (Star) 45] plus*(s(X), Y) >= s(plus(minus(X), double(Y))) because plus > s and [46], by (Copy) 46] plus*(s(X), Y) >= plus(minus(X), double(Y)) because [47], [51] and [54], by (Stat) 47] s(X) > minus(X) because [48], by definition 48] s*(X) >= minus(X) because s > minus and [49], by (Copy) 49] s*(X) >= X because [50], by (Select) 50] X >= X by (Meta) 51] plus*(s(X), Y) >= minus(X) because plus > minus and [52], by (Copy) 52] plus*(s(X), Y) >= X because [53], by (Select) 53] s(X) >= X because [49], by (Star) 54] plus*(s(X), Y) >= double(Y) because plus > double and [55], by (Copy) 55] plus*(s(X), Y) >= Y because [56], by (Select) 56] Y >= Y by (Meta) 57] map >= _|_ by (Bot) 58] map >= _|_ by (Bot) 59] _|_ >= _|_ by (Bot) 60] _|_ >= _|_ by (Bot) 61] _|_ >= _|_ by (Bot) 62] _|_ >= _|_ by (Bot) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_2, R_0) by ({}, R_0). 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, static, formative) is finite. We consider the dependency pair problem (P_1, R_0, static, 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: minus#(s(X), s(Y)) >? minus#(X, Y) minus(X, 0) >= X minus(s(X), s(Y)) >= minus(X, Y) double(0) >= 0 double(s(X)) >= s(s(double(X))) plus(0, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X, Y), double(Y))) map(F, nil) >= nil map(F, cons(X, Y)) >= cons(F X, map(F, Y)) filter(F, nil) >= nil filter(F, cons(X, Y)) >= filter2(F X, F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) Since this representation is not advantageous for the higher-order recursive path ordering, we present the strict requirements in their unextended form, which is not problematic since for any F, s and substituion gamma: (F s)gamma beta-reduces to F(s)gamma.) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[cons(x_1, x_2)]] = _|_ [[filter(x_1, x_2)]] = _|_ [[filter2(x_1, x_2, x_3, x_4)]] = _|_ [[map(x_1, x_2)]] = map [[minus(x_1, x_2)]] = minus(x_1) [[minus#(x_1, x_2)]] = minus#(x_1) [[nil]] = _|_ We choose Lex = {plus} and Mul = {@_{o -> o}, double, false, map, minus, minus#, s, true}, and the following precedence: @_{o -> o} > false > map > plus > double > s > minus > minus# > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: minus#(s(X)) > minus#(X) minus(X) >= X minus(s(X)) >= minus(X) double(_|_) >= _|_ double(s(X)) >= s(s(double(X))) plus(_|_, X) >= X plus(s(X), Y) >= s(plus(X, Y)) plus(s(X), Y) >= plus(X, s(Y)) plus(s(X), Y) >= s(plus(minus(X), double(Y))) map >= _|_ map >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ With these choices, we have: 1] minus#(s(X)) > minus#(X) because [2], by definition 2] minus#*(s(X)) >= minus#(X) because [3], by (Select) 3] s(X) >= minus#(X) because [4], by (Star) 4] s*(X) >= minus#(X) because s > minus# and [5], by (Copy) 5] s*(X) >= X because [6], by (Select) 6] X >= X by (Meta) 7] minus(X) >= X because [8], by (Star) 8] minus*(X) >= X because [9], by (Select) 9] X >= X by (Meta) 10] minus(s(X)) >= minus(X) because minus in Mul and [11], by (Fun) 11] s(X) >= X because [5], by (Star) 12] double(_|_) >= _|_ by (Bot) 13] double(s(X)) >= s(s(double(X))) because [14], by (Star) 14] double*(s(X)) >= s(s(double(X))) because double > s and [15], by (Copy) 15] double*(s(X)) >= s(double(X)) because double > s and [16], by (Copy) 16] double*(s(X)) >= double(X) because double in Mul and [17], by (Stat) 17] s(X) > X because [18], by definition 18] s*(X) >= X because [19], by (Select) 19] X >= X by (Meta) 20] plus(_|_, X) >= X because [21], by (Star) 21] plus*(_|_, X) >= X because [22], by (Select) 22] X >= X by (Meta) 23] plus(s(X), Y) >= s(plus(X, Y)) because [24], by (Star) 24] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [25], by (Copy) 25] plus*(s(X), Y) >= plus(X, Y) because [26], [29] and [31], by (Stat) 26] s(X) > X because [27], by definition 27] s*(X) >= X because [28], by (Select) 28] X >= X by (Meta) 29] plus*(s(X), Y) >= X because [30], by (Select) 30] s(X) >= X because [27], by (Star) 31] plus*(s(X), Y) >= Y because [32], by (Select) 32] Y >= Y by (Meta) 33] plus(s(X), Y) >= plus(X, s(Y)) because [34], by (Star) 34] plus*(s(X), Y) >= plus(X, s(Y)) because [35], [38] and [40], by (Stat) 35] s(X) > X because [36], by definition 36] s*(X) >= X because [37], by (Select) 37] X >= X by (Meta) 38] plus*(s(X), Y) >= X because [39], by (Select) 39] s(X) >= X because [36], by (Star) 40] plus*(s(X), Y) >= s(Y) because plus > s and [41], by (Copy) 41] plus*(s(X), Y) >= Y because [42], by (Select) 42] Y >= Y by (Meta) 43] plus(s(X), Y) >= s(plus(minus(X), double(Y))) because [44], by (Star) 44] plus*(s(X), Y) >= s(plus(minus(X), double(Y))) because plus > s and [45], by (Copy) 45] plus*(s(X), Y) >= plus(minus(X), double(Y)) because [46], [50] and [52], by (Stat) 46] s(X) > minus(X) because [47], by definition 47] s*(X) >= minus(X) because s > minus and [48], by (Copy) 48] s*(X) >= X because [49], by (Select) 49] X >= X by (Meta) 50] plus*(s(X), Y) >= minus(X) because [51], by (Select) 51] s(X) >= minus(X) because [47], by (Star) 52] plus*(s(X), Y) >= double(Y) because plus > double and [53], by (Copy) 53] plus*(s(X), Y) >= Y because [54], by (Select) 54] Y >= Y by (Meta) 55] map >= _|_ by (Bot) 56] map >= _|_ by (Bot) 57] _|_ >= _|_ by (Bot) 58] _|_ >= _|_ by (Bot) 59] _|_ >= _|_ by (Bot) 60] _|_ >= _|_ by (Bot) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_1, R_0) by ({}, R_0). 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. [Kop13] C. Kop. Static Dependency Pairs with Accessibility. Unpublished manuscript, http://cl-informatik.uibk.ac.at/users/kop/static.pdf, 2013. [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.