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 observe that the rules contain a first-order subset: 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)) Moreover, the system is orthogonal. Thus, by [Kop12, Thm. 7.55], we may omit all first-order dependency pairs from the dependency pair problem (DP(R), R) if this first-order part is terminating when seen as a many-sorted first-order TRS. According to the external first-order termination prover, this system is indeed terminating: || proof of resources/system.trs || # AProVE Commit ID: d84c10301d352dfd14de2104819581f4682260f5 fuhs 20130616 || || || Termination w.r.t. Q of the given QTRS could be proven: || || (0) QTRS || (1) QTRSRRRProof [EQUIVALENT] || (2) QTRS || (3) RisEmptyProof [EQUIVALENT] || (4) YES || || || ---------------------------------------- || || (0) || Obligation: || Q restricted rewrite system: || The TRS R consists of the following 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)) || || Q is empty. || || ---------------------------------------- || || (1) QTRSRRRProof (EQUIVALENT) || Used ordering: || Quasi precedence: || from_2 > [if_3, cons_2] || from_2 > lteq_2 > [true, false, o] || from_2 > nil || || || Status: || if_3: multiset status || true: multiset status || false: multiset status || lteq_2: [2,1] || s_1: [1] || o: multiset status || from_2: multiset status || nil: multiset status || cons_2: multiset status || || With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly: || || 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)) || || || || || ---------------------------------------- || || (2) || Obligation: || Q restricted rewrite system: || R is empty. || Q is empty. || || ---------------------------------------- || || (3) RisEmptyProof (EQUIVALENT) || The TRS R is empty. Hence, termination is trivially proven. || ---------------------------------------- || || (4) || YES || 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] chain#(F, cons(X, Y)) =#> F(X) 1] chain#(F, cons(X, Y)) =#> chain#(F, from(F X, Y)) 2] chain#(F, cons(X, Y)) =#> from#(F X, Y) 3] chain#(F, cons(X, Y)) =#> F(X) 4] 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, 3, 4 * 1 : 0, 1, 2, 3 * 2 : * 3 : 0, 1, 2, 3, 4 * 4 : 0, 1, 2, 3 This graph has the following strongly connected components: P_1: 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). 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). The formative rules of (P_1, 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_1, R_0, minimal, formative) by (P_1, R_1, minimal, formative). Thus, the original system is terminating if (P_1, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_1, 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) [[if(x_1, x_2, x_3)]] = if(x_2, x_3) [[incch(x_1)]] = x_1 [[incch#(x_1)]] = x_1 [[s(x_1)]] = x_1 [[true]] = _|_ We choose Lex = {} and Mul = {#argfun-incch#, #argfun-incch##, @_{o -> o}, chain, chain#, cons, from, if, lteq, o, s-}, and the following precedence: #argfun-incch# > s- > lteq > o > chain > cons = from > chain# > #argfun-incch## > if > @_{o -> o} 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 lteq(X, o) >= _|_ lteq(o, X) >= _|_ lteq(X, 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) >= 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 [10], by (Star) 10] chain#*(F, cons(X, Y)) >= chain#(F, from(Y)) because chain# in Mul, [11] and [12], by (Stat) 11] F >= F by (Meta) 12] cons(X, Y) > from(Y) because [13], by definition 13] cons*(X, Y) >= from(Y) because cons = from, cons in Mul and [14], by (Stat) 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 [18], by (Select) 18] chain#(/\x.s-(x), X) >= chain#(/\x.s-(x), X) because chain# in Mul, [19] and [22], by (Fun) 19] /\y.s-(y) >= /\y.s-(y) because [20], by (Abs) 20] s-(x) >= s-(x) because s- in Mul and [21], by (Fun) 21] x >= x by (Var) 22] X >= X by (Meta) 23] if(X, Y) >= X because [24], by (Star) 24] if*(X, Y) >= X because [25], by (Select) 25] X >= X by (Meta) 26] if(X, Y) >= Y because [27], by (Star) 27] if*(X, Y) >= Y because [28], by (Select) 28] Y >= Y by (Meta) 29] lteq(X, o) >= _|_ by (Bot) 30] lteq(o, X) >= _|_ by (Bot) 31] lteq(X, Y) >= lteq(X, Y) because lteq in Mul, [32] and [33], by (Fun) 32] X >= X by (Meta) 33] Y >= Y by (Meta) 34] from(cons(X, Y)) >= if(cons(X, Y), from(Y)) because [35], by (Star) 35] from*(cons(X, Y)) >= if(cons(X, Y), from(Y)) because from > if, [36] and [40], by (Copy) 36] from*(cons(X, Y)) >= cons(X, Y) because [37], by (Select) 37] cons(X, Y) >= cons(X, Y) because cons in Mul, [38] and [39], by (Fun) 38] X >= X by (Meta) 39] Y >= Y by (Meta) 40] from*(cons(X, Y)) >= from(Y) because [41], by (Select) 41] cons(X, Y) >= from(Y) because [42], by (Star) 42] cons*(X, Y) >= from(Y) because cons = from, cons in Mul and [39], by (Stat) 43] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [44], by (Star) 44] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [45] and [48], by (Copy) 45] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [46] and [47], by (Copy) 46] chain*(F, cons(X, Y)) >= F because [11], by (Select) 47] chain*(F, cons(X, Y)) >= X because [6], by (Select) 48] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [11] and [12], by (Stat) 49] #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because [50], by (Star) 50] #argfun-incch#*(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because [51], by (Select) 51] chain(/\x.s-(x), X) >= chain(/\x.s-(x), X) because chain in Mul, [19] and [22], by (Fun) 52] s-(X) >= X because [53], by (Star) 53] s-*(X) >= X because [54], by (Select) 54] 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_1, R_1, minimal, formative) by (P_2, R_1, minimal, formative), where P_2 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 (P_2, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_2, 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: #argfun-incch# > o > chain# > s- > s > chain > @_{o -> o} > cons = from > lteq > 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 [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 [10], by definition 10] chain#*(F, cons(X, Y)) >= chain#(F, from(Y)) because chain# in Mul, [11] and [12], by (Stat) 11] F >= F by (Meta) 12] cons(X, Y) > from(Y) because [13], by definition 13] cons*(X, Y) >= from(Y) because cons = from, cons in Mul and [14], by (Stat) 14] Y >= Y by (Meta) 15] chain#(F, cons(X, Y)) >= @_{o -> o}(F, X) because [2], by (Star) 16] if(X, Y) >= X because [17], by (Star) 17] if*(X, Y) >= X because [18], by (Select) 18] X >= X by (Meta) 19] if(X, Y) >= Y because [20], by (Star) 20] if*(X, Y) >= Y because [21], by (Select) 21] Y >= Y by (Meta) 22] lteq(s(X), o) >= _|_ by (Bot) 23] lteq(o, X) >= _|_ by (Bot) 24] lteq(s(X), s(Y)) >= lteq(X, Y) because lteq in Mul, [25] and [28], by (Fun) 25] s(X) >= X because [26], by (Star) 26] s*(X) >= X because [27], by (Select) 27] X >= X by (Meta) 28] s(Y) >= Y because [29], by (Star) 29] s*(Y) >= Y because [30], by (Select) 30] Y >= Y by (Meta) 31] from(cons(X, Y)) >= if(cons(X, Y), from(Y)) because [32], by (Star) 32] from*(cons(X, Y)) >= if(cons(X, Y), from(Y)) because from > if, [33] and [40], by (Copy) 33] from*(cons(X, Y)) >= cons(X, Y) because from = cons, from in Mul, [34] and [37], by (Stat) 34] cons(X, Y) > X because [35], by definition 35] cons*(X, Y) >= X because [36], by (Select) 36] X >= X by (Meta) 37] cons(X, Y) > Y because [38], by definition 38] cons*(X, Y) >= Y because [39], by (Select) 39] Y >= Y by (Meta) 40] from*(cons(X, Y)) >= from(Y) because from in Mul and [37], by (Stat) 41] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [42], by (Star) 42] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [43] and [46], by (Copy) 43] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [44] and [45], by (Copy) 44] chain*(F, cons(X, Y)) >= F because [11], by (Select) 45] chain*(F, cons(X, Y)) >= X because [6], by (Select) 46] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [11] and [12], by (Stat) 47] #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because [48], by (Star) 48] #argfun-incch#*(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because #argfun-incch# > chain, [49] and [53], by (Copy) 49] #argfun-incch#*(chain(/\x.s-(x), X)) >= /\x.s-(x) because [50], by (F-Abs) 50] #argfun-incch#*(chain(/\x.s-(x), X), y) >= s-(y) because #argfun-incch# > s- and [51], by (Copy) 51] #argfun-incch#*(chain(/\x.s-(x), X), y) >= y because [52], by (Select) 52] y >= y by (Var) 53] #argfun-incch#*(chain(/\x.s-(x), X)) >= X because [54], by (Select) 54] chain(/\x.s-(x), X) >= X because [55], by (Star) 55] chain*(/\x.s-(x), X) >= X because [56], by (Select) 56] X >= X by (Meta) 57] s-(X) >= s(X) because [58], by (Star) 58] s-*(X) >= s(X) because s- > s and [59], by (Copy) 59] s-*(X) >= X because [60], by (Select) 60] 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_2, R_1, minimal, formative) by (P_3, R_1, minimal, formative), where P_3 consists of: chain#(F, cons(X, Y)) =#> F(X) chain#(F, cons(X, Y)) =#> F(X) Thus, the original system is terminating if (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)) >? 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: #argfun-incch# > chain# > lteq > o > s- > s > 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), 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 [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), o) >= _|_ by (Bot) 18] lteq(o, X) >= _|_ by (Bot) 19] lteq(s(X), s(Y)) >= lteq(X, Y) because lteq 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] s(Y) >= Y because [24], by (Star) 24] s*(Y) >= Y because [25], by (Select) 25] Y >= Y by (Meta) 26] from(cons(X, Y)) >= if(cons(X, Y), from(Y)) because [27], by (Star) 27] from*(cons(X, Y)) >= if(cons(X, Y), from(Y)) because from > if, [28] and [32], by (Copy) 28] from*(cons(X, Y)) >= cons(X, Y) because [29], by (Select) 29] cons(X, Y) >= cons(X, Y) because cons in Mul, [30] and [31], by (Fun) 30] X >= X by (Meta) 31] Y >= Y by (Meta) 32] from*(cons(X, Y)) >= from(Y) because [33], by (Select) 33] cons(X, Y) >= from(Y) because [34], by (Star) 34] cons*(X, Y) >= from(Y) because cons = from, cons in Mul and [31], by (Stat) 35] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [36], by (Star) 36] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [37] and [40], by (Copy) 37] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [38] and [39], by (Copy) 38] chain*(F, cons(X, Y)) >= F because [4], by (Select) 39] chain*(F, cons(X, Y)) >= X because [6], by (Select) 40] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [41] and [42], by (Stat) 41] F >= F by (Meta) 42] cons(X, Y) > from(Y) because [43], by definition 43] cons*(X, Y) >= from(Y) because cons = from, cons in Mul and [44], by (Stat) 44] Y >= Y by (Meta) 45] #argfun-incch#(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because [46], by (Star) 46] #argfun-incch#*(chain(/\x.s-(x), X)) >= chain(/\x.s-(x), X) because #argfun-incch# > chain, [47] and [51], by (Copy) 47] #argfun-incch#*(chain(/\x.s-(x), X)) >= /\x.s-(x) because [48], by (F-Abs) 48] #argfun-incch#*(chain(/\x.s-(x), X), y) >= s-(y) because #argfun-incch# > s- and [49], by (Copy) 49] #argfun-incch#*(chain(/\x.s-(x), X), y) >= y because [50], by (Select) 50] y >= y by (Var) 51] #argfun-incch#*(chain(/\x.s-(x), X)) >= X because [52], by (Select) 52] chain(/\x.s-(x), X) >= X because [53], by (Star) 53] chain*(/\x.s-(x), X) >= X because [54], by (Select) 54] X >= X by (Meta) 55] s-(X) >= s(X) because [56], by (Star) 56] s-*(X) >= s(X) because s- > s and [57], by (Copy) 57] s-*(X) >= X because [58], by (Select) 58] 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) Thus, the original system is terminating if (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) 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: #argfun-incch# > 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))) #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 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 lteq in Mul, [18] and [21], by (Fun) 18] s(X) >= X because [19], by (Star) 19] s*(X) >= X because [20], by (Select) 20] X >= X by (Meta) 21] s(Y) >= Y because [22], by (Star) 22] s*(Y) >= Y because [23], by (Select) 23] Y >= Y by (Meta) 24] from(cons(X, Y)) >= if(cons(X, Y), from(Y)) because [25], by (Star) 25] from*(cons(X, Y)) >= if(cons(X, Y), from(Y)) because from > if, [26] and [30], by (Copy) 26] from*(cons(X, Y)) >= cons(X, Y) because [27], by (Select) 27] cons(X, Y) >= cons(X, Y) because cons in Mul, [28] and [29], by (Fun) 28] X >= X by (Meta) 29] Y >= Y by (Meta) 30] from*(cons(X, Y)) >= from(Y) because from in Mul and [31], by (Stat) 31] cons(X, Y) > Y because [32], by definition 32] cons*(X, Y) >= Y because [29], by (Select) 33] chain(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because [34], by (Star) 34] chain*(F, cons(X, Y)) >= cons(@_{o -> o}(F, X), chain(F, from(Y))) because chain > cons, [35] and [38], by (Copy) 35] chain*(F, cons(X, Y)) >= @_{o -> o}(F, X) because chain > @_{o -> o}, [36] and [37], by (Copy) 36] chain*(F, cons(X, Y)) >= F because [4], by (Select) 37] chain*(F, cons(X, Y)) >= X because [6], by (Select) 38] chain*(F, cons(X, Y)) >= chain(F, from(Y)) because chain in Mul, [39] and [40], by (Stat) 39] F >= F by (Meta) 40] cons(X, Y) > from(Y) because [41], by definition 41] cons*(X, Y) >= from(Y) because cons > from and [42], by (Copy) 42] cons*(X, Y) >= Y because [43], by (Select) 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] s-(chain*(/\x.s-(x), X)) >= X because [54], by (Star) 54] s-*(chain*(/\x.s-(x), X)) >= X because [55], by (Select) 55] chain*(/\x.s-(x), X) >= X because [56], by (Select) 56] X >= X by (Meta) 57] s-(X) >= s(X) because s- = s, s- in Mul and [58], by (Fun) 58] 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_4, R_1) by ({}, R_1). 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.