5.72/5.78 YES 5.72/5.79 We consider the system theBenchmark. 5.72/5.79 5.72/5.79 Alphabet: 5.72/5.79 5.72/5.79 0 : [] --> a 5.72/5.79 rec : [a -> b -> b * b * a] --> b 5.72/5.79 s : [a] --> a 5.72/5.79 xap : [a -> b -> b * a] --> b -> b 5.72/5.79 yap : [b -> b * b] --> b 5.72/5.79 5.72/5.79 Rules: 5.72/5.79 5.72/5.79 rec(/\x./\y.yap(xap(f, x), y), z, 0) => z 5.72/5.79 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)) 5.72/5.79 xap(f, x) => f x 5.72/5.79 yap(f, x) => f x 5.72/5.79 5.72/5.79 This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). 5.72/5.79 5.72/5.79 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: 5.72/5.79 5.72/5.79 Alphabet: 5.72/5.79 5.72/5.79 0 : [] --> a 5.72/5.79 rec : [a -> b -> b * b * a] --> b 5.72/5.79 s : [a] --> a 5.72/5.79 yap : [b -> b * b] --> b 5.72/5.79 5.72/5.79 Rules: 5.72/5.79 5.72/5.79 rec(/\x./\y.yap(F(x), y), X, 0) => X 5.72/5.79 rec(/\x./\y.yap(F(x), y), X, s(Y)) => yap(F(s(Y)), rec(/\z./\u.yap(F(z), u), X, Y)) 5.72/5.79 yap(F, X) => F X 5.72/5.79 5.72/5.79 We use rule removal, following [Kop12, Theorem 2.23]. 5.72/5.79 5.72/5.79 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 5.72/5.79 5.72/5.79 rec(/\x./\y.yap(F(x), y), X, 0) >? X 5.72/5.79 rec(/\x./\y.yap(F(x), y), X, s(Y)) >? yap(F(s(Y)), rec(/\z./\u.yap(F(z), u), X, Y)) 5.72/5.79 yap(F, X) >? F X 5.72/5.79 5.72/5.79 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 5.72/5.79 5.72/5.79 We choose Lex = {} and Mul = {0, @_{o -> o}, rec, s, yap}, and the following precedence: 0 > rec > s > yap > @_{o -> o} 5.72/5.79 5.72/5.79 With these choices, we have: 5.72/5.79 5.72/5.79 1] rec(/\x./\y.yap(F(x), y), X, 0) > X because [2], by definition 5.72/5.79 2] rec*(/\x./\y.yap(F(x), y), X, 0) >= X because [3], by (Select) 5.72/5.79 3] X >= X by (Meta) 5.72/5.79 5.72/5.79 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.72/5.79 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) 5.72/5.79 6] rec*(/\x./\y.yap(F(x), y), X, s(Y)) >= F(s(Y)) because [7], by (Select) 5.72/5.79 7] /\x.yap(F(rec*(/\y./\z.yap(F(y), z), X, s(Y))), x) >= F(s(Y)) because [8], by (Eta)[Kop13:2] 5.72/5.79 8] F(rec*(/\x./\y.yap(F(x), y), X, s(Y))) >= F(s(Y)) because [9], by (Meta) 5.72/5.79 9] rec*(/\x./\y.yap(F(x), y), X, s(Y)) >= s(Y) because rec > s and [10], by (Copy) 5.72/5.79 10] rec*(/\x./\y.yap(F(x), y), X, s(Y)) >= Y because [11], by (Select) 5.72/5.79 11] s(Y) >= Y because [12], by (Star) 5.72/5.79 12] s*(Y) >= Y because [13], by (Select) 5.72/5.79 13] Y >= Y by (Meta) 5.72/5.79 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) 5.72/5.79 15] /\x./\z.yap(F(x), z) >= /\x./\z.yap(F(x), z) because [16], by (Abs) 5.72/5.79 16] /\z.yap(F(y), z) >= /\z.yap(F(y), z) because [17], by (Abs) 5.72/5.79 17] yap(F(y), x) >= yap(F(y), x) because yap in Mul, [18] and [20], by (Fun) 5.72/5.79 18] F(y) >= F(y) because [19], by (Meta) 5.72/5.79 19] y >= y by (Var) 5.72/5.79 20] x >= x by (Var) 5.72/5.79 21] X >= X by (Meta) 5.72/5.79 22] s(Y) > Y because [23], by definition 5.72/5.79 23] s*(Y) >= Y because [13], by (Select) 5.72/5.79 5.72/5.79 24] yap(F, X) > @_{o -> o}(F, X) because [25], by definition 5.72/5.79 25] yap*(F, X) >= @_{o -> o}(F, X) because yap > @_{o -> o}, [26] and [28], by (Copy) 5.72/5.79 26] yap*(F, X) >= F because [27], by (Select) 5.72/5.79 27] F >= F by (Meta) 5.72/5.79 28] yap*(F, X) >= X because [29], by (Select) 5.72/5.79 29] X >= X by (Meta) 5.72/5.79 5.72/5.79 We can thus remove the following rules: 5.72/5.79 5.72/5.79 rec(/\x./\y.yap(F(x), y), X, 0) => X 5.72/5.79 yap(F, X) => F X 5.72/5.79 5.72/5.79 We use rule removal, following [Kop12, Theorem 2.23]. 5.72/5.79 5.72/5.79 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 5.72/5.79 5.72/5.79 rec(/\x./\y.yap(F(x), y), X, s(Y)) >? yap(F(s(Y)), rec(/\z./\u.yap(F(z), u), X, Y)) 5.72/5.79 5.72/5.79 We orient these requirements with a polynomial interpretation in the natural numbers. 5.72/5.79 5.72/5.79 The following interpretation satisfies the requirements: 5.72/5.79 5.72/5.79 rec = \G0y1y2.y1 + y2 + G0(0,0) + 2y2y2G0(y2,y2) + 2G0(y2,y1) 5.72/5.79 s = \y0.3 + 3y0 5.72/5.79 yap = \G0y1.y1 + 2G0(0) 5.72/5.79 5.72/5.79 Using this interpretation, the requirements translate to: 5.72/5.79 5.72/5.79 [[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))]] 5.72/5.79 5.72/5.79 We can thus remove the following rules: 5.72/5.79 5.72/5.79 rec(/\x./\y.yap(F(x), y), X, s(Y)) => yap(F(s(Y)), rec(/\z./\u.yap(F(z), u), X, Y)) 5.72/5.79 5.72/5.79 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. 5.72/5.79 5.72/5.79 5.72/5.79 +++ Citations +++ 5.72/5.79 5.72/5.79 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 5.72/5.79 [Kop13:2] C. Kop. StarHorpo with an Eta-Rule. Unpublished manuscript, http://cl-informatik.uibk.ac.at/users/kop/etahorpo.pdf, 2013. 5.72/5.79 EOF