We consider the system if. Alphabet: 0 : [] --> nat false : [] --> bool h : [nat -> bool * nat -> nat * nat] --> nat if : [bool * nat * nat] --> nat s : [nat] --> nat true : [] --> bool Rules: if(true, x, y) => x if(false, x, y) => y h(f, g, 0) => 0 h(f, g, s(x)) => g h(f, g, if(f x, x, 0)) 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] h#(F, G, s(X)) =#> h#(F, G, if(F X, X, 0)) 1] h#(F, G, s(X)) =#> if#(F X, X, 0) Rules R_0: if(true, X, Y) => X if(false, X, Y) => Y h(F, G, 0) => 0 h(F, G, s(X)) => G h(F, G, if(F X, X, 0)) 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 ::= if(true, X, Y) => X if(false, X, Y) => Y h(F, G, s(X)) => G h(F, G, if(F X, X, 0)) 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: h#(F, G, s(X)) >? h#(F, G, if(F X, X, 0)) h#(F, G, s(X)) >? if#(F X, X, 0) if(true, X, Y) >= X if(false, X, Y) >= Y h(F, G, s(X)) >= G h(F, G, if(F X, X, 0)) 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]] = _|_ [[if(x_1, x_2, x_3)]] = if(x_2, x_3) We choose Lex = {} and Mul = {@_{o -> o}, false, h, h#, if, if#, s, true}, and the following precedence: s > h > false > if > h# > if# > @_{o -> o} > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: h#(F, G, s(X)) > h#(F, G, if(X, _|_)) h#(F, G, s(X)) >= if#(@_{o -> o}(F, X), X, _|_) if(X, Y) >= X if(X, Y) >= Y h(F, G, s(X)) >= @_{o -> o}(G, h(F, G, if(X, _|_))) With these choices, we have: 1] h#(F, G, s(X)) > h#(F, G, if(X, _|_)) because [2], by definition 2] h#*(F, G, s(X)) >= h#(F, G, if(X, _|_)) because h# in Mul, [3], [4] and [5], by (Stat) 3] F >= F by (Meta) 4] G >= G by (Meta) 5] s(X) > if(X, _|_) because [6], by definition 6] s*(X) >= if(X, _|_) because s > if, [7] and [9], by (Copy) 7] s*(X) >= X because [8], by (Select) 8] X >= X by (Meta) 9] s*(X) >= _|_ by (Bot) 10] h#(F, G, s(X)) >= if#(@_{o -> o}(F, X), X, _|_) because [11], by (Star) 11] h#*(F, G, s(X)) >= if#(@_{o -> o}(F, X), X, _|_) because h# > if#, [12], [14] and [16], by (Copy) 12] h#*(F, G, s(X)) >= @_{o -> o}(F, X) because h# > @_{o -> o}, [13] and [14], by (Copy) 13] h#*(F, G, s(X)) >= F because [3], by (Select) 14] h#*(F, G, s(X)) >= X because [15], by (Select) 15] s(X) >= X because [7], by (Star) 16] h#*(F, G, s(X)) >= _|_ by (Bot) 17] if(X, Y) >= X because [18], by (Star) 18] if*(X, Y) >= X because [19], by (Select) 19] X >= X by (Meta) 20] if(X, Y) >= Y because [21], by (Star) 21] if*(X, Y) >= Y because [22], by (Select) 22] Y >= Y by (Meta) 23] h(F, G, s(X)) >= @_{o -> o}(G, h(F, G, if(X, _|_))) because [24], by (Star) 24] h*(F, G, s(X)) >= @_{o -> o}(G, h(F, G, if(X, _|_))) because h > @_{o -> o}, [25] and [26], by (Copy) 25] h*(F, G, s(X)) >= G because [4], by (Select) 26] h*(F, G, s(X)) >= h(F, G, if(X, _|_)) because h in Mul, [3], [4] and [5], by (Stat) 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: h#(F, G, s(X)) =#> if#(F X, X, 0) 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: h#(F, G, s(X)) >? if#(F X, X, 0) if(true, X, Y) >= X if(false, X, Y) >= Y h(F, G, s(X)) >= G h(F, G, if(F X, X, 0)) 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]] = _|_ [[if(x_1, x_2, x_3)]] = if(x_2, x_3) [[if#(x_1, x_2, x_3)]] = x_3 We choose Lex = {} and Mul = {@_{o -> o}, false, h, h#, if, s, true}, and the following precedence: false > h > @_{o -> o} > h# > s > if > true Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: h#(F, G, s(X)) > _|_ if(X, Y) >= X if(X, Y) >= Y h(F, G, s(X)) >= @_{o -> o}(G, h(F, G, if(X, _|_))) With these choices, we have: 1] h#(F, G, s(X)) > _|_ because [2], by definition 2] h#*(F, G, s(X)) >= _|_ by (Bot) 3] if(X, Y) >= X because [4], by (Star) 4] if*(X, Y) >= X because [5], by (Select) 5] X >= X by (Meta) 6] if(X, Y) >= Y because [7], by (Star) 7] if*(X, Y) >= Y because [8], by (Select) 8] Y >= Y by (Meta) 9] h(F, G, s(X)) >= @_{o -> o}(G, h(F, G, if(X, _|_))) because [10], by (Star) 10] h*(F, G, s(X)) >= @_{o -> o}(G, h(F, G, if(X, _|_))) because h > @_{o -> o}, [11] and [13], by (Copy) 11] h*(F, G, s(X)) >= G because [12], by (Select) 12] G >= G by (Meta) 13] h*(F, G, s(X)) >= h(F, G, if(X, _|_)) because h in Mul, [14], [15] and [16], by (Stat) 14] F >= F by (Meta) 15] G >= G by (Meta) 16] s(X) > if(X, _|_) because [17], by definition 17] s*(X) >= if(X, _|_) because s > if, [18] and [20], by (Copy) 18] s*(X) >= X because [19], by (Select) 19] X >= X by (Meta) 20] s*(X) >= _|_ by (Bot) By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_1, R_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. [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.