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