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