We consider the system from. Alphabet: chain : [N -> N * list] --> list cons : [N * list] --> list false : [] --> B from : [N * list] --> list if : [B * list * list] --> list incch : [list] --> list lteq : [N * N] --> B nil : [] --> list o : [] --> N s : [N] --> N true : [] --> B Rules: if(true, x, y) => x if(false, x, y) => y lteq(s(x), o) => false lteq(o, x) => true lteq(s(x), s(y)) => lteq(x, y) from(x, nil) => nil from(x, cons(y, z)) => if(lteq(x, y), cons(y, z), from(x, z)) chain(f, nil) => nil chain(f, cons(x, y)) => cons(f x, chain(f, from(f x, y))) incch(x) => chain(/\y.s(y), x) 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 dynamic dependency pairs. After applying [Kop12, Thm. 7.22] to denote collapsing dependency pairs in an extended form, we thus obtain the following dependency pair problem (P_0, R_0, minimal, formative): Dependency Pairs P_0: 0] lteq#(s(X), s(Y)) =#> lteq#(X, Y) 1] from#(X, cons(Y, Z)) =#> if#(lteq(X, Y), cons(Y, Z), from(X, Z)) 2] from#(X, cons(Y, Z)) =#> lteq#(X, Y) 3] from#(X, cons(Y, Z)) =#> from#(X, Z) 4] chain#(F, cons(X, Y)) =#> F(X) 5] chain#(F, cons(X, Y)) =#> chain#(F, from(F X, Y)) 6] chain#(F, cons(X, Y)) =#> from#(F X, Y) 7] chain#(F, cons(X, Y)) =#> F(X) 8] incch#(X) =#> chain#(/\x.s(x), X) Rules R_0: if(true, X, Y) => X if(false, X, Y) => Y lteq(s(X), o) => false lteq(o, X) => true lteq(s(X), s(Y)) => lteq(X, Y) from(X, nil) => nil from(X, cons(Y, Z)) => if(lteq(X, Y), cons(Y, Z), from(X, Z)) chain(F, nil) => nil chain(F, cons(X, Y)) => cons(F X, chain(F, from(F X, Y))) incch(X) => chain(/\x.s(x), X) Thus, the original system is terminating if (P_0, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_0, R_0, minimal, formative). We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : 0 * 1 : * 2 : 0 * 3 : 1, 2, 3 * 4 : 0, 1, 2, 3, 4, 5, 6, 7, 8 * 5 : 4, 5, 6, 7 * 6 : 1, 2, 3 * 7 : 0, 1, 2, 3, 4, 5, 6, 7, 8 * 8 : 4, 5, 6, 7 This graph has the following strongly connected components: P_1: lteq#(s(X), s(Y)) =#> lteq#(X, Y) P_2: from#(X, cons(Y, Z)) =#> from#(X, Z) P_3: chain#(F, cons(X, Y)) =#> F(X) chain#(F, cons(X, Y)) =#> chain#(F, from(F X, Y)) chain#(F, cons(X, Y)) =#> F(X) incch#(X) =#> chain#(/\x.s(x), X) By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_0, R_0, m, f) by (P_1, R_0, m, f), (P_2, R_0, m, f) and (P_3, R_0, m, f). Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative) and (P_3, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_3, R_0, minimal, formative). The formative rules of (P_3, R_0) are R_1 ::= if(true, X, Y) => X if(false, X, Y) => Y lteq(s(X), o) => false lteq(o, X) => true lteq(s(X), s(Y)) => lteq(X, Y) from(X, cons(Y, Z)) => if(lteq(X, Y), cons(Y, Z), from(X, Z)) chain(F, cons(X, Y)) => cons(F X, chain(F, from(F X, Y))) incch(X) => chain(/\x.s(x), X) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_3, R_0, minimal, formative) by (P_3, R_1, minimal, formative). Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative) and (P_3, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_3, R_1, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. As the system is abstraction-simple and the formative flag is set, it suffices to find a tagged reduction pair [Kop12, Def. 6.70]. Thus, we must orient: chain#(F, cons(X, Y)) >? F(X) chain#(F, cons(X, Y)) >? chain#(F, from(F X, Y)) chain#(F, cons(X, Y)) >? F(X) incch#(X) >? chain#(/\x.s-(x), X) if(true, X, Y) >= X if(false, X, Y) >= Y lteq(s(X), o) >= false lteq(o, X) >= true lteq(s(X), s(Y)) >= lteq(X, Y) from(X, cons(Y, Z)) >= if(lteq(X, Y), cons(Y, Z), from(X, Z)) chain(F, cons(X, Y)) >= cons(F X, chain(F, from(F X, Y))) incch(X) >= chain(/\x.s-(x), X) s-(X) >= s(X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( incch(X) ) = #argfun-incch#(chain(/\x.s-(x), X)) pi( incch#(X) ) = #argfun-incch##(chain#(/\x.s-(x), X)) 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: [[false]] = _|_ [[from(x_1, x_2)]] = from(x_2) [[incch(x_1)]] = x_1 [[incch#(x_1)]] = x_1 [[lteq(x_1, x_2)]] = _|_ [[true]] = _|_ We choose Lex = {} and Mul = {#argfun-incch#, #argfun-incch##, @_{o -> o}, chain, chain#, cons, from, if, o, s, s-}, and the following precedence: #argfun-incch## > #argfun-incch# > s = s- > o > chain# > chain > @_{o -> o} > cons > from > if Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) chain#(F, cons(X, Y)) >= chain#(F, from(Y)) chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) #argfun-incch##(chain#(/\x.s-(x), X)) > chain#(/\x.s-(x), X) if(_|_, X, Y) >= X if(_|_, X, Y) >= Y _|_ >= _|_ _|_ >= _|_ _|_ >= _|_ from(cons(X, Y)) >= if(_|_, cons(X, Y), from(Y)) chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) s-(X) >= s(X) With these choices, we have: 1] chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) because [2], by (Star) 2] chain#*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain# > @_{o -> o}, [3] and [5], by (Copy) 3] chain#*(F, cons(X, Y)) >= F because [4], by (Select) 4] F >= F by (Meta) 5] chain#*(F, cons(X, Y)) >= X because [6], by (Select) 6] cons(X, Y) >= X because [7], by (Star) 7] cons*(X, Y) >= X because [8], by (Select) 8] X >= X by (Meta) 9] chain#(F, cons(X, Y)) >= chain#(F, from(Y)) because chain# in Mul, [10] and [11], by (Fun) 10] F >= F by (Meta) 11] cons(X, Y) >= from(Y) because [12], by (Star) 12] cons*(X, Y) >= from(Y) because cons > from and [13], by (Copy) 13] cons*(X, Y) >= Y because [14], by (Select) 14] Y >= Y by (Meta) 15] chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) because [2], by (Star) 16] #argfun-incch##(chain#(/\x.s-(x), X)) > chain#(/\x.s-(x), X) because [17], by definition 17] #argfun-incch##*(chain#(/\x.s-(x), X)) >= chain#(/\x.s-(x), X) because #argfun-incch## > chain#, [18] and [22], by (Copy) 18] #argfun-incch##*(chain#(/\x.s-(x), X)) >= /\x.s-(x) because [19], by (F-Abs) 19] #argfun-incch##*(chain#(/\x.s-(x), X), y) >= s-(y) because #argfun-incch## > s- and [20], by (Copy) 20] #argfun-incch##*(chain#(/\x.s-(x), X), y) >= y because [21], by (Select) 21] y >= y by (Var) 22] #argfun-incch##*(chain#(/\x.s-(x), X)) >= X because [23], by (Select) 23] chain#(/\x.s-(x), X) >= X because [24], by (Star) 24] chain#*(/\x.s-(x), X) >= X because [25], by (Select) 25] X >= X by (Meta) 26] if(_|_, X, Y) >= X because [27], by (Star) 27] if*(_|_, X, Y) >= X because [28], by (Select) 28] X >= X by (Meta) 29] if(_|_, X, Y) >= Y because [30], by (Star) 30] if*(_|_, X, Y) >= Y because [31], by (Select) 31] Y >= Y by (Meta) 32] _|_ >= _|_ by (Bot) 33] _|_ >= _|_ by (Bot) 34] _|_ >= _|_ by (Bot) 35] from(cons(X, Y)) >= if(_|_, cons(X, Y), from(Y)) because [36], by (Star) 36] from*(cons(X, Y)) >= if(_|_, cons(X, Y), from(Y)) because from > if, [37], [38] and [42], by (Copy) 37] from*(cons(X, Y)) >= _|_ by (Bot) 38] from*(cons(X, Y)) >= cons(X, Y) because [39], by (Select) 39] cons(X, Y) >= cons(X, Y) because cons in Mul, [40] and [41], by (Fun) 40] X >= X by (Meta) 41] Y >= Y by (Meta) 42] from*(cons(X, Y)) >= from(Y) because [43], by (Select) 43] cons(X, Y) >= from(Y) because [44], by (Star) 44] cons*(X, Y) >= from(Y) because cons > from and [45], by (Copy) 45] cons*(X, Y) >= Y because [41], by (Select) 46] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [47], by (Star) 47] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [48] and [51], by (Copy) 48] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [49] and [50], by (Copy) 49] chain*(F, cons(X, Y)) >= F because [10], by (Select) 50] chain*(F, cons(X, Y)) >= X because [6], by (Select) 51] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [10] and [52], by (Stat) 52] cons(X, Y) > from(Y) because [53], by definition 53] cons*(X, Y) >= from(Y) because cons > from and [13], by (Copy) 54] #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because [55], by (Star) 55] #argfun-incch#*(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because #argfun-incch# > chain, [56] and [60], by (Copy) 56] #argfun-incch#*(chain(/\x.s-(x), X)) >= /\x.s-(x) because [57], by (F-Abs) 57] #argfun-incch#*(chain(/\x.s-(x), X), y) >= s-(y) because #argfun-incch# > s- and [58], by (Copy) 58] #argfun-incch#*(chain(/\x.s-(x), X), y) >= y because [59], by (Select) 59] y >= y by (Var) 60] #argfun-incch#*(chain(/\x.s-(x), X)) >= X because [61], by (Select) 61] chain(/\x.s-(x), X) >= X because [62], by (Star) 62] chain*(/\x.s-(x), X) >= X because [25], by (Select) 63] s-(X) >= s(X) because s- = s, s- in Mul and [64], by (Fun) 64] X >= X by (Meta) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_3, R_1, minimal, formative) by (P_4, R_1, minimal, formative), where P_4 consists of: chain#(F, cons(X, Y)) =#> F(X) chain#(F, cons(X, Y)) =#> chain#(F, from(F X, Y)) chain#(F, cons(X, Y)) =#> F(X) Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative) and (P_4, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_4, R_1, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. As the system is abstraction-simple and the formative flag is set, it suffices to find a tagged reduction pair [Kop12, Def. 6.70]. Thus, we must orient: chain#(F, cons(X, Y)) >? F(X) chain#(F, cons(X, Y)) >? chain#(F, from(F X, Y)) chain#(F, cons(X, Y)) >? F(X) if(true, X, Y) >= X if(false, X, Y) >= Y lteq(s(X), o) >= false lteq(o, X) >= true lteq(s(X), s(Y)) >= lteq(X, Y) from(X, cons(Y, Z)) >= if(lteq(X, Y), cons(Y, Z), from(X, Z)) chain(F, cons(X, Y)) >= cons(F X, chain(F, from(F X, Y))) incch(X) >= chain(/\x.s-(x), X) s-(X) >= s(X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( incch(X) ) = #argfun-incch#(chain(/\x.s-(x), X)) 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: [[false]] = _|_ [[from(x_1, x_2)]] = from(x_2) [[if(x_1, x_2, x_3)]] = if(x_2, x_3) [[incch(x_1)]] = x_1 [[true]] = _|_ We choose Lex = {} and Mul = {#argfun-incch#, @_{o -> o}, chain, chain#, cons, from, if, lteq, o, s, s-}, and the following precedence: o > lteq > #argfun-incch# > s = s- > chain > @_{o -> o} = chain# > cons > from > if Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) chain#(F, cons(X, Y)) > chain#(F, from(Y)) chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) if(X, Y) >= X if(X, Y) >= Y lteq(s(X), o) >= _|_ lteq(o, X) >= _|_ lteq(s(X), s(Y)) >= lteq(X, Y) from(cons(X, Y)) >= if(cons(X, Y), from(Y)) chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) s-(X) >= s(X) With these choices, we have: 1] chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain# = @_{o -> o}, chain# in Mul, [2] and [3], by (Fun) 2] F >= F by (Meta) 3] cons(X, Y) >= X because [4], by (Star) 4] cons*(X, Y) >= X because [5], by (Select) 5] X >= X by (Meta) 6] chain#(F, cons(X, Y)) > chain#(F, from(Y)) because [7], by definition 7] chain#*(F, cons(X, Y)) >= chain#(F, from(Y)) because chain# in Mul, [2] and [8], by (Stat) 8] cons(X, Y) > from(Y) because [9], by definition 9] cons*(X, Y) >= from(Y) because cons > from and [10], by (Copy) 10] cons*(X, Y) >= Y because [11], by (Select) 11] Y >= Y by (Meta) 12] chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain# = @_{o -> o}, chain# in Mul, [2] and [3], by (Fun) 13] if(X, Y) >= X because [14], by (Star) 14] if*(X, Y) >= X because [15], by (Select) 15] X >= X by (Meta) 16] if(X, Y) >= Y because [17], by (Star) 17] if*(X, Y) >= Y because [18], by (Select) 18] Y >= Y by (Meta) 19] lteq(s(X), o) >= _|_ by (Bot) 20] lteq(o, X) >= _|_ by (Bot) 21] lteq(s(X), s(Y)) >= lteq(X, Y) because [22], by (Star) 22] lteq*(s(X), s(Y)) >= lteq(X, Y) because lteq in Mul, [23] and [26], by (Stat) 23] s(X) > X because [24], by definition 24] s*(X) >= X because [25], by (Select) 25] X >= X by (Meta) 26] s(Y) >= Y because [27], by (Star) 27] s*(Y) >= Y because [28], by (Select) 28] Y >= Y by (Meta) 29] from(cons(X, Y)) >= if(cons(X, Y), from(Y)) because [30], by (Star) 30] from*(cons(X, Y)) >= if(cons(X, Y), from(Y)) because from > if, [31] and [35], by (Copy) 31] from*(cons(X, Y)) >= cons(X, Y) because [32], by (Select) 32] cons(X, Y) >= cons(X, Y) because cons in Mul, [33] and [34], by (Fun) 33] X >= X by (Meta) 34] Y >= Y by (Meta) 35] from*(cons(X, Y)) >= from(Y) because from in Mul and [36], by (Stat) 36] cons(X, Y) > Y because [37], by definition 37] cons*(X, Y) >= Y because [34], by (Select) 38] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [39], by (Star) 39] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [40] and [43], by (Copy) 40] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [41] and [42], by (Copy) 41] chain*(F, cons(X, Y)) >= F because [2], by (Select) 42] chain*(F, cons(X, Y)) >= X because [3], by (Select) 43] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [2] and [8], by (Stat) 44] #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because [45], by (Star) 45] #argfun-incch#*(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because #argfun-incch# > chain, [46] and [50], by (Copy) 46] #argfun-incch#*(chain(/\x.s-(x), X)) >= /\x.s-(x) because [47], by (F-Abs) 47] #argfun-incch#*(chain(/\x.s-(x), X), y) >= s-(y) because #argfun-incch# > s- and [48], by (Copy) 48] #argfun-incch#*(chain(/\x.s-(x), X), y) >= y because [49], by (Select) 49] y >= y by (Var) 50] #argfun-incch#*(chain(/\x.s-(x), X)) >= X because [51], by (Select) 51] chain(/\x.s-(x), X) >= X because [52], by (Star) 52] chain*(/\x.s-(x), X) >= X because [53], by (Select) 53] X >= X by (Meta) 54] s-(X) >= s(X) because s- = s, s- in Mul and [55], by (Fun) 55] 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_4, R_1, minimal, formative) by (P_5, R_1, minimal, formative), where P_5 consists of: chain#(F, cons(X, Y)) =#> F(X) chain#(F, cons(X, Y)) =#> F(X) Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative) and (P_5, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_5, R_1, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. As the system is abstraction-simple and the formative flag is set, it suffices to find a tagged reduction pair [Kop12, Def. 6.70]. Thus, we must orient: chain#(F, cons(X, Y)) >? F(X) chain#(F, cons(X, Y)) >? F(X) if(true, X, Y) >= X if(false, X, Y) >= Y lteq(s(X), o) >= false lteq(o, X) >= true lteq(s(X), s(Y)) >= lteq(X, Y) from(X, cons(Y, Z)) >= if(lteq(X, Y), cons(Y, Z), from(X, Z)) chain(F, cons(X, Y)) >= cons(F X, chain(F, from(F X, Y))) incch(X) >= chain(/\x.s-(x), X) s-(X) >= s(X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( incch(X) ) = #argfun-incch#(chain(/\x.s-(x), X)) 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: [[false]] = _|_ [[from(x_1, x_2)]] = from(x_2) [[if(x_1, x_2, x_3)]] = if(x_2, x_3) [[incch(x_1)]] = x_1 [[lteq(x_1, x_2)]] = lteq(x_1) [[true]] = _|_ We choose Lex = {} and Mul = {#argfun-incch#, @_{o -> o}, chain, chain#, cons, from, if, lteq, o, s, s-}, and the following precedence: #argfun-incch# > chain# > o > s = s- > lteq > chain > @_{o -> o} > cons = from > if Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) chain#(F, cons(X, Y)) > @_{o -> o}(F, X) if(X, Y) >= X if(X, Y) >= Y lteq(s(X)) >= _|_ lteq(o) >= _|_ lteq(s(X)) >= lteq(X) from(cons(X, Y)) >= if(cons(X, Y), from(Y)) chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) s-(X) >= s(X) With these choices, we have: 1] chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) because [2], by (Star) 2] chain#*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain# > @_{o -> o}, [3] and [5], by (Copy) 3] chain#*(F, cons(X, Y)) >= F because [4], by (Select) 4] F >= F by (Meta) 5] chain#*(F, cons(X, Y)) >= X because [6], by (Select) 6] cons(X, Y) >= X because [7], by (Star) 7] cons*(X, Y) >= X because [8], by (Select) 8] X >= X by (Meta) 9] chain#(F, cons(X, Y)) > @_{o -> o}(F, X) because [10], by definition 10] chain#*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain# > @_{o -> o}, [3] and [5], by (Copy) 11] if(X, Y) >= X because [12], by (Star) 12] if*(X, Y) >= X because [13], by (Select) 13] X >= X by (Meta) 14] if(X, Y) >= Y because [15], by (Star) 15] if*(X, Y) >= Y because [16], by (Select) 16] Y >= Y by (Meta) 17] lteq(s(X)) >= _|_ by (Bot) 18] lteq(o) >= _|_ by (Bot) 19] lteq(s(X)) >= lteq(X) because [20], by (Star) 20] lteq*(s(X)) >= lteq(X) because [21], by (Select) 21] s(X) >= lteq(X) because [22], by (Star) 22] s*(X) >= lteq(X) because s > lteq and [23], by (Copy) 23] s*(X) >= X because [24], by (Select) 24] X >= X by (Meta) 25] from(cons(X, Y)) >= if(cons(X, Y), from(Y)) because [26], by (Star) 26] from*(cons(X, Y)) >= if(cons(X, Y), from(Y)) because from > if, [27] and [31], by (Copy) 27] from*(cons(X, Y)) >= cons(X, Y) because [28], by (Select) 28] cons(X, Y) >= cons(X, Y) because cons in Mul, [29] and [30], by (Fun) 29] X >= X by (Meta) 30] Y >= Y by (Meta) 31] from*(cons(X, Y)) >= from(Y) because [32], by (Select) 32] cons(X, Y) >= from(Y) because [33], by (Star) 33] cons*(X, Y) >= from(Y) because cons = from, cons in Mul and [30], by (Stat) 34] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [35], by (Star) 35] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [36] and [39], by (Copy) 36] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [37] and [38], by (Copy) 37] chain*(F, cons(X, Y)) >= F because [4], by (Select) 38] chain*(F, cons(X, Y)) >= X because [6], by (Select) 39] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [40] and [41], by (Stat) 40] F >= F by (Meta) 41] cons(X, Y) > from(Y) because [42], by definition 42] cons*(X, Y) >= from(Y) because cons = from, cons in Mul and [43], by (Stat) 43] Y >= Y by (Meta) 44] #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because [45], by (Star) 45] #argfun-incch#*(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because #argfun-incch# > chain, [46] and [50], by (Copy) 46] #argfun-incch#*(chain(/\x.s-(x), X)) >= /\x.s-(x) because [47], by (F-Abs) 47] #argfun-incch#*(chain(/\x.s-(x), X), y) >= s-(y) because #argfun-incch# > s- and [48], by (Copy) 48] #argfun-incch#*(chain(/\x.s-(x), X), y) >= y because [49], by (Select) 49] y >= y by (Var) 50] #argfun-incch#*(chain(/\x.s-(x), X)) >= X because [51], by (Select) 51] chain(/\x.s-(x), X) >= X because [52], by (Star) 52] chain*(/\x.s-(x), X) >= X because [53], by (Select) 53] X >= X by (Meta) 54] s-(X) >= s(X) because s- = s, s- in Mul and [55], by (Fun) 55] 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, minimal, formative) by (P_6, R_1, minimal, formative), where P_6 consists of: chain#(F, cons(X, Y)) =#> F(X) Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative) and (P_6, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_6, R_1, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. As the system is abstraction-simple and the formative flag is set, it suffices to find a tagged reduction pair [Kop12, Def. 6.70]. Thus, we must orient: chain#(F, cons(X, Y)) >? F(X) if(true, X, Y) >= X if(false, X, Y) >= Y lteq(s(X), o) >= false lteq(o, X) >= true lteq(s(X), s(Y)) >= lteq(X, Y) from(X, cons(Y, Z)) >= if(lteq(X, Y), cons(Y, Z), from(X, Z)) chain(F, cons(X, Y)) >= cons(F X, chain(F, from(F X, Y))) incch(X) >= chain(/\x.s-(x), X) s-(X) >= s(X) We apply [Kop12, Thm. 6.75] and use the following argument functions: pi( incch(X) ) = #argfun-incch#(chain(/\x.s-(x), X)) 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: [[#argfun-incch#(x_1)]] = x_1 [[false]] = _|_ [[from(x_1, x_2)]] = from(x_2) [[if(x_1, x_2, x_3)]] = if(x_2, x_3) [[incch(x_1)]] = x_1 [[true]] = _|_ We choose Lex = {} and Mul = {@_{o -> o}, chain, chain#, cons, from, if, lteq, o, s, s-}, and the following precedence: chain > chain# > @_{o -> o} > cons > from > if > lteq > o > s = s- Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: chain#(F, cons(X, Y)) > @_{o -> o}(F, X) if(X, Y) >= X if(X, Y) >= Y lteq(s(X), o) >= _|_ lteq(o, X) >= _|_ lteq(s(X), s(Y)) >= lteq(X, Y) from(cons(X, Y)) >= if(cons(X, Y), from(Y)) chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) chain(/\x.s-(x), X) >= chain(/\x.s-(x), X) s-(X) >= s(X) With these choices, we have: 1] chain#(F, cons(X, Y)) > @_{o -> o}(F, X) because [2], by definition 2] chain#*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain# > @_{o -> o}, [3] and [5], by (Copy) 3] chain#*(F, cons(X, Y)) >= F because [4], by (Select) 4] F >= F by (Meta) 5] chain#*(F, cons(X, Y)) >= X because [6], by (Select) 6] cons(X, Y) >= X because [7], by (Star) 7] cons*(X, Y) >= X because [8], by (Select) 8] X >= X by (Meta) 9] if(X, Y) >= X because [10], by (Star) 10] if*(X, Y) >= X because [11], by (Select) 11] X >= X by (Meta) 12] if(X, Y) >= Y because [13], by (Star) 13] if*(X, Y) >= Y because [14], by (Select) 14] Y >= Y by (Meta) 15] lteq(s(X), o) >= _|_ by (Bot) 16] lteq(o, X) >= _|_ by (Bot) 17] lteq(s(X), s(Y)) >= lteq(X, Y) because [18], by (Star) 18] lteq*(s(X), s(Y)) >= lteq(X, Y) because lteq in Mul, [19] and [22], by (Stat) 19] s(X) >= X because [20], by (Star) 20] s*(X) >= X because [21], by (Select) 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] from(cons(X, Y)) >= if(cons(X, Y), from(Y)) because [26], by (Star) 26] from*(cons(X, Y)) >= if(cons(X, Y), from(Y)) because from > if, [27] and [31], by (Copy) 27] from*(cons(X, Y)) >= cons(X, Y) because [28], by (Select) 28] cons(X, Y) >= cons(X, Y) because cons in Mul, [29] and [30], by (Fun) 29] X >= X by (Meta) 30] Y >= Y by (Meta) 31] from*(cons(X, Y)) >= from(Y) because from in Mul and [32], by (Stat) 32] cons(X, Y) > Y because [33], by definition 33] cons*(X, Y) >= Y because [30], by (Select) 34] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [35], by (Star) 35] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [36] and [39], by (Copy) 36] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [37] and [38], by (Copy) 37] chain*(F, cons(X, Y)) >= F because [4], by (Select) 38] chain*(F, cons(X, Y)) >= X because [6], by (Select) 39] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [40] and [41], by (Stat) 40] F >= F by (Meta) 41] cons(X, Y) > from(Y) because [42], by definition 42] cons*(X, Y) >= from(Y) because cons > from and [43], by (Copy) 43] cons*(X, Y) >= Y because [44], by (Select) 44] Y >= Y by (Meta) 45] chain(/\x.s-(x), X) >= chain(/\x.s-(x), X) because chain in Mul, [46] and [49], by (Fun) 46] /\y.s-(y) >= /\y.s-(y) because [47], by (Abs) 47] s-(x) >= s-(x) because s- in Mul and [48], by (Fun) 48] x >= x by (Var) 49] X >= X by (Meta) 50] s-(X) >= s(X) because s- = s, s- in Mul and [51], by (Fun) 51] X >= X by (Meta) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_6, R_1) by ({}, R_1). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative) and (P_2, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_2, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(from#) = 2 Thus, we can orient the dependency pairs as follows: nu(from#(X, cons(Y, Z))) = cons(Y, Z) |> Z = nu(from#(X, Z)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_2, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if (P_1, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_1, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(lteq#) = 1 Thus, we can orient the dependency pairs as follows: nu(lteq#(s(X), s(Y))) = s(X) |> X = nu(lteq#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_1, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. As all dependency pair problems were succesfully simplified with sound (and complete) processors until nothing remained, we conclude termination. +++ Citations +++ [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012.