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