We consider the system h13. Alphabet: 0 : [] --> a rec : [a -> b -> b * b * a] --> b s : [a] --> a xap : [a -> b -> b * a] --> b -> b yap : [b -> b * b] --> b Rules: rec(/\x./\y.yap(xap(f, x), y), z, 0) => z rec(/\x./\y.yap(xap(f, x), y), z, s(u)) => yap(xap(f, s(u)), rec(/\v./\w.yap(xap(f, v), w), z, u)) xap(f, x) => f x yap(f, x) => f x This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). Symbol xap is an encoding for application that is only used in innocuous ways. We can simplify the program (without losing non-termination) by removing it. This gives: Alphabet: 0 : [] --> a rec : [a -> b -> b * b * a] --> b s : [a] --> a yap : [b -> b * b] --> b Rules: rec(/\x./\y.yap(F(x), y), X, 0) => X rec(/\x./\y.yap(F(x), y), X, s(Y)) => yap(F(s(Y)), rec(/\z./\u.yap(F(z), u), X, Y)) yap(F, X) => F X We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): rec(/\x./\y.yap(F(x), y), X, 0) >? X rec(/\x./\y.yap(F(x), y), X, s(Y)) >? yap(F(s(Y)), rec(/\z./\u.yap(F(z), u), X, Y)) yap(F, X) >? F X We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {0, @_{o -> o}, rec, s, yap}, and the following precedence: 0 > rec > s > yap > @_{o -> o} With these choices, we have: 1] rec(/\x./\y.yap(F(x), y), X, 0) > X because [2], by definition 2] rec*(/\x./\y.yap(F(x), y), X, 0) >= X because [3], by (Select) 3] X >= X by (Meta) 4] rec(/\x./\y.yap(F(x), y), X, s(Y)) >= yap(F(s(Y)), rec(/\x./\y.yap(F(x), y), X, Y)) because [5], by (Star) 5] rec*(/\x./\y.yap(F(x), y), X, s(Y)) >= yap(F(s(Y)), rec(/\x./\y.yap(F(x), y), X, Y)) because rec > yap, [6] and [14], by (Copy) 6] rec*(/\x./\y.yap(F(x), y), X, s(Y)) >= F(s(Y)) because [7], by (Select) 7] /\x.yap(F(rec*(/\y./\z.yap(F(y), z), X, s(Y))), x) >= F(s(Y)) because [8], by (Eta)[Kop13:2] 8] F(rec*(/\x./\y.yap(F(x), y), X, s(Y))) >= F(s(Y)) because [9], by (Meta) 9] rec*(/\x./\y.yap(F(x), y), X, s(Y)) >= s(Y) because rec > s and [10], by (Copy) 10] rec*(/\x./\y.yap(F(x), y), X, s(Y)) >= Y because [11], by (Select) 11] s(Y) >= Y because [12], by (Star) 12] s*(Y) >= Y because [13], by (Select) 13] Y >= Y by (Meta) 14] rec*(/\x./\y.yap(F(x), y), X, s(Y)) >= rec(/\x./\y.yap(F(x), y), X, Y) because rec in Mul, [15], [21] and [22], by (Stat) 15] /\x./\z.yap(F(x), z) >= /\x./\z.yap(F(x), z) because [16], by (Abs) 16] /\z.yap(F(y), z) >= /\z.yap(F(y), z) because [17], by (Abs) 17] yap(F(y), x) >= yap(F(y), x) because yap in Mul, [18] and [20], by (Fun) 18] F(y) >= F(y) because [19], by (Meta) 19] y >= y by (Var) 20] x >= x by (Var) 21] X >= X by (Meta) 22] s(Y) > Y because [23], by definition 23] s*(Y) >= Y because [13], by (Select) 24] yap(F, X) > @_{o -> o}(F, X) because [25], by definition 25] yap*(F, X) >= @_{o -> o}(F, X) because yap > @_{o -> o}, [26] and [28], by (Copy) 26] yap*(F, X) >= F because [27], by (Select) 27] F >= F by (Meta) 28] yap*(F, X) >= X because [29], by (Select) 29] X >= X by (Meta) We can thus remove the following rules: rec(/\x./\y.yap(F(x), y), X, 0) => X yap(F, X) => F X We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): rec(/\x./\y.yap(F(x), y), X, s(Y)) >? yap(F(s(Y)), rec(/\z./\u.yap(F(z), u), X, Y)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: rec = \G0y1y2.y1 + y2 + G0(0,0) + 2y2y2G0(y2,y2) + 2G0(y2,y1) s = \y0.3 + 3y0 yap = \G0y1.y1 + 2G0(0) Using this interpretation, the requirements translate to: [[rec(/\x./\y.yap(_F0(x), y), _x1, s(_x2))]] = 57 + 3x1 + 54x2x2x2 + 162x2x2 + 165x2 + 2F0(0,0) + 36x2x2F0(3 + 3x2,0) + 40F0(3 + 3x2,0) + 72x2F0(3 + 3x2,0) > x2 + 2x2x2x2 + 3x1 + 2F0(0,0) + 2F0(3 + 3x2,0) + 4x2x2F0(x2,0) + 4F0(x2,0) = [[yap(_F0(s(_x2)), rec(/\x./\y.yap(_F0(x), y), _x1, _x2))]] We can thus remove the following rules: rec(/\x./\y.yap(F(x), y), X, s(Y)) => yap(F(s(Y)), rec(/\z./\u.yap(F(z), u), X, Y)) All rules were succesfully removed. Thus, termination of the original system has been reduced to termination of the beta-rule, which is well-known to hold. +++ Citations +++ [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. [Kop13:2] C. Kop. StarHorpo with an Eta-Rule. Unpublished manuscript, http://cl-informatik.uibk.ac.at/users/kop/etahorpo.pdf, 2013.