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