We consider the system fuhkop12rta1. Alphabet: app : [list * list] --> list cons : [nat * list] --> list hshuffle : [nat -> nat * list] --> list nil : [] --> list reverse : [list] --> list Rules: app(nil, x) => x app(cons(x, y), z) => cons(x, app(y, z)) reverse(nil) => nil reverse(cons(x, y)) => app(reverse(y), cons(x, nil)) hshuffle(f, nil) => nil hshuffle(f, cons(x, y)) => cons(f x, hshuffle(f, reverse(y))) This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): app(nil, X) >? X app(cons(X, Y), Z) >? cons(X, app(Y, Z)) reverse(nil) >? nil reverse(cons(X, Y)) >? app(reverse(Y), cons(X, nil)) hshuffle(F, nil) >? nil hshuffle(F, cons(X, Y)) >? cons(F X, hshuffle(F, reverse(Y))) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: app = Lam[y0;y1].y0 + y1 cons = Lam[y0;y1].3 + y0 + y1 hshuffle = Lam[G0;y1].2 + 3*y1 + G0(0) + 2*y1*G0(y1) + 3*G0(y1) nil = 0 reverse = Lam[y0].2 + y0 Using this interpretation, the requirements translate to: [[app(nil, _x0)]] = x0 >= x0 = [[_x0]] [[app(cons(_x0, _x1), _x2)]] = 3 + x0 + x1 + x2 >= 3 + x0 + x1 + x2 = [[cons(_x0, app(_x1, _x2))]] [[reverse(nil)]] = 2 > 0 = [[nil]] [[reverse(cons(_x0, _x1))]] = 5 + x0 + x1 >= 5 + x0 + x1 = [[app(reverse(_x1), cons(_x0, nil))]] [[hshuffle(_F0, nil)]] = 2 + 4*F0(0) > 0 = [[nil]] [[hshuffle(_F0, cons(_x1, _x2))]] = 11 + 3*x1 + 3*x2 + F0(0) + 2*x1*F0(3 + x1 + x2) + 2*x2*F0(3 + x1 + x2) + 9*F0(3 + x1 + x2) >= 11 + x1 + 3*x2 + F0(0) + F0(x1) + 2*x2*F0(2 + x2) + 7*F0(2 + x2) = [[cons(_F0 _x1, hshuffle(_F0, reverse(_x2)))]] We can thus remove the following rules: reverse(nil) => nil hshuffle(F, nil) => nil We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): app(nil, X) >? X app(cons(X, Y), Z) >? cons(X, app(Y, Z)) reverse(cons(X, Y)) >? app(reverse(Y), cons(X, nil)) hshuffle(F, cons(X, Y)) >? cons(F X, hshuffle(F, reverse(Y))) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: app = Lam[y0;y1].y0 + y1 cons = Lam[y0;y1].3 + y1 + 2*y0 hshuffle = Lam[G0;y1].2*y1 + G0(0) + 3*y1*G0(y1) nil = 0 reverse = Lam[y0].y0 Using this interpretation, the requirements translate to: [[app(nil, _x0)]] = x0 >= x0 = [[_x0]] [[app(cons(_x0, _x1), _x2)]] = 3 + x1 + x2 + 2*x0 >= 3 + x1 + x2 + 2*x0 = [[cons(_x0, app(_x1, _x2))]] [[reverse(cons(_x0, _x1))]] = 3 + x1 + 2*x0 >= 3 + x1 + 2*x0 = [[app(reverse(_x1), cons(_x0, nil))]] [[hshuffle(_F0, cons(_x1, _x2))]] = 6 + 2*x2 + 4*x1 + F0(0) + 3*x2*F0(3 + x2 + 2*x1) + 6*x1*F0(3 + x2 + 2*x1) + 9*F0(3 + x2 + 2*x1) > 3 + 2*x1 + 2*x2 + F0(0) + 2*F0(x1) + 3*x2*F0(x2) = [[cons(_F0 _x1, hshuffle(_F0, reverse(_x2)))]] We can thus remove the following rules: hshuffle(F, cons(X, Y)) => cons(F X, hshuffle(F, reverse(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]): app(nil, X) >? X app(cons(X, Y), Z) >? cons(X, app(Y, Z)) reverse(cons(X, Y)) >? app(reverse(Y), cons(X, nil)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: app = Lam[y0;y1].1 + y0 + 2*y1 cons = Lam[y0;y1].3 + y0 + y1 nil = 1 reverse = Lam[y0].2 + 3*y0 Using this interpretation, the requirements translate to: [[app(nil, _x0)]] = 2 + 2*x0 > x0 = [[_x0]] [[app(cons(_x0, _x1), _x2)]] = 4 + x0 + x1 + 2*x2 >= 4 + x0 + x1 + 2*x2 = [[cons(_x0, app(_x1, _x2))]] [[reverse(cons(_x0, _x1))]] = 11 + 3*x0 + 3*x1 >= 11 + 2*x0 + 3*x1 = [[app(reverse(_x1), cons(_x0, nil))]] We can thus remove the following rules: app(nil, X) => 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]): app(cons(X, Y), Z) >? cons(X, app(Y, Z)) reverse(cons(X, Y)) >? app(reverse(Y), cons(X, nil)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: app = Lam[y0;y1].1 + y0 + y1 cons = Lam[y0;y1].1 + y1 + 2*y0 nil = 0 reverse = Lam[y0].3*y0 Using this interpretation, the requirements translate to: [[app(cons(_x0, _x1), _x2)]] = 2 + x1 + x2 + 2*x0 >= 2 + x1 + x2 + 2*x0 = [[cons(_x0, app(_x1, _x2))]] [[reverse(cons(_x0, _x1))]] = 3 + 3*x1 + 6*x0 > 2 + 2*x0 + 3*x1 = [[app(reverse(_x1), cons(_x0, nil))]] We can thus remove the following rules: reverse(cons(X, Y)) => app(reverse(Y), cons(X, nil)) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): app(cons(X, Y), Z) >? cons(X, app(Y, Z)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: app = Lam[y0;y1].2*y1 + 3*y0 cons = Lam[y0;y1].2 + y1 + 2*y0 Using this interpretation, the requirements translate to: [[app(cons(_x0, _x1), _x2)]] = 6 + 2*x2 + 3*x1 + 6*x0 > 2 + 2*x0 + 2*x2 + 3*x1 = [[cons(_x0, app(_x1, _x2))]] We can thus remove the following rules: app(cons(X, Y), Z) => cons(X, app(Y, Z)) 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.