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