0.00/0.40 YES 0.00/0.41 We consider the system theBenchmark. 0.00/0.41 0.00/0.41 Alphabet: 0.00/0.41 0.00/0.41 0 : [] --> c 0.00/0.41 add : [] --> a -> c -> c 0.00/0.41 cons : [a * b] --> b 0.00/0.41 fold : [a -> c -> c * c] --> b -> c 0.00/0.41 mul : [] --> a -> c -> c 0.00/0.41 nil : [] --> b 0.00/0.41 plus : [c * c] --> c 0.00/0.41 prod : [] --> b -> c 0.00/0.41 s : [c] --> c 0.00/0.41 sum : [] --> b -> c 0.00/0.41 times : [c * c] --> c 0.00/0.41 0.00/0.41 Rules: 0.00/0.41 0.00/0.41 fold(f, x) nil => x 0.00/0.41 fold(f, x) cons(y, z) => f y (fold(f, x) z) 0.00/0.41 plus(0, x) => x 0.00/0.41 plus(s(x), y) => s(plus(x, y)) 0.00/0.41 times(0, x) => 0 0.00/0.41 times(s(x), y) => plus(times(x, y), y) 0.00/0.41 sum => fold(add, 0) 0.00/0.41 prod => fold(mul, s(0)) 0.00/0.41 0.00/0.41 This AFS is converted to an AFSM simply by replacing all free variables by meta-variables (with arity 0). 0.00/0.41 0.00/0.41 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.41 0.00/0.41 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.41 0.00/0.41 fold(F, X) nil >? X 0.00/0.41 fold(F, X) cons(Y, Z) >? F Y (fold(F, X) Z) 0.00/0.41 plus(0, X) >? X 0.00/0.41 plus(s(X), Y) >? s(plus(X, Y)) 0.00/0.41 times(0, X) >? 0 0.00/0.41 times(s(X), Y) >? plus(times(X, Y), Y) 0.00/0.41 sum >? fold(add, 0) 0.00/0.41 prod >? fold(mul, s(0)) 0.00/0.41 0.00/0.41 We use a recursive path ordering as defined in [Kop12, Chapter 5]. 0.00/0.41 0.00/0.41 Argument functions: 0.00/0.41 0.00/0.41 [[0]] = _|_ 0.00/0.41 [[add]] = _|_ 0.00/0.41 [[mul]] = _|_ 0.00/0.41 0.00/0.41 We choose Lex = {} and Mul = {@_{o -> o -> o}, @_{o -> o}, cons, fold, nil, plus, prod, s, sum, times}, and the following precedence: nil > prod > sum > fold > @_{o -> o -> o} > @_{o -> o} > cons > times > plus > s 0.00/0.41 0.00/0.41 Taking the argument function into account, and fixing the greater / greater equal choices, the constraints can be denoted as follows: 0.00/0.41 0.00/0.41 @_{o -> o}(fold(F, X), nil) > X 0.00/0.41 @_{o -> o}(fold(F, X), cons(Y, Z)) > @_{o -> o}(@_{o -> o -> o}(F, Y), @_{o -> o}(fold(F, X), Z)) 0.00/0.41 plus(_|_, X) >= X 0.00/0.41 plus(s(X), Y) >= s(plus(X, Y)) 0.00/0.41 times(_|_, X) >= _|_ 0.00/0.41 times(s(X), Y) > plus(times(X, Y), Y) 0.00/0.41 sum >= fold(_|_, _|_) 0.00/0.41 prod >= fold(_|_, s(_|_)) 0.00/0.41 0.00/0.41 With these choices, we have: 0.00/0.41 0.00/0.41 1] @_{o -> o}(fold(F, X), nil) > X because [2], by definition 0.00/0.41 2] @_{o -> o}*(fold(F, X), nil) >= X because [3], by (Select) 0.00/0.41 3] fold(F, X) @_{o -> o}*(fold(F, X), nil) >= X because [4] 0.00/0.41 4] fold*(F, X, @_{o -> o}*(fold(F, X), nil)) >= X because [5], by (Select) 0.00/0.41 5] X >= X by (Meta) 0.00/0.41 0.00/0.41 6] @_{o -> o}(fold(F, X), cons(Y, Z)) > @_{o -> o}(@_{o -> o -> o}(F, Y), @_{o -> o}(fold(F, X), Z)) because [7], by definition 0.00/0.41 7] @_{o -> o}*(fold(F, X), cons(Y, Z)) >= @_{o -> o}(@_{o -> o -> o}(F, Y), @_{o -> o}(fold(F, X), Z)) because [8], by (Select) 0.00/0.41 8] fold(F, X) @_{o -> o}*(fold(F, X), cons(Y, Z)) >= @_{o -> o}(@_{o -> o -> o}(F, Y), @_{o -> o}(fold(F, X), Z)) because [9] 0.00/0.41 9] fold*(F, X, @_{o -> o}*(fold(F, X), cons(Y, Z))) >= @_{o -> o}(@_{o -> o -> o}(F, Y), @_{o -> o}(fold(F, X), Z)) because fold > @_{o -> o}, [10] and [18], by (Copy) 0.00/0.41 10] fold*(F, X, @_{o -> o}*(fold(F, X), cons(Y, Z))) >= @_{o -> o -> o}(F, Y) because fold > @_{o -> o -> o}, [11] and [13], by (Copy) 0.00/0.41 11] fold*(F, X, @_{o -> o}*(fold(F, X), cons(Y, Z))) >= F because [12], by (Select) 0.00/0.41 12] F >= F by (Meta) 0.00/0.41 13] fold*(F, X, @_{o -> o}*(fold(F, X), cons(Y, Z))) >= Y because [14], by (Select) 0.00/0.41 14] @_{o -> o}*(fold(F, X), cons(Y, Z)) >= Y because [15], by (Select) 0.00/0.41 15] cons(Y, Z) >= Y because [16], by (Star) 0.00/0.41 16] cons*(Y, Z) >= Y because [17], by (Select) 0.00/0.41 17] Y >= Y by (Meta) 0.00/0.41 18] fold*(F, X, @_{o -> o}*(fold(F, X), cons(Y, Z))) >= @_{o -> o}(fold(F, X), Z) because [19], by (Select) 0.00/0.41 19] @_{o -> o}*(fold(F, X), cons(Y, Z)) >= @_{o -> o}(fold(F, X), Z) because @_{o -> o} in Mul, [20] and [23], by (Stat) 0.00/0.41 20] fold(F, X) >= fold(F, X) because fold in Mul, [21] and [22], by (Fun) 0.00/0.41 21] F >= F by (Meta) 0.00/0.41 22] X >= X by (Meta) 0.00/0.41 23] cons(Y, Z) > Z because [24], by definition 0.00/0.41 24] cons*(Y, Z) >= Z because [25], by (Select) 0.00/0.41 25] Z >= Z by (Meta) 0.00/0.41 0.00/0.41 26] plus(_|_, X) >= X because [27], by (Star) 0.00/0.41 27] plus*(_|_, X) >= X because [28], by (Select) 0.00/0.41 28] X >= X by (Meta) 0.00/0.41 0.00/0.41 29] plus(s(X), Y) >= s(plus(X, Y)) because [30], by (Star) 0.00/0.41 30] plus*(s(X), Y) >= s(plus(X, Y)) because plus > s and [31], by (Copy) 0.00/0.41 31] plus*(s(X), Y) >= plus(X, Y) because plus in Mul, [32] and [35], by (Stat) 0.00/0.41 32] s(X) > X because [33], by definition 0.00/0.41 33] s*(X) >= X because [34], by (Select) 0.00/0.41 34] X >= X by (Meta) 0.00/0.41 35] Y >= Y by (Meta) 0.00/0.41 0.00/0.41 36] times(_|_, X) >= _|_ by (Bot) 0.00/0.41 0.00/0.41 37] times(s(X), Y) > plus(times(X, Y), Y) because [38], by definition 0.00/0.41 38] times*(s(X), Y) >= plus(times(X, Y), Y) because times > plus, [39] and [44], by (Copy) 0.00/0.41 39] times*(s(X), Y) >= times(X, Y) because times in Mul, [40] and [43], by (Stat) 0.00/0.41 40] s(X) > X because [41], by definition 0.00/0.41 41] s*(X) >= X because [42], by (Select) 0.00/0.41 42] X >= X by (Meta) 0.00/0.41 43] Y >= Y by (Meta) 0.00/0.41 44] times*(s(X), Y) >= Y because [43], by (Select) 0.00/0.41 0.00/0.41 45] sum >= fold(_|_, _|_) because [46], by (Star) 0.00/0.41 46] sum* >= fold(_|_, _|_) because sum > fold, [47] and [48], by (Copy) 0.00/0.41 47] sum* >= _|_ by (Bot) 0.00/0.41 48] sum* >= _|_ by (Bot) 0.00/0.41 0.00/0.41 49] prod >= fold(_|_, s(_|_)) because [50], by (Star) 0.00/0.41 50] prod* >= fold(_|_, s(_|_)) because prod > fold, [51] and [52], by (Copy) 0.00/0.41 51] prod* >= _|_ by (Bot) 0.00/0.41 52] prod* >= s(_|_) because prod > s and [53], by (Copy) 0.00/0.41 53] prod* >= _|_ by (Bot) 0.00/0.41 0.00/0.41 We can thus remove the following rules: 0.00/0.41 0.00/0.41 fold(F, X) nil => X 0.00/0.41 fold(F, X) cons(Y, Z) => F Y (fold(F, X) Z) 0.00/0.41 times(s(X), Y) => plus(times(X, Y), Y) 0.00/0.41 0.00/0.41 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.41 0.00/0.41 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.41 0.00/0.41 plus(0, X) >? X 0.00/0.41 plus(s(X), Y) >? s(plus(X, Y)) 0.00/0.41 times(0, X) >? 0 0.00/0.41 sum >? fold(add, 0) 0.00/0.41 prod >? fold(mul, s(0)) 0.00/0.41 0.00/0.41 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.41 0.00/0.41 The following interpretation satisfies the requirements: 0.00/0.41 0.00/0.41 0 = 0 0.00/0.41 add = \y0y1.0 0.00/0.41 fold = \G0y1y2.y1 + G0(0,0) 0.00/0.41 mul = \y0y1.0 0.00/0.41 plus = \y0y1.3 + y1 + 3y0 0.00/0.41 prod = \y0.3 + 3y0 0.00/0.41 s = \y0.y0 0.00/0.41 sum = \y0.3 + 3y0 0.00/0.41 times = \y0y1.3 + y1 + 3y0 0.00/0.41 0.00/0.41 Using this interpretation, the requirements translate to: 0.00/0.41 0.00/0.41 [[plus(0, _x0)]] = 3 + x0 > x0 = [[_x0]] 0.00/0.41 [[plus(s(_x0), _x1)]] = 3 + x1 + 3x0 >= 3 + x1 + 3x0 = [[s(plus(_x0, _x1))]] 0.00/0.41 [[times(0, _x0)]] = 3 + x0 > 0 = [[0]] 0.00/0.41 [[sum]] = \y0.3 + 3y0 > \y0.0 = [[fold(add, 0)]] 0.00/0.41 [[prod]] = \y0.3 + 3y0 > \y0.0 = [[fold(mul, s(0))]] 0.00/0.41 0.00/0.41 We can thus remove the following rules: 0.00/0.41 0.00/0.41 plus(0, X) => X 0.00/0.41 times(0, X) => 0 0.00/0.41 sum => fold(add, 0) 0.00/0.41 prod => fold(mul, s(0)) 0.00/0.41 0.00/0.41 We use rule removal, following [Kop12, Theorem 2.23]. 0.00/0.41 0.00/0.41 This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): 0.00/0.41 0.00/0.41 plus(s(X), Y) >? s(plus(X, Y)) 0.00/0.41 0.00/0.41 We orient these requirements with a polynomial interpretation in the natural numbers. 0.00/0.41 0.00/0.41 The following interpretation satisfies the requirements: 0.00/0.41 0.00/0.41 plus = \y0y1.y1 + 3y0 0.00/0.41 s = \y0.1 + y0 0.00/0.41 0.00/0.41 Using this interpretation, the requirements translate to: 0.00/0.41 0.00/0.41 [[plus(s(_x0), _x1)]] = 3 + x1 + 3x0 > 1 + x1 + 3x0 = [[s(plus(_x0, _x1))]] 0.00/0.41 0.00/0.41 We can thus remove the following rules: 0.00/0.41 0.00/0.41 plus(s(X), Y) => s(plus(X, Y)) 0.00/0.41 0.00/0.41 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.41 0.00/0.41 0.00/0.41 +++ Citations +++ 0.00/0.41 0.00/0.41 [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. 0.00/0.42 EOF