We consider the system Applicative_first_order_05__#3.16. Alphabet: 0 : [] --> a cons : [c * d] --> d false : [] --> b filter : [c -> b * d] --> d filter2 : [b * c -> b * c * d] --> d map : [c -> c * d] --> d nil : [] --> d plus : [a * a] --> a s : [a] --> a times : [a * a] --> a true : [] --> b Rules: times(x, 0) => 0 times(x, s(y)) => plus(times(x, y), x) plus(x, 0) => x plus(0, x) => x plus(x, s(y)) => s(plus(x, y)) plus(s(x), y) => s(plus(x, 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] times#(X, s(Y)) =#> plus#(times(X, Y), X) 1] times#(X, s(Y)) =#> times#(X, Y) 2] plus#(X, s(Y)) =#> plus#(X, Y) 3] plus#(s(X), Y) =#> plus#(X, Y) 4] map#(F, cons(X, Y)) =#> map#(F, Y) 5] filter#(F, cons(X, Y)) =#> filter2#(F X, F, X, Y) 6] filter2#(true, F, X, Y) =#> filter#(F, Y) 7] filter2#(false, F, X, Y) =#> filter#(F, Y) Rules R_0: times(X, 0) => 0 times(X, s(Y)) => plus(times(X, Y), X) plus(X, 0) => X plus(0, X) => X plus(X, s(Y)) => s(plus(X, Y)) plus(s(X), Y) => s(plus(X, 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 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: times#(X, s(Y)) >? plus#(times(X, Y), X) times#(X, s(Y)) >? times#(X, Y) plus#(X, s(Y)) >? plus#(X, Y) plus#(s(X), Y) >? plus#(X, Y) map#(F, cons(X, Y)) >? map#(F, Y) 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) times(X, 0) >= 0 times(X, s(Y)) >= plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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]] = _|_ [[@_{o -> o}(x_1, x_2)]] = @_{o -> o}(x_2, x_1) [[filter(x_1, x_2)]] = filter(x_2, x_1) [[filter2(x_1, x_2, x_3, x_4)]] = filter2(x_4, x_2, x_3, x_1) [[filter2#(x_1, x_2, x_3, x_4)]] = filter2#(x_2, x_4) [[nil]] = _|_ We choose Lex = {@_{o -> o}, filter, filter2} and Mul = {cons, false, filter2#, filter#, map, map#, plus, plus#, s, times, times#, true}, and the following precedence: false > times = times# > map# > map > true > plus > s > @_{o -> o} = filter = filter2 > plus# > filter2# = filter# > cons Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: times#(X, s(Y)) >= plus#(times(X, Y), X) times#(X, s(Y)) >= times#(X, Y) plus#(X, s(Y)) >= plus#(X, Y) plus#(s(X), Y) >= plus#(X, Y) map#(F, cons(X, Y)) >= map#(F, Y) filter#(F, cons(X, Y)) > filter2#(F, Y) filter2#(F, X) >= filter#(F, X) filter2#(F, X) >= filter#(F, X) times(X, _|_) >= _|_ times(X, s(Y)) >= plus(times(X, Y), X) plus(X, _|_) >= X plus(_|_, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, Y)) map(F, _|_) >= _|_ map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) filter(F, _|_) >= _|_ filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) With these choices, we have: 1] times#(X, s(Y)) >= plus#(times(X, Y), X) because [2], by (Star) 2] times#*(X, s(Y)) >= plus#(times(X, Y), X) because times# > plus#, [3] and [8], by (Copy) 3] times#*(X, s(Y)) >= times(X, Y) because times# = times, times# in Mul, [4] and [5], by (Stat) 4] X >= X by (Meta) 5] s(Y) > Y because [6], by definition 6] s*(Y) >= Y because [7], by (Select) 7] Y >= Y by (Meta) 8] times#*(X, s(Y)) >= X because [4], by (Select) 9] times#(X, s(Y)) >= times#(X, Y) because times# in Mul, [4] and [10], by (Fun) 10] s(Y) >= Y because [6], by (Star) 11] plus#(X, s(Y)) >= plus#(X, Y) because plus# in Mul, [12] and [13], by (Fun) 12] X >= X by (Meta) 13] s(Y) >= Y because [14], by (Star) 14] s*(Y) >= Y because [15], by (Select) 15] Y >= Y by (Meta) 16] plus#(s(X), Y) >= plus#(X, Y) because plus# in Mul, [17] and [20], by (Fun) 17] s(X) >= X because [18], by (Star) 18] s*(X) >= X because [19], by (Select) 19] X >= X by (Meta) 20] Y >= Y by (Meta) 21] map#(F, cons(X, Y)) >= map#(F, Y) because [22], by (Star) 22] map#*(F, cons(X, Y)) >= map#(F, Y) because map# in Mul, [23] and [24], by (Stat) 23] F >= F by (Meta) 24] cons(X, Y) > Y because [25], by definition 25] cons*(X, Y) >= Y because [26], by (Select) 26] Y >= Y by (Meta) 27] filter#(F, cons(X, Y)) > filter2#(F, Y) because [28], by definition 28] filter#*(F, cons(X, Y)) >= filter2#(F, Y) because filter# = filter2#, filter# in Mul, [29] and [30], by (Stat) 29] F >= F by (Meta) 30] cons(X, Y) > Y because [31], by definition 31] cons*(X, Y) >= Y because [32], by (Select) 32] Y >= Y by (Meta) 33] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [34] and [35], by (Fun) 34] F >= F by (Meta) 35] X >= X by (Meta) 36] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [37] and [38], by (Fun) 37] F >= F by (Meta) 38] X >= X by (Meta) 39] times(X, _|_) >= _|_ by (Bot) 40] times(X, s(Y)) >= plus(times(X, Y), X) because [41], by (Star) 41] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [42] and [43], by (Copy) 42] times*(X, s(Y)) >= times(X, Y) because times in Mul, [4] and [5], by (Stat) 43] times*(X, s(Y)) >= X because [4], by (Select) 44] plus(X, _|_) >= X because [45], by (Star) 45] plus*(X, _|_) >= X because [46], by (Select) 46] X >= X by (Meta) 47] plus(_|_, X) >= X because [48], by (Star) 48] plus*(_|_, X) >= X because [49], by (Select) 49] X >= X by (Meta) 50] plus(X, s(Y)) >= s(plus(X, Y)) because [51], by (Star) 51] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [52], by (Copy) 52] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [12] and [53], by (Stat) 53] s(Y) > Y because [54], by definition 54] s*(Y) >= Y because [15], by (Select) 55] plus(s(X), Y) >= s(plus(X, Y)) because [56], by (Star) 56] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [57], by (Copy) 57] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [58] and [20], by (Stat) 58] s(X) > X because [59], by definition 59] s*(X) >= X because [19], by (Select) 60] map(F, _|_) >= _|_ by (Bot) 61] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [62], by (Star) 62] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [63] and [69], by (Copy) 63] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [64] and [65], by (Copy) 64] map*(F, cons(X, Y)) >= F because [23], by (Select) 65] map*(F, cons(X, Y)) >= X because [66], by (Select) 66] cons(X, Y) >= X because [67], by (Star) 67] cons*(X, Y) >= X because [68], by (Select) 68] X >= X by (Meta) 69] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [23] and [24], by (Stat) 70] filter(F, _|_) >= _|_ by (Bot) 71] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [72], by (Star) 72] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [30], [73], [77], [78] and [80], by (Stat) 73] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter = @_{o -> o}, [74], [77] and [78], by (Stat) 74] cons(X, Y) > X because [75], by definition 75] cons*(X, Y) >= X because [76], by (Select) 76] X >= X by (Meta) 77] filter*(F, cons(X, Y)) >= F because [29], by (Select) 78] filter*(F, cons(X, Y)) >= X because [79], by (Select) 79] cons(X, Y) >= X because [75], by (Star) 80] filter*(F, cons(X, Y)) >= Y because [81], by (Select) 81] cons(X, Y) >= Y because [31], by (Star) 82] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [83], by (Star) 83] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [84] and [86], by (Copy) 84] filter2*(true, F, X, Y) >= X because [85], by (Select) 85] X >= X by (Meta) 86] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [34], [35], [87] and [88], by (Stat) 87] filter2*(true, F, X, Y) >= F because [34], by (Select) 88] filter2*(true, F, X, Y) >= Y because [35], by (Select) 89] filter2(false, F, X, Y) >= filter(F, Y) because [90], by (Star) 90] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [37], [38], [91] and [92], by (Stat) 91] filter2*(false, F, X, Y) >= F because [37], by (Select) 92] filter2*(false, F, X, Y) >= Y because [38], by (Select) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_0, R_0, static, formative) by (P_1, R_0, static, formative), where P_1 consists of: times#(X, s(Y)) =#> plus#(times(X, Y), X) times#(X, s(Y)) =#> times#(X, Y) plus#(X, s(Y)) =#> plus#(X, Y) plus#(s(X), Y) =#> plus#(X, Y) map#(F, cons(X, Y)) =#> map#(F, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) filter2#(false, F, X, Y) =#> filter#(F, Y) 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: times#(X, s(Y)) >? plus#(times(X, Y), X) times#(X, s(Y)) >? times#(X, Y) plus#(X, s(Y)) >? plus#(X, Y) plus#(s(X), Y) >? plus#(X, Y) map#(F, cons(X, Y)) >? map#(F, Y) filter2#(true, F, X, Y) >? filter#(F, Y) filter2#(false, F, X, Y) >? filter#(F, Y) times(X, 0) >= 0 times(X, s(Y)) >= plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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_4, x_3, x_1) [[filter#(x_1, x_2)]] = x_2 [[nil]] = _|_ We choose Lex = {filter, filter2} and Mul = {@_{o -> o}, cons, false, filter2#, map, map#, plus, plus#, s, times, times#, true}, and the following precedence: map# > times# > times > plus > filter2# > filter = filter2 > map > @_{o -> o} > false > s > cons > plus# > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: times#(X, s(Y)) >= plus#(times(X, Y), X) times#(X, s(Y)) >= times#(X, Y) plus#(X, s(Y)) > plus#(X, Y) plus#(s(X), Y) >= plus#(X, Y) map#(F, cons(X, Y)) >= map#(F, Y) filter2#(true, F, X, Y) >= Y filter2#(false, F, X, Y) >= Y times(X, _|_) >= _|_ times(X, s(Y)) >= plus(times(X, Y), X) plus(X, _|_) >= X plus(_|_, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, Y)) map(F, _|_) >= _|_ map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) filter(F, _|_) >= _|_ filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) With these choices, we have: 1] times#(X, s(Y)) >= plus#(times(X, Y), X) because [2], by (Star) 2] times#*(X, s(Y)) >= plus#(times(X, Y), X) because times# > plus#, [3] and [4], by (Copy) 3] times#*(X, s(Y)) >= times(X, Y) because times# > times, [4] and [6], by (Copy) 4] times#*(X, s(Y)) >= X because [5], by (Select) 5] X >= X by (Meta) 6] times#*(X, s(Y)) >= Y because [7], by (Select) 7] s(Y) >= Y because [8], by (Star) 8] s*(Y) >= Y because [9], by (Select) 9] Y >= Y by (Meta) 10] times#(X, s(Y)) >= times#(X, Y) because [11], by (Star) 11] times#*(X, s(Y)) >= times#(X, Y) because times# in Mul, [12] and [13], by (Stat) 12] X >= X by (Meta) 13] s(Y) > Y because [14], by definition 14] s*(Y) >= Y because [9], by (Select) 15] plus#(X, s(Y)) > plus#(X, Y) because [16], by definition 16] plus#*(X, s(Y)) >= plus#(X, Y) because plus# in Mul, [17] and [18], by (Stat) 17] X >= X by (Meta) 18] s(Y) > Y because [19], by definition 19] s*(Y) >= Y because [20], by (Select) 20] Y >= Y by (Meta) 21] plus#(s(X), Y) >= plus#(X, Y) because plus# in Mul, [22] and [25], by (Fun) 22] s(X) >= X because [23], by (Star) 23] s*(X) >= X because [24], by (Select) 24] X >= X by (Meta) 25] Y >= Y by (Meta) 26] map#(F, cons(X, Y)) >= map#(F, Y) because map# in Mul, [27] and [28], by (Fun) 27] F >= F by (Meta) 28] cons(X, Y) >= Y because [29], by (Star) 29] cons*(X, Y) >= Y because [30], by (Select) 30] Y >= Y by (Meta) 31] filter2#(true, F, X, Y) >= Y because [32], by (Star) 32] filter2#*(true, F, X, Y) >= Y because [33], by (Select) 33] Y >= Y by (Meta) 34] filter2#(false, F, X, Y) >= Y because [35], by (Star) 35] filter2#*(false, F, X, Y) >= Y because [36], by (Select) 36] Y >= Y by (Meta) 37] times(X, _|_) >= _|_ by (Bot) 38] times(X, s(Y)) >= plus(times(X, Y), X) because [39], by (Star) 39] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [40] and [41], by (Copy) 40] times*(X, s(Y)) >= times(X, Y) because times in Mul, [12] and [13], by (Stat) 41] times*(X, s(Y)) >= X because [12], by (Select) 42] plus(X, _|_) >= X because [43], by (Star) 43] plus*(X, _|_) >= X because [44], by (Select) 44] X >= X by (Meta) 45] plus(_|_, X) >= X because [46], by (Star) 46] plus*(_|_, X) >= X because [47], by (Select) 47] X >= X by (Meta) 48] plus(X, s(Y)) >= s(plus(X, Y)) because [49], by (Star) 49] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [50], by (Copy) 50] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [17] and [18], by (Stat) 51] plus(s(X), Y) >= s(plus(X, Y)) because [52], by (Star) 52] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [53], by (Copy) 53] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [54] and [25], by (Stat) 54] s(X) > X because [55], by definition 55] s*(X) >= X because [24], by (Select) 56] map(F, _|_) >= _|_ by (Bot) 57] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [58], by (Star) 58] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [59] and [65], by (Copy) 59] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [60] and [61], by (Copy) 60] map*(F, cons(X, Y)) >= F because [27], by (Select) 61] map*(F, cons(X, Y)) >= X because [62], by (Select) 62] cons(X, Y) >= X because [63], by (Star) 63] cons*(X, Y) >= X because [64], by (Select) 64] X >= X by (Meta) 65] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [27] and [66], by (Stat) 66] cons(X, Y) > Y because [67], by definition 67] cons*(X, Y) >= Y because [30], by (Select) 68] filter(F, _|_) >= _|_ by (Bot) 69] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [70], by (Star) 70] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [71], [72], [75], [76], [77] and [81], by (Stat) 71] F >= F by (Meta) 72] cons(X, Y) > Y because [73], by definition 73] cons*(X, Y) >= Y because [74], by (Select) 74] Y >= Y by (Meta) 75] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [76] and [77], by (Copy) 76] filter*(F, cons(X, Y)) >= F because [71], by (Select) 77] filter*(F, cons(X, Y)) >= X because [78], by (Select) 78] cons(X, Y) >= X because [79], by (Star) 79] cons*(X, Y) >= X because [80], by (Select) 80] X >= X by (Meta) 81] filter*(F, cons(X, Y)) >= Y because [82], by (Select) 82] cons(X, Y) >= Y because [73], by (Star) 83] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [84], by (Star) 84] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [85] and [87], by (Copy) 85] filter2*(true, F, X, Y) >= X because [86], by (Select) 86] X >= X by (Meta) 87] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [88], [89], [90] and [91], by (Stat) 88] F >= F by (Meta) 89] Y >= Y by (Meta) 90] filter2*(true, F, X, Y) >= F because [88], by (Select) 91] filter2*(true, F, X, Y) >= Y because [89], by (Select) 92] filter2(false, F, X, Y) >= filter(F, Y) because [93], by (Star) 93] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [94], [95], [96] and [97], by (Stat) 94] F >= F by (Meta) 95] Y >= Y by (Meta) 96] filter2*(false, F, X, Y) >= F because [94], by (Select) 97] filter2*(false, F, X, Y) >= Y because [95], by (Select) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_1, R_0, static, formative) by (P_2, R_0, static, formative), where P_2 consists of: times#(X, s(Y)) =#> plus#(times(X, Y), X) times#(X, s(Y)) =#> times#(X, Y) plus#(s(X), Y) =#> plus#(X, Y) map#(F, cons(X, Y)) =#> map#(F, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) filter2#(false, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if (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: times#(X, s(Y)) >? plus#(times(X, Y), X) times#(X, s(Y)) >? times#(X, Y) plus#(s(X), Y) >? plus#(X, Y) map#(F, cons(X, Y)) >? map#(F, Y) filter2#(true, F, X, Y) >? filter#(F, Y) filter2#(false, F, X, Y) >? filter#(F, Y) times(X, 0) >= 0 times(X, s(Y)) >= plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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]] = _|_ [[filter(x_1, x_2)]] = filter(x_2, x_1) [[filter2(x_1, x_2, x_3, x_4)]] = filter2(x_4, x_2, x_3, x_1) [[filter#(x_1, x_2)]] = _|_ [[nil]] = _|_ [[plus#(x_1, x_2)]] = plus# [[times#(x_1, x_2)]] = x_2 We choose Lex = {filter, filter2, plus} and Mul = {@_{o -> o}, cons, false, filter2#, map, map#, plus#, s, times, true}, and the following precedence: false > filter2# > map > filter = filter2 > cons > @_{o -> o} > map# > times > plus > s > plus# > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: s(X) > plus# s(X) >= X plus# >= plus# map#(F, cons(X, Y)) >= map#(F, Y) filter2#(true, F, X, Y) >= _|_ filter2#(false, F, X, Y) >= _|_ times(X, _|_) >= _|_ times(X, s(Y)) >= plus(times(X, Y), X) plus(X, _|_) >= X plus(_|_, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, Y)) map(F, _|_) >= _|_ map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) filter(F, _|_) >= _|_ filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) With these choices, we have: 1] s(X) > plus# because [2], by definition 2] s*(X) >= plus# because s > plus#, by (Copy) 3] s(X) >= X because [4], by (Star) 4] s*(X) >= X because [5], by (Select) 5] X >= X by (Meta) 6] plus# >= plus# because plus# in Mul, by (Fun) 7] map#(F, cons(X, Y)) >= map#(F, Y) because [8], by (Star) 8] map#*(F, cons(X, Y)) >= map#(F, Y) because map# in Mul, [9] and [10], by (Stat) 9] F >= F by (Meta) 10] cons(X, Y) > Y because [11], by definition 11] cons*(X, Y) >= Y because [12], by (Select) 12] Y >= Y by (Meta) 13] filter2#(true, F, X, Y) >= _|_ by (Bot) 14] filter2#(false, F, X, Y) >= _|_ by (Bot) 15] times(X, _|_) >= _|_ by (Bot) 16] times(X, s(Y)) >= plus(times(X, Y), X) because [17], by (Star) 17] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [18] and [22], by (Copy) 18] times*(X, s(Y)) >= times(X, Y) because times in Mul, [19] and [20], by (Stat) 19] X >= X by (Meta) 20] s(Y) > Y because [21], by definition 21] s*(Y) >= Y because [5], by (Select) 22] times*(X, s(Y)) >= X because [19], by (Select) 23] plus(X, _|_) >= X because [24], by (Star) 24] plus*(X, _|_) >= X because [25], by (Select) 25] X >= X by (Meta) 26] plus(_|_, X) >= X because [27], by (Star) 27] plus*(_|_, X) >= X because [28], by (Select) 28] X >= X by (Meta) 29] plus(X, s(Y)) >= s(plus(X, Y)) because [30], by (Star) 30] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [31], by (Copy) 31] plus*(X, s(Y)) >= plus(X, Y) because [32], [33], [36] and [37], by (Stat) 32] X >= X by (Meta) 33] s(Y) > Y because [34], by definition 34] s*(Y) >= Y because [35], by (Select) 35] Y >= Y by (Meta) 36] plus*(X, s(Y)) >= X because [32], by (Select) 37] plus*(X, s(Y)) >= Y because [38], by (Select) 38] s(Y) >= Y because [34], by (Star) 39] plus(s(X), Y) >= s(plus(X, Y)) because [40], by (Star) 40] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [41], by (Copy) 41] plus*(s(X), Y) >= plus(X, Y) because [42], [45] and [47], by (Stat) 42] s(X) > X because [43], by definition 43] s*(X) >= X because [44], by (Select) 44] X >= X by (Meta) 45] plus*(s(X), Y) >= X because [46], by (Select) 46] s(X) >= X because [43], by (Star) 47] plus*(s(X), Y) >= Y because [48], by (Select) 48] Y >= Y by (Meta) 49] map(F, _|_) >= _|_ by (Bot) 50] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [51], by (Star) 51] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [52] and [58], by (Copy) 52] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [53] and [54], by (Copy) 53] map*(F, cons(X, Y)) >= F because [9], by (Select) 54] map*(F, cons(X, Y)) >= X because [55], by (Select) 55] cons(X, Y) >= X because [56], by (Star) 56] cons*(X, Y) >= X because [57], by (Select) 57] X >= X by (Meta) 58] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [9] and [10], by (Stat) 59] filter(F, _|_) >= _|_ by (Bot) 60] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [61], by (Star) 61] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [62], [65], [66], [68] and [72], by (Stat) 62] cons(X, Y) > Y because [63], by definition 63] cons*(X, Y) >= Y because [64], by (Select) 64] Y >= Y by (Meta) 65] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [66] and [68], by (Copy) 66] filter*(F, cons(X, Y)) >= F because [67], by (Select) 67] F >= F by (Meta) 68] filter*(F, cons(X, Y)) >= X because [69], by (Select) 69] cons(X, Y) >= X because [70], by (Star) 70] cons*(X, Y) >= X because [71], by (Select) 71] X >= X by (Meta) 72] filter*(F, cons(X, Y)) >= Y because [73], by (Select) 73] cons(X, Y) >= Y because [63], by (Star) 74] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [75], by (Star) 75] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [76] and [78], by (Copy) 76] filter2*(true, F, X, Y) >= X because [77], by (Select) 77] X >= X by (Meta) 78] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [79], [80], [81] and [82], by (Stat) 79] F >= F by (Meta) 80] Y >= Y by (Meta) 81] filter2*(true, F, X, Y) >= F because [79], by (Select) 82] filter2*(true, F, X, Y) >= Y because [80], by (Select) 83] filter2(false, F, X, Y) >= filter(F, Y) because [84], by (Star) 84] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [85], [86], [87] and [88], by (Stat) 85] F >= F by (Meta) 86] Y >= Y by (Meta) 87] filter2*(false, F, X, Y) >= F because [85], by (Select) 88] filter2*(false, F, X, Y) >= Y because [86], by (Select) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_2, R_0, static, formative) by (P_3, R_0, static, formative), where P_3 consists of: times#(X, s(Y)) =#> times#(X, Y) plus#(s(X), Y) =#> plus#(X, Y) map#(F, cons(X, Y)) =#> map#(F, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) filter2#(false, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if (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: times#(X, s(Y)) >? times#(X, Y) plus#(s(X), Y) >? plus#(X, Y) map#(F, cons(X, Y)) >? map#(F, Y) filter2#(true, F, X, Y) >? filter#(F, Y) filter2#(false, F, X, Y) >? filter#(F, Y) times(X, 0) >= 0 times(X, s(Y)) >= plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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]] = _|_ [[filter(x_1, x_2)]] = filter(x_2, x_1) [[filter2(x_1, x_2, x_3, x_4)]] = filter2(x_4, x_2, x_1, x_3) [[filter2#(x_1, x_2, x_3, x_4)]] = filter2#(x_4) [[filter#(x_1, x_2)]] = _|_ [[map#(x_1, x_2)]] = map#(x_2) [[nil]] = _|_ We choose Lex = {filter, filter2} and Mul = {@_{o -> o}, cons, false, filter2#, map, map#, plus, plus#, s, times, times#, true}, and the following precedence: false > filter2# > map# > plus# > times > map > plus > s > filter = filter2 > @_{o -> o} > cons > times# > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: times#(X, s(Y)) >= times#(X, Y) plus#(s(X), Y) >= plus#(X, Y) map#(cons(X, Y)) > map#(Y) filter2#(X) >= _|_ filter2#(X) >= _|_ times(X, _|_) >= _|_ times(X, s(Y)) >= plus(times(X, Y), X) plus(X, _|_) >= X plus(_|_, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, Y)) map(F, _|_) >= _|_ map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) filter(F, _|_) >= _|_ filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) With these choices, we have: 1] times#(X, s(Y)) >= times#(X, Y) because [2], by (Star) 2] times#*(X, s(Y)) >= times#(X, Y) because times# in Mul, [3] and [4], by (Stat) 3] X >= X by (Meta) 4] s(Y) > Y because [5], by definition 5] s*(Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) 7] plus#(s(X), Y) >= plus#(X, Y) because plus# in Mul, [8] and [11], by (Fun) 8] s(X) >= X because [9], by (Star) 9] s*(X) >= X because [10], by (Select) 10] X >= X by (Meta) 11] Y >= Y by (Meta) 12] map#(cons(X, Y)) > map#(Y) because [13], by definition 13] map#*(cons(X, Y)) >= map#(Y) because map# in Mul and [14], by (Stat) 14] cons(X, Y) > Y because [15], by definition 15] cons*(X, Y) >= Y because [16], by (Select) 16] Y >= Y by (Meta) 17] filter2#(X) >= _|_ by (Bot) 18] filter2#(X) >= _|_ by (Bot) 19] times(X, _|_) >= _|_ by (Bot) 20] times(X, s(Y)) >= plus(times(X, Y), X) because [21], by (Star) 21] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [22] and [23], by (Copy) 22] times*(X, s(Y)) >= times(X, Y) because times in Mul, [3] and [4], by (Stat) 23] times*(X, s(Y)) >= X because [3], by (Select) 24] plus(X, _|_) >= X because [25], by (Star) 25] plus*(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(X, s(Y)) >= s(plus(X, Y)) because [31], by (Star) 31] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [32], by (Copy) 32] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [33] and [34], by (Stat) 33] X >= X by (Meta) 34] s(Y) > Y because [35], by definition 35] s*(Y) >= Y because [36], by (Select) 36] Y >= Y by (Meta) 37] plus(s(X), Y) >= s(plus(X, Y)) because [38], by (Star) 38] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [39], by (Copy) 39] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [40] and [11], by (Stat) 40] s(X) > X because [41], by definition 41] s*(X) >= X because [10], by (Select) 42] map(F, _|_) >= _|_ by (Bot) 43] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [44], by (Star) 44] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [45] and [52], by (Copy) 45] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [46] and [48], by (Copy) 46] map*(F, cons(X, Y)) >= F because [47], by (Select) 47] F >= F by (Meta) 48] map*(F, cons(X, Y)) >= X because [49], by (Select) 49] cons(X, Y) >= X because [50], by (Star) 50] cons*(X, Y) >= X because [51], by (Select) 51] X >= X by (Meta) 52] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [53] and [14], by (Stat) 53] F >= F by (Meta) 54] filter(F, _|_) >= _|_ by (Bot) 55] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [56], by (Star) 56] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [57], [60], [61], [63] and [67], by (Stat) 57] cons(X, Y) > Y because [58], by definition 58] cons*(X, Y) >= Y because [59], by (Select) 59] Y >= Y by (Meta) 60] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [61] and [63], by (Copy) 61] filter*(F, cons(X, Y)) >= F because [62], by (Select) 62] F >= F by (Meta) 63] filter*(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] filter*(F, cons(X, Y)) >= Y because [68], by (Select) 68] cons(X, Y) >= Y because [58], by (Star) 69] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [70], by (Star) 70] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [71] and [73], by (Copy) 71] filter2*(true, F, X, Y) >= X because [72], by (Select) 72] X >= X by (Meta) 73] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [74], [75], [76] and [77], by (Stat) 74] F >= F by (Meta) 75] Y >= Y by (Meta) 76] filter2*(true, F, X, Y) >= F because [74], by (Select) 77] filter2*(true, F, X, Y) >= Y because [75], by (Select) 78] filter2(false, F, X, Y) >= filter(F, Y) because [79], by (Star) 79] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [80], [81], [82] and [83], by (Stat) 80] F >= F by (Meta) 81] Y >= Y by (Meta) 82] filter2*(false, F, X, Y) >= F because [80], by (Select) 83] filter2*(false, F, X, Y) >= Y because [81], by (Select) 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_4, R_0, static, formative), where P_4 consists of: times#(X, s(Y)) =#> times#(X, Y) plus#(s(X), Y) =#> plus#(X, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) filter2#(false, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if (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: times#(X, s(Y)) >? times#(X, Y) plus#(s(X), Y) >? plus#(X, Y) filter2#(true, F, X, Y) >? filter#(F, Y) filter2#(false, F, X, Y) >? filter#(F, Y) times(X, 0) >= 0 times(X, s(Y)) >= plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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)]] = _|_ [[filter2#(x_1, x_2, x_3, x_4)]] = filter2#(x_2, x_4) [[nil]] = _|_ We choose Lex = {} and Mul = {@_{o -> o}, false, filter2#, filter#, map, plus, plus#, s, times, times#, true}, and the following precedence: @_{o -> o} > false > filter2# = filter# > map > plus# > times > plus > s > times# > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: times#(X, s(Y)) > times#(X, Y) plus#(s(X), Y) >= plus#(X, Y) filter2#(F, X) >= filter#(F, X) filter2#(F, X) >= filter#(F, X) times(X, _|_) >= _|_ times(X, s(Y)) >= plus(times(X, Y), X) plus(X, _|_) >= X plus(_|_, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, Y)) map(F, _|_) >= _|_ map(F, _|_) >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ With these choices, we have: 1] times#(X, s(Y)) > times#(X, Y) because [2], by definition 2] times#*(X, s(Y)) >= times#(X, Y) because times# in Mul, [3] and [4], by (Stat) 3] X >= X by (Meta) 4] s(Y) > Y because [5], by definition 5] s*(Y) >= Y because [6], by (Select) 6] Y >= Y by (Meta) 7] plus#(s(X), Y) >= plus#(X, Y) because plus# in Mul, [8] and [11], by (Fun) 8] s(X) >= X because [9], by (Star) 9] s*(X) >= X because [10], by (Select) 10] X >= X by (Meta) 11] Y >= Y by (Meta) 12] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [13] and [14], by (Fun) 13] F >= F by (Meta) 14] X >= X by (Meta) 15] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [16] and [17], by (Fun) 16] F >= F by (Meta) 17] X >= X by (Meta) 18] times(X, _|_) >= _|_ by (Bot) 19] times(X, s(Y)) >= plus(times(X, Y), X) because [20], by (Star) 20] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [21] and [22], by (Copy) 21] times*(X, s(Y)) >= times(X, Y) because times in Mul, [3] and [4], by (Stat) 22] times*(X, s(Y)) >= X because [3], by (Select) 23] plus(X, _|_) >= X because [24], by (Star) 24] plus*(X, _|_) >= X because [25], by (Select) 25] X >= X by (Meta) 26] plus(_|_, X) >= X because [27], by (Star) 27] plus*(_|_, X) >= X because [28], by (Select) 28] X >= X by (Meta) 29] plus(X, s(Y)) >= s(plus(X, Y)) because [30], by (Star) 30] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [31], by (Copy) 31] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [32] and [33], by (Stat) 32] X >= X by (Meta) 33] s(Y) > Y because [34], by definition 34] s*(Y) >= Y because [35], by (Select) 35] Y >= Y 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 plus in Mul, [39] and [11], by (Stat) 39] s(X) > X because [40], by definition 40] s*(X) >= X because [10], by (Select) 41] map(F, _|_) >= _|_ by (Bot) 42] map(F, _|_) >= _|_ by (Bot) 43] _|_ >= _|_ by (Bot) 44] _|_ >= _|_ by (Bot) 45] _|_ >= _|_ by (Bot) 46] _|_ >= _|_ by (Bot) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_4, R_0, static, formative) by (P_5, R_0, static, formative), where P_5 consists of: plus#(s(X), Y) =#> plus#(X, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) filter2#(false, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if (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: plus#(s(X), Y) >? plus#(X, Y) filter2#(true, F, X, Y) >? filter#(F, Y) filter2#(false, F, X, Y) >? filter#(F, Y) times(X, 0) >= 0 times(X, s(Y)) >= plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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]] = _|_ [[@_{o -> o}(x_1, x_2)]] = @_{o -> o}(x_2, x_1) [[filter(x_1, x_2)]] = filter(x_2, x_1) [[filter2(x_1, x_2, x_3, x_4)]] = filter2(x_4, x_2, x_1, x_3) [[nil]] = _|_ [[plus#(x_1, x_2)]] = plus#(x_1) We choose Lex = {@_{o -> o}, filter, filter2} and Mul = {cons, false, filter2#, filter#, map, plus, plus#, s, times, true}, and the following precedence: false > filter2# > filter# > map > @_{o -> o} = filter = filter2 > cons > plus# > times > plus > s > true 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) filter2#(true, F, X, Y) >= filter#(F, Y) filter2#(false, F, X, Y) > filter#(F, Y) times(X, _|_) >= _|_ times(X, s(Y)) >= plus(times(X, Y), X) plus(X, _|_) >= X plus(_|_, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, Y)) map(F, _|_) >= _|_ map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) filter(F, _|_) >= _|_ filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) filter2(true, F, X, Y) >= cons(X, filter(F, Y)) filter2(false, F, X, Y) >= filter(F, Y) 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] filter2#(true, F, X, Y) >= filter#(F, Y) because [6], by (Star) 6] filter2#*(true, F, X, Y) >= filter#(F, Y) because filter2# > filter#, [7] and [9], by (Copy) 7] filter2#*(true, F, X, Y) >= F because [8], by (Select) 8] F >= F by (Meta) 9] filter2#*(true, F, X, Y) >= Y because [10], by (Select) 10] Y >= Y by (Meta) 11] filter2#(false, F, X, Y) > filter#(F, Y) because [12], by definition 12] filter2#*(false, F, X, Y) >= filter#(F, Y) because filter2# > filter#, [13] and [15], by (Copy) 13] filter2#*(false, F, X, Y) >= F because [14], by (Select) 14] F >= F by (Meta) 15] filter2#*(false, F, X, Y) >= Y because [16], by (Select) 16] Y >= Y by (Meta) 17] times(X, _|_) >= _|_ by (Bot) 18] times(X, s(Y)) >= plus(times(X, Y), X) because [19], by (Star) 19] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [20] and [25], by (Copy) 20] times*(X, s(Y)) >= times(X, Y) because times in Mul, [21] and [22], by (Stat) 21] X >= X by (Meta) 22] s(Y) > Y because [23], by definition 23] s*(Y) >= Y because [24], by (Select) 24] Y >= Y by (Meta) 25] times*(X, s(Y)) >= X because [21], by (Select) 26] plus(X, _|_) >= X because [27], by (Star) 27] plus*(X, _|_) >= X because [28], by (Select) 28] X >= X by (Meta) 29] plus(_|_, X) >= X because [30], by (Star) 30] plus*(_|_, X) >= X because [31], by (Select) 31] X >= X by (Meta) 32] plus(X, s(Y)) >= s(plus(X, Y)) because [33], by (Star) 33] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [34], by (Copy) 34] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [35] and [36], by (Stat) 35] X >= X by (Meta) 36] s(Y) > Y because [37], by definition 37] s*(Y) >= Y because [38], by (Select) 38] Y >= Y by (Meta) 39] plus(s(X), Y) >= s(plus(X, Y)) because [40], by (Star) 40] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [41], by (Copy) 41] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [42] and [44], by (Stat) 42] s(X) > X because [43], by definition 43] s*(X) >= X because [4], by (Select) 44] Y >= Y by (Meta) 45] map(F, _|_) >= _|_ by (Bot) 46] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [47], by (Star) 47] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [48] and [55], by (Copy) 48] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [49] and [51], by (Copy) 49] map*(F, cons(X, Y)) >= F because [50], by (Select) 50] F >= F by (Meta) 51] map*(F, cons(X, Y)) >= X because [52], by (Select) 52] cons(X, Y) >= X because [53], by (Star) 53] cons*(X, Y) >= X because [54], by (Select) 54] X >= X by (Meta) 55] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [56] and [57], by (Stat) 56] F >= F by (Meta) 57] cons(X, Y) > Y because [58], by definition 58] cons*(X, Y) >= Y because [59], by (Select) 59] Y >= Y by (Meta) 60] filter(F, _|_) >= _|_ by (Bot) 61] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [62], by (Star) 62] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [63], [66], [70], [72] and [74], by (Stat) 63] cons(X, Y) > Y because [64], by definition 64] cons*(X, Y) >= Y because [65], by (Select) 65] Y >= Y by (Meta) 66] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter = @_{o -> o}, [67], [70] and [72], by (Stat) 67] cons(X, Y) > X because [68], by definition 68] cons*(X, Y) >= X because [69], by (Select) 69] X >= X by (Meta) 70] filter*(F, cons(X, Y)) >= F because [71], by (Select) 71] F >= F by (Meta) 72] filter*(F, cons(X, Y)) >= X because [73], by (Select) 73] cons(X, Y) >= X because [68], by (Star) 74] filter*(F, cons(X, Y)) >= Y because [75], by (Select) 75] cons(X, Y) >= Y because [64], by (Star) 76] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [77], by (Star) 77] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [78] and [80], by (Copy) 78] filter2*(true, F, X, Y) >= X because [79], by (Select) 79] X >= X by (Meta) 80] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [81], [82], [83] and [84], by (Stat) 81] F >= F by (Meta) 82] Y >= Y by (Meta) 83] filter2*(true, F, X, Y) >= F because [81], by (Select) 84] filter2*(true, F, X, Y) >= Y because [82], by (Select) 85] filter2(false, F, X, Y) >= filter(F, Y) because [86], by (Star) 86] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [87], [88], [89] and [90], by (Stat) 87] F >= F by (Meta) 88] Y >= Y by (Meta) 89] filter2*(false, F, X, Y) >= F because [87], by (Select) 90] filter2*(false, F, X, Y) >= Y because [88], by (Select) 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: plus#(s(X), Y) =#> plus#(X, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if (P_6, R_0, static, formative) is finite. We consider the dependency pair problem (P_6, 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) filter2#(true, F, X, Y) >? filter#(F, Y) times(X, 0) >= 0 times(X, s(Y)) >= plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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) [[filter2#(x_1, x_2, x_3, x_4)]] = filter2#(x_2, x_4) [[nil]] = _|_ We choose Lex = {plus#} and Mul = {@_{o -> o}, false, filter, filter2, filter2#, filter#, map, plus, s, times, true}, and the following precedence: false > map > @_{o -> o} > filter = filter2 > plus# > times > plus > s > filter2# = filter# > 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, Y) filter2#(F, X) >= filter#(F, X) times(X, _|_) >= _|_ times(X, s(Y)) >= plus(times(X, Y), X) plus(X, _|_) >= X plus(_|_, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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), Y) > plus#(X, Y) because [2], by definition 2] plus#*(s(X), Y) >= plus#(X, 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) >= Y because [9], by (Select) 9] Y >= Y by (Meta) 10] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [11] and [12], by (Fun) 11] F >= F by (Meta) 12] X >= X by (Meta) 13] times(X, _|_) >= _|_ by (Bot) 14] times(X, s(Y)) >= plus(times(X, Y), X) because [15], by (Star) 15] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [16] and [21], by (Copy) 16] times*(X, s(Y)) >= times(X, Y) because times in Mul, [17] and [18], by (Stat) 17] X >= X by (Meta) 18] s(Y) > Y because [19], by definition 19] s*(Y) >= Y because [20], by (Select) 20] Y >= Y by (Meta) 21] times*(X, s(Y)) >= X because [17], by (Select) 22] plus(X, _|_) >= X because [23], by (Star) 23] plus*(X, _|_) >= X because [24], by (Select) 24] X >= X by (Meta) 25] plus(_|_, X) >= X because [26], by (Star) 26] plus*(_|_, X) >= X because [27], by (Select) 27] X >= X by (Meta) 28] plus(X, s(Y)) >= s(plus(X, Y)) because [29], by (Star) 29] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [30], by (Copy) 30] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [31] and [32], by (Stat) 31] X >= X by (Meta) 32] s(Y) > Y because [33], by definition 33] s*(Y) >= Y because [34], by (Select) 34] Y >= Y by (Meta) 35] plus(s(X), Y) >= s(plus(X, Y)) because [36], by (Star) 36] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [37], by (Copy) 37] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [3] and [38], by (Stat) 38] Y >= Y by (Meta) 39] map(F, _|_) >= _|_ by (Bot) 40] map(F, X) >= map(F, X) because map in Mul, [41] and [42], by (Fun) 41] F >= F by (Meta) 42] X >= X by (Meta) 43] filter(F, _|_) >= _|_ by (Bot) 44] filter(F, X) >= filter2(F, X) because filter = filter2, filter in Mul, [45] and [46], by (Fun) 45] F >= F by (Meta) 46] X >= X by (Meta) 47] filter2(F, X) >= filter(F, X) because filter2 = filter, filter2 in Mul, [11] and [12], by (Fun) 48] filter2(F, X) >= filter(F, X) because filter2 = filter, filter2 in Mul, [49] and [50], by (Fun) 49] F >= F by (Meta) 50] 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_6, R_0, static, formative) by (P_7, R_0, static, formative), where P_7 consists of: filter2#(true, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if (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: filter2#(true, F, X, Y) >? filter#(F, Y) times(X, 0) >= 0 times(X, s(Y)) >= plus(times(X, Y), X) plus(X, 0) >= X plus(0, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, 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)]] = _|_ [[filter#(x_1, x_2)]] = filter#(x_1) [[map(x_1, x_2)]] = map [[nil]] = _|_ We choose Lex = {} and Mul = {@_{o -> o}, false, filter2#, filter#, map, plus, s, times, true}, and the following precedence: @_{o -> o} > false > filter2# > filter# > map > times > plus > s > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: filter2#(true, F, X, Y) > filter#(F) times(X, _|_) >= _|_ times(X, s(Y)) >= plus(times(X, Y), X) plus(X, _|_) >= X plus(_|_, X) >= X plus(X, s(Y)) >= s(plus(X, Y)) plus(s(X), Y) >= s(plus(X, Y)) map >= _|_ map >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ With these choices, we have: 1] filter2#(true, F, X, Y) > filter#(F) because [2], by definition 2] filter2#*(true, F, X, Y) >= filter#(F) because filter2# > filter# and [3], by (Copy) 3] filter2#*(true, F, X, Y) >= F because [4], by (Select) 4] F >= F by (Meta) 5] times(X, _|_) >= _|_ by (Bot) 6] times(X, s(Y)) >= plus(times(X, Y), X) because [7], by (Star) 7] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [8] and [13], by (Copy) 8] times*(X, s(Y)) >= times(X, Y) because times in Mul, [9] and [10], by (Stat) 9] X >= X by (Meta) 10] s(Y) > Y because [11], by definition 11] s*(Y) >= Y because [12], by (Select) 12] Y >= Y by (Meta) 13] times*(X, s(Y)) >= X because [9], by (Select) 14] plus(X, _|_) >= X because [15], by (Star) 15] plus*(X, _|_) >= X because [16], by (Select) 16] X >= X by (Meta) 17] plus(_|_, X) >= X because [18], by (Star) 18] plus*(_|_, X) >= X because [19], by (Select) 19] X >= X by (Meta) 20] plus(X, s(Y)) >= s(plus(X, Y)) because [21], by (Star) 21] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [22], by (Copy) 22] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [23] and [24], by (Stat) 23] X >= X by (Meta) 24] s(Y) > Y because [25], by definition 25] s*(Y) >= Y because [26], by (Select) 26] Y >= Y by (Meta) 27] plus(s(X), Y) >= s(plus(X, Y)) because [28], by (Star) 28] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [29], by (Copy) 29] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [30] and [33], by (Stat) 30] s(X) > X because [31], by definition 31] s*(X) >= X because [32], by (Select) 32] X >= X by (Meta) 33] Y >= Y by (Meta) 34] map >= _|_ by (Bot) 35] map >= _|_ by (Bot) 36] _|_ >= _|_ by (Bot) 37] _|_ >= _|_ by (Bot) 38] _|_ >= _|_ by (Bot) 39] _|_ >= _|_ by (Bot) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_7, 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.