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). The formative rules of (P_0, R_0) are R_1 ::= 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, cons(X, Y)) => cons(F X, map(F, Y)) 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) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_0, R_0, static, formative) by (P_0, R_1, static, formative). Thus, the original system is terminating if (P_0, R_1, static, formative) is finite. We consider the dependency pair problem (P_0, R_1, 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, cons(X, Y)) >= cons(F X, map(F, Y)) 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) [[filter2#(x_1, x_2, x_3, x_4)]] = filter2#(x_2, x_4) We choose Lex = {filter, filter2} and Mul = {@_{o -> o}, cons, false, filter2#, filter#, map, map#, plus, plus#, s, times, times#, true}, and the following precedence: times# > plus# > filter2# = filter# > map > filter = filter2 > cons > times > false > map# > @_{o -> o} > true > plus > s 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, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) 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 times# in Mul, [11] and [12], by (Fun) 11] X >= X by (Meta) 12] s(Y) >= Y because [8], by (Star) 13] plus#(X, s(Y)) > plus#(X, Y) because [14], by definition 14] plus#*(X, s(Y)) >= plus#(X, Y) because plus# in Mul, [15] and [16], by (Stat) 15] X >= X by (Meta) 16] s(Y) > Y because [17], by definition 17] s*(Y) >= Y because [18], by (Select) 18] Y >= Y by (Meta) 19] plus#(s(X), Y) >= plus#(X, Y) because plus# in Mul, [20] and [23], by (Fun) 20] s(X) >= X because [21], by (Star) 21] s*(X) >= X because [22], by (Select) 22] X >= X by (Meta) 23] Y >= Y by (Meta) 24] map#(F, cons(X, Y)) >= map#(F, Y) because map# in Mul, [25] and [26], by (Fun) 25] F >= F by (Meta) 26] cons(X, Y) >= Y because [27], by (Star) 27] cons*(X, Y) >= Y because [28], by (Select) 28] Y >= Y by (Meta) 29] filter#(F, cons(X, Y)) >= filter2#(F, Y) because filter# = filter2#, filter# in Mul, [30] and [31], by (Fun) 30] F >= F by (Meta) 31] cons(X, Y) >= Y because [32], by (Star) 32] cons*(X, Y) >= Y because [33], by (Select) 33] Y >= Y by (Meta) 34] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [35] and [36], by (Fun) 35] F >= F by (Meta) 36] X >= X by (Meta) 37] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [38] and [39], by (Fun) 38] F >= F by (Meta) 39] X >= X by (Meta) 40] times(X, _|_) >= _|_ by (Bot) 41] times(X, s(Y)) >= plus(times(X, Y), X) because [42], by (Star) 42] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [43] and [46], by (Copy) 43] times*(X, s(Y)) >= times(X, Y) because times in Mul, [11] and [44], by (Stat) 44] s(Y) > Y because [45], by definition 45] s*(Y) >= Y because [9], by (Select) 46] times*(X, s(Y)) >= X because [11], by (Select) 47] plus(X, _|_) >= X because [48], by (Star) 48] plus*(X, _|_) >= X because [49], by (Select) 49] X >= X by (Meta) 50] plus(_|_, X) >= X because [51], by (Star) 51] plus*(_|_, X) >= X because [52], by (Select) 52] X >= X by (Meta) 53] plus(X, s(Y)) >= s(plus(X, Y)) because [54], by (Star) 54] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [55], by (Copy) 55] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [15] and [16], by (Stat) 56] plus(s(X), Y) >= s(plus(X, Y)) because [57], by (Star) 57] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [58], by (Copy) 58] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [59] and [23], by (Stat) 59] s(X) > X because [60], by definition 60] s*(X) >= X because [22], by (Select) 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 [25], 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, [25] and [70], by (Stat) 70] cons(X, Y) > Y because [71], by definition 71] cons*(X, Y) >= Y because [28], by (Select) 72] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [73], by (Star) 73] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [30], [74], [76], [77], [78] and [82], by (Stat) 74] cons(X, Y) > Y because [75], by definition 75] cons*(X, Y) >= Y because [33], by (Select) 76] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [77] and [78], by (Copy) 77] filter*(F, cons(X, Y)) >= F because [30], by (Select) 78] filter*(F, cons(X, Y)) >= X because [79], by (Select) 79] cons(X, Y) >= X because [80], by (Star) 80] cons*(X, Y) >= X because [81], by (Select) 81] X >= X by (Meta) 82] filter*(F, cons(X, Y)) >= Y because [31], by (Select) 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, [35], [36], [88] and [89], by (Stat) 88] filter2*(true, F, X, Y) >= F because [35], by (Select) 89] filter2*(true, F, X, Y) >= Y because [36], by (Select) 90] filter2(false, F, X, Y) >= filter(F, Y) because [91], by (Star) 91] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [38], [39], [92] and [93], by (Stat) 92] filter2*(false, F, X, Y) >= F because [38], by (Select) 93] filter2*(false, F, X, Y) >= Y because [39], 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_1, static, formative) by (P_1, R_1, static, formative), where P_1 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) 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) Thus, the original system is terminating if (P_1, R_1, static, formative) is finite. We consider the dependency pair problem (P_1, R_1, 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) 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, cons(X, Y)) >= cons(F X, map(F, Y)) 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) [[map(x_1, x_2)]] = _|_ [[plus#(x_1, x_2)]] = plus# [[times#(x_1, x_2)]] = x_2 We choose Lex = {} and Mul = {@_{o -> o}, false, filter, filter2, filter2#, filter#, map#, plus, plus#, s, times, true}, and the following precedence: false > filter2# = filter# > map# > @_{o -> o} > filter = filter2 > 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, X) >= map#(F, X) filter#(F, X) >= filter2#(F, X) 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)) _|_ >= _|_ filter(F, X) >= filter2(F, X) filter2(F, X) >= filter(F, X) filter2(F, X) >= filter(F, X) 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, X) >= map#(F, X) because map# in Mul, [8] and [9], by (Fun) 8] F >= F by (Meta) 9] X >= X by (Meta) 10] filter#(F, X) >= filter2#(F, X) because filter# = filter2#, filter# in Mul, [11] and [12], by (Fun) 11] F >= F by (Meta) 12] X >= X by (Meta) 13] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [14] and [15], by (Fun) 14] F >= F by (Meta) 15] X >= X by (Meta) 16] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [17] and [18], by (Fun) 17] F >= F by (Meta) 18] X >= X by (Meta) 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 [26], by (Copy) 22] times*(X, s(Y)) >= times(X, Y) because times 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 [5], by (Select) 26] times*(X, s(Y)) >= X because [23], by (Select) 27] plus(X, _|_) >= X because [28], by (Star) 28] plus*(X, _|_) >= X because [29], by (Select) 29] X >= X by (Meta) 30] plus(_|_, X) >= X because [31], by (Star) 31] plus*(_|_, X) >= X because [32], by (Select) 32] X >= X by (Meta) 33] plus(X, s(Y)) >= s(plus(X, Y)) because [34], by (Star) 34] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [35], by (Copy) 35] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [36] and [37], by (Stat) 36] X >= X by (Meta) 37] s(Y) > Y because [38], by definition 38] s*(Y) >= Y because [39], by (Select) 39] Y >= Y by (Meta) 40] plus(s(X), Y) >= s(plus(X, Y)) because [41], by (Star) 41] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [42], by (Copy) 42] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [43] and [46], by (Stat) 43] s(X) > X because [44], by definition 44] s*(X) >= X because [45], by (Select) 45] X >= X by (Meta) 46] Y >= Y by (Meta) 47] _|_ >= _|_ by (Bot) 48] filter(F, X) >= filter2(F, X) because filter = filter2, filter in Mul, [11] and [12], by (Fun) 49] filter2(F, X) >= filter(F, X) because filter2 = filter, filter2 in Mul, [14] and [15], by (Fun) 50] filter2(F, X) >= filter(F, X) because filter2 = filter, filter2 in Mul, [17] and [18], by (Fun) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_1, R_1, static, formative) by (P_2, R_1, static, formative), where P_2 consists of: times#(X, s(Y)) =#> times#(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) Thus, the original system is terminating if (P_2, R_1, static, formative) is finite. We consider the dependency pair problem (P_2, R_1, 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) 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, cons(X, Y)) >= cons(F X, map(F, Y)) 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) [[filter2#(x_1, x_2, x_3, x_4)]] = filter2#(x_4, x_2, x_1, x_3) [[filter#(x_1, x_2)]] = filter#(x_2, x_1) [[map#(x_1, x_2)]] = _|_ We choose Lex = {@_{o -> o}, filter, filter2, filter2#, filter#} and Mul = {cons, false, map, plus, plus#, s, times, times#, true}, and the following precedence: false > filter = filter2 > map > cons > @_{o -> o} = filter2# = filter# > 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) _|_ >= _|_ filter#(F, cons(X, Y)) >= filter2#(@_{o -> o}(F, X), F, X, Y) 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, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) 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 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] _|_ >= _|_ by (Bot) 13] filter#(F, cons(X, Y)) >= filter2#(@_{o -> o}(F, X), F, X, Y) because [14], by (Star) 14] filter#*(F, cons(X, Y)) >= filter2#(@_{o -> o}(F, X), F, X, Y) because filter# = filter2#, [15], [18], [22], [24] and [26], by (Stat) 15] cons(X, Y) > Y because [16], by definition 16] cons*(X, Y) >= Y because [17], by (Select) 17] Y >= Y by (Meta) 18] filter#*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter# = @_{o -> o}, [19], [22] and [24], by (Stat) 19] cons(X, Y) > X because [20], by definition 20] cons*(X, Y) >= X because [21], by (Select) 21] X >= X by (Meta) 22] filter#*(F, cons(X, Y)) >= F because [23], by (Select) 23] F >= F by (Meta) 24] filter#*(F, cons(X, Y)) >= X because [25], by (Select) 25] cons(X, Y) >= X because [20], by (Star) 26] filter#*(F, cons(X, Y)) >= Y because [27], by (Select) 27] cons(X, Y) >= Y because [16], by (Star) 28] filter2#(true, F, X, Y) >= filter#(F, Y) because [29], by (Star) 29] filter2#*(true, F, X, Y) >= filter#(F, Y) because filter2# = filter#, [30], [31], [32] and [33], by (Stat) 30] F >= F by (Meta) 31] Y >= Y by (Meta) 32] filter2#*(true, F, X, Y) >= F because [30], by (Select) 33] filter2#*(true, F, X, Y) >= Y because [31], by (Select) 34] filter2#(false, F, X, Y) >= filter#(F, Y) because [35], by (Star) 35] filter2#*(false, F, X, Y) >= filter#(F, Y) because filter2# = filter#, [36], [37], [38] and [39], by (Stat) 36] F >= F by (Meta) 37] Y >= Y by (Meta) 38] filter2#*(false, F, X, Y) >= F because [36], by (Select) 39] filter2#*(false, F, X, Y) >= Y because [37], by (Select) 40] times(X, _|_) >= _|_ by (Bot) 41] times(X, s(Y)) >= plus(times(X, Y), X) because [42], by (Star) 42] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [43] and [44], by (Copy) 43] times*(X, s(Y)) >= times(X, Y) because times in Mul, [3] and [4], by (Stat) 44] times*(X, s(Y)) >= X because [3], by (Select) 45] plus(X, _|_) >= X because [46], by (Star) 46] plus*(X, _|_) >= X because [47], by (Select) 47] X >= X by (Meta) 48] plus(_|_, X) >= X because [49], by (Star) 49] plus*(_|_, X) >= X because [50], by (Select) 50] X >= X by (Meta) 51] plus(X, s(Y)) >= s(plus(X, Y)) because [52], by (Star) 52] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [53], by (Copy) 53] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [54] and [55], by (Stat) 54] X >= X by (Meta) 55] s(Y) > Y because [56], by definition 56] s*(Y) >= Y because [57], by (Select) 57] Y >= Y by (Meta) 58] plus(s(X), Y) >= s(plus(X, Y)) because [59], by (Star) 59] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [60], by (Copy) 60] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [61] and [11], by (Stat) 61] s(X) > X because [62], by definition 62] s*(X) >= X because [10], by (Select) 63] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [64], by (Star) 64] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [65] and [72], by (Copy) 65] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [66] and [68], by (Copy) 66] map*(F, cons(X, Y)) >= F because [67], by (Select) 67] F >= F by (Meta) 68] map*(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] map*(F, cons(X, Y)) >= map(F, Y) because map in Mul, [73] and [74], by (Stat) 73] F >= F by (Meta) 74] cons(X, Y) > Y because [75], by definition 75] cons*(X, Y) >= Y because [76], by (Select) 76] Y >= Y by (Meta) 77] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [78], by (Star) 78] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [15], [79], [80], [81] and [82], by (Stat) 79] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [80] and [81], by (Copy) 80] filter*(F, cons(X, Y)) >= F because [23], by (Select) 81] filter*(F, cons(X, Y)) >= X because [25], by (Select) 82] filter*(F, cons(X, Y)) >= Y because [27], by (Select) 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, [30], [31], [88] and [89], by (Stat) 88] filter2*(true, F, X, Y) >= F because [30], by (Select) 89] filter2*(true, F, X, Y) >= Y because [31], by (Select) 90] filter2(false, F, X, Y) >= filter(F, Y) because [91], by (Star) 91] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [36], [37], [92] and [93], by (Stat) 92] filter2*(false, F, X, Y) >= F because [36], by (Select) 93] filter2*(false, F, X, Y) >= Y because [37], 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_1, static, formative) by (P_3, R_1, static, formative), where P_3 consists of: 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) Thus, the original system is terminating if (P_3, R_1, static, formative) is finite. We consider the dependency pair problem (P_3, R_1, 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) 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, cons(X, Y)) >= cons(F X, map(F, Y)) 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) [[filter2#(x_1, x_2, x_3, x_4)]] = filter2#(x_2, x_4) We choose Lex = {filter, filter2} and Mul = {@_{o -> o}, cons, false, filter2#, filter#, map, map#, plus, plus#, s, times, true}, and the following precedence: false > filter = filter2 > filter2# = filter# > map# > plus# > map > times > plus > s > true > cons > @_{o -> o} 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) 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, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) 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), Y) >= plus#(X, Y) because plus# in Mul, [2] and [5], by (Fun) 2] s(X) >= X because [3], by (Star) 3] s*(X) >= X because [4], by (Select) 4] X >= X by (Meta) 5] Y >= Y by (Meta) 6] map#(F, cons(X, Y)) > map#(F, Y) because [7], by definition 7] map#*(F, cons(X, Y)) >= map#(F, Y) because map# in Mul, [8] and [9], by (Stat) 8] F >= F by (Meta) 9] cons(X, Y) > Y because [10], by definition 10] cons*(X, Y) >= Y because [11], by (Select) 11] Y >= Y by (Meta) 12] filter#(F, cons(X, Y)) >= filter2#(F, Y) because filter# = filter2#, filter# in Mul, [13] and [14], by (Fun) 13] F >= F by (Meta) 14] cons(X, Y) >= Y because [15], by (Star) 15] cons*(X, Y) >= Y because [16], by (Select) 16] Y >= Y by (Meta) 17] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [18] and [19], by (Fun) 18] F >= F by (Meta) 19] X >= X by (Meta) 20] filter2#(F, X) >= filter#(F, X) because filter2# = filter#, filter2# in Mul, [21] and [22], by (Fun) 21] F >= F by (Meta) 22] X >= X by (Meta) 23] times(X, _|_) >= _|_ by (Bot) 24] times(X, s(Y)) >= plus(times(X, Y), X) because [25], by (Star) 25] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [26] and [31], by (Copy) 26] times*(X, s(Y)) >= times(X, Y) because times in Mul, [27] and [28], by (Stat) 27] X >= X by (Meta) 28] s(Y) > Y because [29], by definition 29] s*(Y) >= Y because [30], by (Select) 30] Y >= Y by (Meta) 31] times*(X, s(Y)) >= X because [27], by (Select) 32] plus(X, _|_) >= X because [33], by (Star) 33] plus*(X, _|_) >= X because [34], by (Select) 34] X >= X by (Meta) 35] plus(_|_, X) >= X because [36], by (Star) 36] plus*(_|_, X) >= X because [37], by (Select) 37] X >= X by (Meta) 38] plus(X, s(Y)) >= s(plus(X, Y)) because [39], by (Star) 39] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [40], by (Copy) 40] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [41] and [42], by (Stat) 41] X >= X by (Meta) 42] s(Y) > Y because [43], by definition 43] s*(Y) >= Y because [44], by (Select) 44] Y >= Y by (Meta) 45] plus(s(X), Y) >= s(plus(X, Y)) because [46], by (Star) 46] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [47], by (Copy) 47] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [48] and [5], by (Stat) 48] s(X) > X because [49], by definition 49] s*(X) >= X because [4], by (Select) 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 [8], 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, [8] and [9], by (Stat) 59] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [60], by (Star) 60] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [61], [63], [64], [65] and [69], by (Stat) 61] cons(X, Y) > Y because [62], by definition 62] cons*(X, Y) >= Y because [16], by (Select) 63] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter > @_{o -> o}, [64] and [65], by (Copy) 64] filter*(F, cons(X, Y)) >= F because [13], by (Select) 65] filter*(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] filter*(F, cons(X, Y)) >= Y because [14], by (Select) 70] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [71], by (Star) 71] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [72] and [74], by (Copy) 72] filter2*(true, F, X, Y) >= X because [73], by (Select) 73] X >= X by (Meta) 74] filter2*(true, F, X, Y) >= filter(F, Y) because filter2 = filter, [18], [19], [75] and [76], by (Stat) 75] filter2*(true, F, X, Y) >= F because [18], by (Select) 76] filter2*(true, F, X, Y) >= Y because [19], by (Select) 77] filter2(false, F, X, Y) >= filter(F, Y) because [78], by (Star) 78] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [21], [22], [79] and [80], by (Stat) 79] filter2*(false, F, X, Y) >= F because [21], by (Select) 80] filter2*(false, F, X, Y) >= Y because [22], 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_1, static, formative) by (P_4, R_1, static, formative), where P_4 consists of: plus#(s(X), Y) =#> plus#(X, 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) Thus, the original system is terminating if (P_4, R_1, static, formative) is finite. We consider the dependency pair problem (P_4, R_1, 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) 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, cons(X, Y)) >= cons(F X, map(F, Y)) 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_1, x_3) [[filter2#(x_1, x_2, x_3, x_4)]] = filter2#(x_3, x_4) [[filter#(x_1, x_2)]] = filter#(x_2) We choose Lex = {@_{o -> o}, filter, filter2} and Mul = {cons, false, filter2#, filter#, map, plus, plus#, s, times, true}, and the following precedence: false > map > plus# > @_{o -> o} = filter = filter2 > cons > filter2# > filter# > 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), Y) >= plus#(X, Y) filter#(cons(X, Y)) >= filter2#(X, Y) filter2#(X, Y) >= filter#(Y) filter2#(X, Y) > filter#(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, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) 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), Y) >= plus#(X, Y) because plus# in Mul, [2] and [5], by (Fun) 2] s(X) >= X because [3], by (Star) 3] s*(X) >= X because [4], by (Select) 4] X >= X by (Meta) 5] Y >= Y by (Meta) 6] filter#(cons(X, Y)) >= filter2#(X, Y) because [7], by (Star) 7] filter#*(cons(X, Y)) >= filter2#(X, Y) because [8], by (Select) 8] cons(X, Y) >= filter2#(X, Y) because [9], by (Star) 9] cons*(X, Y) >= filter2#(X, Y) because cons > filter2#, [10] and [12], by (Copy) 10] cons*(X, Y) >= X because [11], by (Select) 11] X >= X by (Meta) 12] cons*(X, Y) >= Y because [13], by (Select) 13] Y >= Y by (Meta) 14] filter2#(X, Y) >= filter#(Y) because [15], by (Star) 15] filter2#*(X, Y) >= filter#(Y) because filter2# > filter# and [16], by (Copy) 16] filter2#*(X, Y) >= Y because [17], by (Select) 17] Y >= Y by (Meta) 18] filter2#(X, Y) > filter#(Y) because [19], by definition 19] filter2#*(X, Y) >= filter#(Y) because filter2# > filter# and [20], by (Copy) 20] filter2#*(X, Y) >= Y because [21], by (Select) 21] Y >= Y by (Meta) 22] times(X, _|_) >= _|_ by (Bot) 23] times(X, s(Y)) >= plus(times(X, Y), X) because [24], by (Star) 24] times*(X, s(Y)) >= plus(times(X, Y), X) because times > plus, [25] and [30], by (Copy) 25] times*(X, s(Y)) >= times(X, Y) because times in Mul, [26] and [27], by (Stat) 26] X >= X by (Meta) 27] s(Y) > Y because [28], by definition 28] s*(Y) >= Y because [29], by (Select) 29] Y >= Y by (Meta) 30] times*(X, s(Y)) >= X because [26], by (Select) 31] plus(X, _|_) >= X because [32], by (Star) 32] plus*(X, _|_) >= X because [33], by (Select) 33] X >= X by (Meta) 34] plus(_|_, X) >= X because [35], by (Star) 35] plus*(_|_, X) >= X because [36], by (Select) 36] X >= X by (Meta) 37] plus(X, s(Y)) >= s(plus(X, Y)) because [38], by (Star) 38] plus*(X, s(Y)) >= s(plus(X, Y)) because plus > s and [39], by (Copy) 39] plus*(X, s(Y)) >= plus(X, Y) because plus in Mul, [40] and [41], by (Stat) 40] X >= X by (Meta) 41] s(Y) > Y because [42], by definition 42] s*(Y) >= Y because [43], by (Select) 43] Y >= Y by (Meta) 44] plus(s(X), Y) >= s(plus(X, Y)) because [45], by (Star) 45] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [46], by (Copy) 46] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [47] and [5], by (Stat) 47] s(X) > X because [48], by definition 48] s*(X) >= X because [4], by (Select) 49] map(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because [50], by (Star) 50] map*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), map(F, Y)) because map > cons, [51] and [58], by (Copy) 51] map*(F, cons(X, Y)) >= @_{o -> o}(F, X) because map > @_{o -> o}, [52] and [54], by (Copy) 52] map*(F, cons(X, Y)) >= F because [53], by (Select) 53] F >= F by (Meta) 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, [59] and [60], by (Stat) 59] F >= F by (Meta) 60] cons(X, Y) > Y because [61], by definition 61] cons*(X, Y) >= Y because [62], by (Select) 62] Y >= Y by (Meta) 63] filter(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because [64], by (Star) 64] filter*(F, cons(X, Y)) >= filter2(@_{o -> o}(F, X), F, X, Y) because filter = filter2, [65], [66], [67], [70], [71] and [73], by (Stat) 65] F >= F by (Meta) 66] cons(X, Y) > Y because [12], by definition 67] filter*(F, cons(X, Y)) >= @_{o -> o}(F, X) because filter = @_{o -> o}, [65], [68], [70] and [71], by (Stat) 68] cons(X, Y) > X because [69], by definition 69] cons*(X, Y) >= X because [11], by (Select) 70] filter*(F, cons(X, Y)) >= F because [65], by (Select) 71] filter*(F, cons(X, Y)) >= X because [72], by (Select) 72] cons(X, Y) >= X because [69], by (Star) 73] filter*(F, cons(X, Y)) >= Y because [74], by (Select) 74] cons(X, Y) >= Y because [12], by (Star) 75] filter2(true, F, X, Y) >= cons(X, filter(F, Y)) because [76], by (Star) 76] filter2*(true, F, X, Y) >= cons(X, filter(F, Y)) because filter2 > cons, [77] and [79], by (Copy) 77] filter2*(true, F, X, Y) >= X because [78], by (Select) 78] X >= X by (Meta) 79] filter2*(true, 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*(true, F, X, Y) >= F because [80], by (Select) 83] filter2*(true, F, X, Y) >= Y because [81], by (Select) 84] filter2(false, F, X, Y) >= filter(F, Y) because [85], by (Star) 85] filter2*(false, F, X, Y) >= filter(F, Y) because filter2 = filter, [86], [87], [88] and [89], by (Stat) 86] F >= F by (Meta) 87] Y >= Y by (Meta) 88] filter2*(false, F, X, Y) >= F because [86], by (Select) 89] filter2*(false, F, X, Y) >= Y because [87], by (Select) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_4, R_1, static, formative) by (P_5, R_1, static, formative), where P_5 consists of: plus#(s(X), Y) =#> plus#(X, Y) filter#(F, cons(X, Y)) =#> filter2#(F X, F, X, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if (P_5, R_1, static, formative) is finite. We consider the dependency pair problem (P_5, R_1, 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) filter#(F, cons(X, Y)) >? filter2#(F X, F, 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, cons(X, Y)) >= cons(F X, map(F, Y)) 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) [[map(x_1, x_2)]] = map(x_2) We choose Lex = {} and Mul = {@_{o -> o}, false, filter, filter2, filter2#, filter#, map, plus, plus#, s, times, true}, and the following precedence: @_{o -> o} > filter = filter2 > filter2# = filter# > map > plus# > false > 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), Y) > plus#(X, Y) filter#(F, X) >= filter2#(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(X) >= map(X) 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 plus# in Mul, [3] and [6], by (Stat) 3] s(X) > X because [4], by definition 4] s*(X) >= X because [5], by (Select) 5] X >= X by (Meta) 6] Y >= Y by (Meta) 7] filter#(F, X) >= filter2#(F, X) because filter# = filter2#, filter# in Mul, [8] and [9], by (Fun) 8] F >= F by (Meta) 9] X >= X 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 [6], by (Stat) 38] map(X) >= map(X) because map in Mul and [39], by (Fun) 39] X >= X by (Meta) 40] filter(F, X) >= filter2(F, X) because filter = filter2, filter in Mul, [8] and [9], by (Fun) 41] filter2(F, X) >= filter(F, X) because filter2 = filter, filter2 in Mul, [11] and [12], by (Fun) 42] filter2(F, X) >= filter(F, X) because filter2 = filter, filter2 in Mul, [43] and [44], by (Fun) 43] F >= F by (Meta) 44] 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_5, R_1, static, formative) by (P_6, R_1, static, formative), where P_6 consists of: filter#(F, cons(X, Y)) =#> filter2#(F X, F, X, Y) filter2#(true, F, X, Y) =#> filter#(F, Y) Thus, the original system is terminating if (P_6, R_1, static, formative) is finite. We consider the dependency pair problem (P_6, R_1, static, formative). The formative rules of (P_6, R_1) are R_2 ::= map(F, cons(X, Y)) => cons(F X, map(F, Y)) 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) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_6, R_1, static, formative) by (P_6, R_2, static, formative). Thus, the original system is terminating if (P_6, R_2, static, formative) is finite. We consider the dependency pair problem (P_6, R_2, 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) map(F, cons(X, Y)) >= cons(F X, map(F, Y)) 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: cons = \y0y1.1 + y1 false = 3 filter = \G0y1.y1 filter2 = \y0G1y2y3.1 + y3 filter2# = \y0G1y2y3.2 + 2y3 + 2y3G1(y3) + 2G1(y3) filter# = \G0y1.1 + 2y1 + 2y1G0(y1) map = \G0y1.y1 + 2y1G0(y1) + 2G0(0) true = 3 Using this interpretation, the requirements translate to: [[filter#(_F0, cons(_x1, _x2))]] = 3 + 2x2 + 2x2F0(1 + x2) + 2F0(1 + x2) > 2 + 2x2 + 2x2F0(x2) + 2F0(x2) = [[filter2#(_F0 _x1, _F0, _x1, _x2)]] [[filter2#(true, _F0, _x1, _x2)]] = 2 + 2x2 + 2x2F0(x2) + 2F0(x2) > 1 + 2x2 + 2x2F0(x2) = [[filter#(_F0, _x2)]] [[map(_F0, cons(_x1, _x2))]] = 1 + x2 + 2x2F0(1 + x2) + 2F0(0) + 2F0(1 + x2) >= 1 + x2 + 2x2F0(x2) + 2F0(0) = [[cons(_F0 _x1, map(_F0, _x2))]] [[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 a dependency pair problem (P_6, R_2) by ({}, R_2). 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.