0.00/0.05 YES 0.00/0.05 We consider the system theBenchmark. 0.00/0.05 0.00/0.05 Alphabet: 0.00/0.05 0.00/0.05 0 : [] --> nat 0.00/0.05 bool : [nat] --> boolean 0.00/0.05 cons : [nat * list] --> list 0.00/0.05 consif : [boolean * nat * list] --> list 0.00/0.05 false : [] --> boolean 0.00/0.05 filter : [nat -> boolean * list] --> list 0.00/0.05 nil : [] --> list 0.00/0.05 rand : [nat] --> nat 0.00/0.05 s : [nat] --> nat 0.00/0.05 true : [] --> boolean 0.00/0.05 0.00/0.05 Rules: 0.00/0.05 0.00/0.05 rand(x) => x 0.00/0.05 rand(s(x)) => rand(x) 0.00/0.05 bool(0) => false 0.00/0.05 bool(s(0)) => true 0.00/0.05 filter(f, nil) => nil 0.00/0.05 filter(f, cons(x, y)) => consif(f x, x, filter(f, y)) 0.00/0.05 consif(true, x, y) => cons(x, y) 0.00/0.05 consif(false, x, y) => y 0.00/0.05 0.00/0.05 This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). 0.00/0.05 0.00/0.05 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.05 0.00/0.05 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.05 0.00/0.05 rand(X) >? X 0.00/0.05 rand(s(X)) >? rand(X) 0.00/0.05 bool(0) >? false 0.00/0.05 bool(s(0)) >? true 0.00/0.05 filter(F, nil) >? nil 0.00/0.05 filter(F, cons(X, Y)) >? consif(F X, X, filter(F, Y)) 0.00/0.05 consif(true, X, Y) >? cons(X, Y) 0.00/0.05 consif(false, X, Y) >? Y 0.00/0.05 0.00/0.05 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.05 0.00/0.05 The following interpretation satisfies the requirements: 0.00/0.05 0.00/0.05 0 = 3 0.00/0.05 bool = \y0.3 + 3y0 0.00/0.05 cons = \y0y1.2 + 2y0 + 2y1 0.00/0.05 consif = \y0y1y2.1 + y0 + 2y1 + 2y2 0.00/0.05 false = 1 0.00/0.05 filter = \G0y1.2y1 + G0(y1) + 2y1G0(y1) 0.00/0.05 nil = 2 0.00/0.05 rand = \y0.3 + 2y0 0.00/0.05 s = \y0.3 + 3y0 0.00/0.05 true = 3 0.00/0.05 0.00/0.05 Using this interpretation, the requirements translate to: 0.00/0.05 0.00/0.05 [[rand(_x0)]] = 3 + 2x0 > x0 = [[_x0]] 0.00/0.05 [[rand(s(_x0))]] = 9 + 6x0 > 3 + 2x0 = [[rand(_x0)]] 0.00/0.05 [[bool(0)]] = 12 > 1 = [[false]] 0.00/0.05 [[bool(s(0))]] = 39 > 3 = [[true]] 0.00/0.05 [[filter(_F0, nil)]] = 4 + 5F0(2) > 2 = [[nil]] 0.00/0.05 [[filter(_F0, cons(_x1, _x2))]] = 4 + 4x1 + 4x2 + 4x1F0(2 + 2x1 + 2x2) + 4x2F0(2 + 2x1 + 2x2) + 5F0(2 + 2x1 + 2x2) > 1 + 3x1 + 4x2 + F0(x1) + 2F0(x2) + 4x2F0(x2) = [[consif(_F0 _x1, _x1, filter(_F0, _x2))]] 0.00/0.05 [[consif(true, _x0, _x1)]] = 4 + 2x0 + 2x1 > 2 + 2x0 + 2x1 = [[cons(_x0, _x1)]] 0.00/0.05 [[consif(false, _x0, _x1)]] = 2 + 2x0 + 2x1 > x1 = [[_x1]] 0.00/0.05 0.00/0.05 We can thus remove the following rules: 0.00/0.05 0.00/0.05 rand(X) => X 0.00/0.05 rand(s(X)) => rand(X) 0.00/0.05 bool(0) => false 0.00/0.05 bool(s(0)) => true 0.00/0.05 filter(F, nil) => nil 0.00/0.05 filter(F, cons(X, Y)) => consif(F X, X, filter(F, Y)) 0.00/0.05 consif(true, X, Y) => cons(X, Y) 0.00/0.05 consif(false, X, Y) => Y 0.00/0.05 0.00/0.05 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. 0.00/0.05 0.00/0.05 0.00/0.05 +++ Citations +++ 0.00/0.05 0.00/0.05 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 0.00/0.05 EOF