We consider the system h12. Alphabet: 0 : [] --> a rec : [] --> (a -> b -> b) -> b -> a -> b s : [] --> a -> a Rules: rec (/\x./\y.f x y) z 0 => z rec (/\x./\y.f x y) z (s u) => f (s u) (rec (/\v./\w.f v w) z u) Using the transformations described in [Kop11], this system can be brought in a form without leading free variables in the left-hand side, and where the left-hand side of a variable is always a functional term or application headed by a functional term. We now transform the resulting AFS into an AFSM by replacing all free variables by meta-variables (with arity 0). This leads to the following AFSM: Alphabet: 0 : [] --> a rec : [a -> b -> b * b * a] --> b s : [a] --> a ~AP1 : [a -> b -> b * a] --> b -> b Rules: rec(/\x./\y.~AP1(F, x) y, X, 0) => X rec(/\x./\y.~AP1(F, x) y, X, s(Y)) => ~AP1(F, s(Y)) rec(/\z./\u.~AP1(F, z) u, X, Y) ~AP1(F, X) => F X Symbol ~AP1 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 Rules: rec(/\x./\y.X(x, y), Y, 0) => Y rec(/\x./\y.X(x, y), Y, s(Z)) => X(s(Z), rec(/\z./\u.X(z, u), Y, Z)) 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.X(x, y), Y, 0) >? Y rec(/\x./\y.X(x, y), Y, s(Z)) >? X(s(Z), rec(/\z./\u.X(z, u), Y, Z)) We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[rec(x_1, x_2, x_3)]] = rec(x_3, x_2, x_1) We choose Lex = {rec} and Mul = {0, s}, and the following precedence: 0 > rec > s Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: rec(/\x./\y.X(x, y), Y, 0) >= Y rec(/\x./\y.X(x, y), Y, s(Z)) > X(s(Z), rec(/\x./\y.X(x, y), Y, Z)) With these choices, we have: 1] rec(/\x./\y.X(x, y), Y, 0) >= Y because [2], by (Star) 2] rec*(/\x./\y.X(x, y), Y, 0) >= Y because [3], by (Select) 3] Y >= Y by (Meta) 4] rec(/\x./\y.X(x, y), Y, s(Z)) > X(s(Z), rec(/\x./\y.X(x, y), Y, Z)) because [5], by definition 5] rec*(/\x./\y.X(x, y), Y, s(Z)) >= X(s(Z), rec(/\x./\y.X(x, y), Y, Z)) because [6], by (Select) 6] X(rec*(/\x./\y.X(x, y), Y, s(Z)), rec*(/\z./\u.X(z, u), Y, s(Z))) >= X(s(Z), rec(/\x./\y.X(x, y), Y, Z)) because [7] and [10], by (Meta) 7] rec*(/\x./\y.X(x, y), Y, s(Z)) >= s(Z) because [8], by (Select) 8] s(Z) >= s(Z) because s in Mul and [9], by (Fun) 9] Z >= Z by (Meta) 10] rec*(/\x./\y.X(x, y), Y, s(Z)) >= rec(/\x./\y.X(x, y), Y, Z) because [11], [13], [20] and [22], by (Stat) 11] s(Z) > Z because [12], by definition 12] s*(Z) >= Z because [9], by (Select) 13] rec*(/\x./\y.X(x, y), Y, s(Z)) >= /\x./\y.X(x, y) because [14], by (F-Abs) 14] rec*(/\x./\y.X(x, y), Y, s(Z), z) >= /\x.X(z, x) because [15], by (Select) 15] /\x.X(rec*(/\y./\v.X(y, v), Y, s(Z), z), x) >= /\x.X(z, x) because [16], by (Abs) 16] X(rec*(/\x./\y.X(x, y), Y, s(Z), z), u) >= X(z, u) because [17] and [19], by (Meta) 17] rec*(/\x./\y.X(x, y), Y, s(Z), z) >= z because [18], by (Select) 18] z >= z by (Var) 19] u >= u by (Var) 20] rec*(/\x./\y.X(x, y), Y, s(Z)) >= Y because [21], by (Select) 21] Y >= Y by (Meta) 22] rec*(/\x./\y.X(x, y), Y, s(Z)) >= Z because [23], by (Select) 23] s(Z) >= Z because [12], by (Star) We can thus remove the following rules: rec(/\x./\y.X(x, y), Y, s(Z)) => X(s(Z), rec(/\z./\u.X(z, u), Y, Z)) 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.X(x, y), Y, 0) >? Y We use a recursive path ordering as defined in [Kop12, Chapter 5]. We choose Lex = {} and Mul = {0, rec}, and the following precedence: 0 > rec With these choices, we have: 1] rec(/\x./\y.X(x, y), Y, 0) > Y because [2], by definition 2] rec*(/\x./\y.X(x, y), Y, 0) >= Y because [3], by (Select) 3] Y >= Y by (Meta) We can thus remove the following rules: rec(/\x./\y.X(x, y), Y, 0) => 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 +++ [Kop11] C. Kop. Simplifying Algebraic Functional Systems. In Proceedings of CAI 2011, volume 6742 of LNCS. 201--215, Springer, 2011. [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012.