We consider the system prenex. Alphabet: and : [form * form] --> form exists : [form -> form] --> form forall : [form -> form] --> form not : [form] --> form or : [form * form] --> form Rules: and(x, forall(/\y.f y)) => forall(/\z.and(x, f z)) or(x, forall(/\y.f y)) => forall(/\z.or(x, f z)) and(forall(/\x.f x), y) => forall(/\z.and(f z, y)) or(forall(/\x.f x), y) => forall(/\z.or(f z, y)) not(forall(/\x.f x)) => exists(/\y.not(f y)) and(x, exists(/\y.f y)) => exists(/\z.and(x, f z)) or(x, exists(/\y.f y)) => exists(/\z.or(x, f z)) and(exists(/\x.f x), y) => exists(/\z.and(f z, y)) or(exists(/\x.f x), y) => exists(/\z.or(f z, y)) not(exists(/\x.f x)) => forall(/\y.not(f y)) 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: and : [form * form] --> form exists : [form -> form] --> form forall : [form -> form] --> form not : [form] --> form or : [form * form] --> form ~AP1 : [form -> form * form] --> form Rules: and(X, forall(/\x.~AP1(F, x))) => forall(/\y.and(X, ~AP1(F, y))) or(X, forall(/\x.~AP1(F, x))) => forall(/\y.or(X, ~AP1(F, y))) and(forall(/\x.~AP1(F, x)), X) => forall(/\y.and(~AP1(F, y), X)) or(forall(/\x.~AP1(F, x)), X) => forall(/\y.or(~AP1(F, y), X)) not(forall(/\x.~AP1(F, x))) => exists(/\y.not(~AP1(F, y))) and(X, exists(/\x.~AP1(F, x))) => exists(/\y.and(X, ~AP1(F, y))) or(X, exists(/\x.~AP1(F, x))) => exists(/\y.or(X, ~AP1(F, y))) and(exists(/\x.~AP1(F, x)), X) => exists(/\y.and(~AP1(F, y), X)) or(exists(/\x.~AP1(F, x)), X) => exists(/\y.or(~AP1(F, y), X)) not(exists(/\x.~AP1(F, x))) => forall(/\y.not(~AP1(F, 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: and : [form * form] --> form exists : [form -> form] --> form forall : [form -> form] --> form not : [form] --> form or : [form * form] --> form Rules: and(X, forall(/\x.Y(x))) => forall(/\y.and(X, Y(y))) or(X, forall(/\x.Y(x))) => forall(/\y.or(X, Y(y))) and(forall(/\x.X(x)), Y) => forall(/\y.and(X(y), Y)) or(forall(/\x.X(x)), Y) => forall(/\y.or(X(y), Y)) not(forall(/\x.X(x))) => exists(/\y.not(X(y))) and(X, exists(/\x.Y(x))) => exists(/\y.and(X, Y(y))) or(X, exists(/\x.Y(x))) => exists(/\y.or(X, Y(y))) and(exists(/\x.X(x)), Y) => exists(/\y.and(X(y), Y)) or(exists(/\x.X(x)), Y) => exists(/\y.or(X(y), Y)) not(exists(/\x.X(x))) => forall(/\y.not(X(y))) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): and(X, forall(/\x.Y(x))) >? forall(/\y.and(X, Y(y))) or(X, forall(/\x.Y(x))) >? forall(/\y.or(X, Y(y))) and(forall(/\x.X(x)), Y) >? forall(/\y.and(X(y), Y)) or(forall(/\x.X(x)), Y) >? forall(/\y.or(X(y), Y)) not(forall(/\x.X(x))) >? exists(/\y.not(X(y))) and(X, exists(/\x.Y(x))) >? exists(/\y.and(X, Y(y))) or(X, exists(/\x.Y(x))) >? exists(/\y.or(X, Y(y))) and(exists(/\x.X(x)), Y) >? exists(/\y.and(X(y), Y)) or(exists(/\x.X(x)), Y) >? exists(/\y.or(X(y), Y)) not(exists(/\x.X(x))) >? forall(/\y.not(X(y))) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: and = \y0y1.y0 + 2y1 exists = \G0.1 + G0(0) forall = \G0.1 + G0(0) not = \y0.y0 or = \y0y1.y0 + y1 Using this interpretation, the requirements translate to: [[and(_x0, forall(/\x._x1(x)))]] = 2 + x0 + 2F1(0) > 1 + x0 + 2F1(0) = [[forall(/\x.and(_x0, _x1(x)))]] [[or(_x0, forall(/\x._x1(x)))]] = 1 + x0 + F1(0) >= 1 + x0 + F1(0) = [[forall(/\x.or(_x0, _x1(x)))]] [[and(forall(/\x._x0(x)), _x1)]] = 1 + 2x1 + F0(0) >= 1 + 2x1 + F0(0) = [[forall(/\x.and(_x0(x), _x1))]] [[or(forall(/\x._x0(x)), _x1)]] = 1 + x1 + F0(0) >= 1 + x1 + F0(0) = [[forall(/\x.or(_x0(x), _x1))]] [[not(forall(/\x._x0(x)))]] = 1 + F0(0) >= 1 + F0(0) = [[exists(/\x.not(_x0(x)))]] [[and(_x0, exists(/\x._x1(x)))]] = 2 + x0 + 2F1(0) > 1 + x0 + 2F1(0) = [[exists(/\x.and(_x0, _x1(x)))]] [[or(_x0, exists(/\x._x1(x)))]] = 1 + x0 + F1(0) >= 1 + x0 + F1(0) = [[exists(/\x.or(_x0, _x1(x)))]] [[and(exists(/\x._x0(x)), _x1)]] = 1 + 2x1 + F0(0) >= 1 + 2x1 + F0(0) = [[exists(/\x.and(_x0(x), _x1))]] [[or(exists(/\x._x0(x)), _x1)]] = 1 + x1 + F0(0) >= 1 + x1 + F0(0) = [[exists(/\x.or(_x0(x), _x1))]] [[not(exists(/\x._x0(x)))]] = 1 + F0(0) >= 1 + F0(0) = [[forall(/\x.not(_x0(x)))]] We can thus remove the following rules: and(X, forall(/\x.Y(x))) => forall(/\y.and(X, Y(y))) and(X, exists(/\x.Y(x))) => exists(/\y.and(X, Y(y))) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): or(X, forall(/\x.Y(x))) >? forall(/\y.or(X, Y(y))) and(forall(/\x.X(x)), Y) >? forall(/\y.and(X(y), Y)) or(forall(/\x.X(x)), Y) >? forall(/\y.or(X(y), Y)) not(forall(/\x.X(x))) >? exists(/\y.not(X(y))) or(X, exists(/\x.Y(x))) >? exists(/\y.or(X, Y(y))) and(exists(/\x.X(x)), Y) >? exists(/\y.and(X(y), Y)) or(exists(/\x.X(x)), Y) >? exists(/\y.or(X(y), Y)) not(exists(/\x.X(x))) >? forall(/\y.not(X(y))) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: and = \y0y1.3 + y1 + 3y0 exists = \G0.3 + G0(0) forall = \G0.3 + G0(0) not = \y0.y0 or = \y0y1.y0 + y1 Using this interpretation, the requirements translate to: [[or(_x0, forall(/\x._x1(x)))]] = 3 + x0 + F1(0) >= 3 + x0 + F1(0) = [[forall(/\x.or(_x0, _x1(x)))]] [[and(forall(/\x._x0(x)), _x1)]] = 12 + x1 + 3F0(0) > 6 + x1 + 3F0(0) = [[forall(/\x.and(_x0(x), _x1))]] [[or(forall(/\x._x0(x)), _x1)]] = 3 + x1 + F0(0) >= 3 + x1 + F0(0) = [[forall(/\x.or(_x0(x), _x1))]] [[not(forall(/\x._x0(x)))]] = 3 + F0(0) >= 3 + F0(0) = [[exists(/\x.not(_x0(x)))]] [[or(_x0, exists(/\x._x1(x)))]] = 3 + x0 + F1(0) >= 3 + x0 + F1(0) = [[exists(/\x.or(_x0, _x1(x)))]] [[and(exists(/\x._x0(x)), _x1)]] = 12 + x1 + 3F0(0) > 6 + x1 + 3F0(0) = [[exists(/\x.and(_x0(x), _x1))]] [[or(exists(/\x._x0(x)), _x1)]] = 3 + x1 + F0(0) >= 3 + x1 + F0(0) = [[exists(/\x.or(_x0(x), _x1))]] [[not(exists(/\x._x0(x)))]] = 3 + F0(0) >= 3 + F0(0) = [[forall(/\x.not(_x0(x)))]] We can thus remove the following rules: and(forall(/\x.X(x)), Y) => forall(/\y.and(X(y), Y)) and(exists(/\x.X(x)), Y) => exists(/\y.and(X(y), Y)) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): or(X, forall(/\x.Y(x))) >? forall(/\y.or(X, Y(y))) or(forall(/\x.X(x)), Y) >? forall(/\y.or(X(y), Y)) not(forall(/\x.X(x))) >? exists(/\y.not(X(y))) or(X, exists(/\x.Y(x))) >? exists(/\y.or(X, Y(y))) or(exists(/\x.X(x)), Y) >? exists(/\y.or(X(y), Y)) not(exists(/\x.X(x))) >? forall(/\y.not(X(y))) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: exists = \G0.1 + G0(0) forall = \G0.2 + G0(0) not = \y0.2y0 or = \y0y1.y1 + 2y0 Using this interpretation, the requirements translate to: [[or(_x0, forall(/\x._x1(x)))]] = 2 + 2x0 + F1(0) >= 2 + 2x0 + F1(0) = [[forall(/\x.or(_x0, _x1(x)))]] [[or(forall(/\x._x0(x)), _x1)]] = 4 + x1 + 2F0(0) > 2 + x1 + 2F0(0) = [[forall(/\x.or(_x0(x), _x1))]] [[not(forall(/\x._x0(x)))]] = 4 + 2F0(0) > 1 + 2F0(0) = [[exists(/\x.not(_x0(x)))]] [[or(_x0, exists(/\x._x1(x)))]] = 1 + 2x0 + F1(0) >= 1 + 2x0 + F1(0) = [[exists(/\x.or(_x0, _x1(x)))]] [[or(exists(/\x._x0(x)), _x1)]] = 2 + x1 + 2F0(0) > 1 + x1 + 2F0(0) = [[exists(/\x.or(_x0(x), _x1))]] [[not(exists(/\x._x0(x)))]] = 2 + 2F0(0) >= 2 + 2F0(0) = [[forall(/\x.not(_x0(x)))]] We can thus remove the following rules: or(forall(/\x.X(x)), Y) => forall(/\y.or(X(y), Y)) not(forall(/\x.X(x))) => exists(/\y.not(X(y))) or(exists(/\x.X(x)), Y) => exists(/\y.or(X(y), Y)) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): or(X, forall(/\x.Y(x))) >? forall(/\y.or(X, Y(y))) or(X, exists(/\x.Y(x))) >? exists(/\y.or(X, Y(y))) not(exists(/\x.X(x))) >? forall(/\y.not(X(y))) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: exists = \G0.3 + G0(0) forall = \G0.G0(0) not = \y0.2y0 or = \y0y1.y0 + 3y1 Using this interpretation, the requirements translate to: [[or(_x0, forall(/\x._x1(x)))]] = x0 + 3F1(0) >= x0 + 3F1(0) = [[forall(/\x.or(_x0, _x1(x)))]] [[or(_x0, exists(/\x._x1(x)))]] = 9 + x0 + 3F1(0) > 3 + x0 + 3F1(0) = [[exists(/\x.or(_x0, _x1(x)))]] [[not(exists(/\x._x0(x)))]] = 6 + 2F0(0) > 2F0(0) = [[forall(/\x.not(_x0(x)))]] We can thus remove the following rules: or(X, exists(/\x.Y(x))) => exists(/\y.or(X, Y(y))) not(exists(/\x.X(x))) => forall(/\y.not(X(y))) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): or(X, forall(/\x.Y(x))) >? forall(/\y.or(X, Y(y))) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: forall = \G0.1 + G0(0) or = \y0y1.y0 + 3y1 Using this interpretation, the requirements translate to: [[or(_x0, forall(/\x._x1(x)))]] = 3 + x0 + 3F1(0) > 1 + x0 + 3F1(0) = [[forall(/\x.or(_x0, _x1(x)))]] We can thus remove the following rules: or(X, forall(/\x.Y(x))) => forall(/\y.or(X, Y(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.