/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 : [] --> a ascending!fac6220sort : [b] --> b cons : [a * b] --> b descending!fac6220sort : [b] --> b insert : [a -> a -> a * a -> a -> a * b * a] --> b max : [] --> a -> a -> a min : [] --> a -> a -> a nil : [] --> b s : [a] --> a sort : [a -> a -> a * a -> a -> a * b] --> b Rules: max 0 x => x max x 0 => x max s(x) s(y) => max x y min 0 x => 0 min x 0 => 0 min s(x) s(y) => min x y insert(f, g, nil, x) => cons(x, nil) insert(f, g, cons(x, y), z) => cons(f z x, insert(f, g, y, g z x)) sort(f, g, nil) => nil sort(f, g, cons(x, y)) => insert(f, g, sort(f, g, y), x) ascending!fac6220sort(x) => sort(min, max, x) descending!fac6220sort(x) => sort(max, min, x) 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]): max 0 X >? X max X 0 >? X max s(X) s(Y) >? max X Y min 0 X >? 0 min X 0 >? 0 min s(X) s(Y) >? min X Y insert(F, G, nil, X) >? cons(X, nil) insert(F, G, cons(X, Y), Z) >? cons(F Z X, insert(F, G, Y, G Z X)) sort(F, G, nil) >? nil sort(F, G, cons(X, Y)) >? insert(F, G, sort(F, G, Y), X) ascending!fac6220sort(X) >? sort(min, max, X) descending!fac6220sort(X) >? sort(max, min, X) about to try horpo We use a recursive path ordering as defined in [Kop12, Chapter 5]. Argument functions: [[0]] = _|_ [[insert(x_1, x_2, x_3, x_4)]] = insert(x_2, x_3, x_4, x_1) [[nil]] = _|_ We choose Lex = {insert} and Mul = {@_{o -> o -> o}, @_{o -> o}, ascending!fac6220sort, cons, descending!fac6220sort, max, min, s, sort}, and the following precedence: ascending!fac6220sort > descending!fac6220sort = min > max > s > sort > insert > cons > @_{o -> o -> 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}(@_{o -> o -> o}(max, _|_), X) >= X @_{o -> o}(@_{o -> o -> o}(max, X), _|_) >= X @_{o -> o}(@_{o -> o -> o}(max, s(X)), s(Y)) >= @_{o -> o}(@_{o -> o -> o}(max, X), Y) @_{o -> o}(@_{o -> o -> o}(min, _|_), X) >= _|_ @_{o -> o}(@_{o -> o -> o}(min, X), _|_) >= _|_ @_{o -> o}(@_{o -> o -> o}(min, s(X)), s(Y)) >= @_{o -> o}(@_{o -> o -> o}(min, X), Y) insert(F, G, _|_, X) >= cons(X, _|_) insert(F, G, cons(X, Y), Z) > cons(@_{o -> o}(@_{o -> o -> o}(F, Z), X), insert(F, G, Y, @_{o -> o}(@_{o -> o -> o}(G, Z), X))) sort(F, G, _|_) >= _|_ sort(F, G, cons(X, Y)) > insert(F, G, sort(F, G, Y), X) ascending!fac6220sort(X) >= sort(min, max, X) descending!fac6220sort(X) >= sort(max, min, X) With these choices, we have: 1] @_{o -> o}(@_{o -> o -> o}(max, _|_), X) >= X because [2], by (Star) 2] @_{o -> o}*(@_{o -> o -> o}(max, _|_), X) >= X because [3], by (Select) 3] X >= X by (Meta) 4] @_{o -> o}(@_{o -> o -> o}(max, X), _|_) >= X because [5], by (Star) 5] @_{o -> o}*(@_{o -> o -> o}(max, X), _|_) >= X because [6], by (Select) 6] @_{o -> o -> o}(max, X) @_{o -> o}*(@_{o -> o -> o}(max, X), _|_) >= X because [7] 7] @_{o -> o -> o}*(max, X, @_{o -> o}*(@_{o -> o -> o}(max, X), _|_)) >= X because [8], by (Select) 8] X >= X by (Meta) 9] @_{o -> o}(@_{o -> o -> o}(max, s(X)), s(Y)) >= @_{o -> o}(@_{o -> o -> o}(max, X), Y) because @_{o -> o} in Mul, [10] and [16], by (Fun) 10] @_{o -> o -> o}(max, s(X)) >= @_{o -> o -> o}(max, X) because [11], by (Star) 11] @_{o -> o -> o}*(max, s(X)) >= @_{o -> o -> o}(max, X) because @_{o -> o -> o} in Mul, [12] and [13], by (Stat) 12] max >= max by (Fun) 13] s(X) > X because [14], by definition 14] s*(X) >= X because [15], by (Select) 15] X >= X by (Meta) 16] s(Y) >= Y because [17], by (Star) 17] s*(Y) >= Y because [18], by (Select) 18] Y >= Y by (Meta) 19] @_{o -> o}(@_{o -> o -> o}(min, _|_), X) >= _|_ by (Bot) 20] @_{o -> o}(@_{o -> o -> o}(min, X), _|_) >= _|_ by (Bot) 21] @_{o -> o}(@_{o -> o -> o}(min, s(X)), s(Y)) >= @_{o -> o}(@_{o -> o -> o}(min, X), Y) because @_{o -> o} in Mul, [22] and [27], by (Fun) 22] @_{o -> o -> o}(min, s(X)) >= @_{o -> o -> o}(min, X) because @_{o -> o -> o} in Mul, [23] and [24], by (Fun) 23] min >= min by (Fun) 24] s(X) >= X because [25], by (Star) 25] s*(X) >= X because [26], by (Select) 26] X >= X by (Meta) 27] s(Y) >= Y because [28], by (Star) 28] s*(Y) >= Y because [29], by (Select) 29] Y >= Y by (Meta) 30] insert(F, G, _|_, X) >= cons(X, _|_) because [31], by (Star) 31] insert*(F, G, _|_, X) >= cons(X, _|_) because insert > cons, [32] and [34], by (Copy) 32] insert*(F, G, _|_, X) >= X because [33], by (Select) 33] X >= X by (Meta) 34] insert*(F, G, _|_, X) >= _|_ by (Bot) 35] insert(F, G, cons(X, Y), Z) > cons(@_{o -> o}(@_{o -> o -> o}(F, Z), X), insert(F, G, Y, @_{o -> o}(@_{o -> o -> o}(G, Z), X))) because [36], by definition 36] insert*(F, G, cons(X, Y), Z) >= cons(@_{o -> o}(@_{o -> o -> o}(F, Z), X), insert(F, G, Y, @_{o -> o}(@_{o -> o -> o}(G, Z), X))) because insert > cons, [37] and [47], by (Copy) 37] insert*(F, G, cons(X, Y), Z) >= @_{o -> o}(@_{o -> o -> o}(F, Z), X) because insert > @_{o -> o}, [38] and [43], by (Copy) 38] insert*(F, G, cons(X, Y), Z) >= @_{o -> o -> o}(F, Z) because insert > @_{o -> o -> o}, [39] and [41], by (Copy) 39] insert*(F, G, cons(X, Y), Z) >= F because [40], by (Select) 40] F >= F by (Meta) 41] insert*(F, G, cons(X, Y), Z) >= Z because [42], by (Select) 42] Z >= Z by (Meta) 43] insert*(F, G, cons(X, Y), Z) >= X because [44], by (Select) 44] cons(X, Y) >= X because [45], by (Star) 45] cons*(X, Y) >= X because [46], by (Select) 46] X >= X by (Meta) 47] insert*(F, G, cons(X, Y), Z) >= insert(F, G, Y, @_{o -> o}(@_{o -> o -> o}(G, Z), X)) because [48], [49], [39], [52], [53] and [55], by (Stat) 48] G >= G by (Meta) 49] cons(X, Y) > Y because [50], by definition 50] cons*(X, Y) >= Y because [51], by (Select) 51] Y >= Y by (Meta) 52] insert*(F, G, cons(X, Y), Z) >= G because [48], by (Select) 53] insert*(F, G, cons(X, Y), Z) >= Y because [54], by (Select) 54] cons(X, Y) >= Y because [50], by (Star) 55] insert*(F, G, cons(X, Y), Z) >= @_{o -> o}(@_{o -> o -> o}(G, Z), X) because insert > @_{o -> o}, [56] and [43], by (Copy) 56] insert*(F, G, cons(X, Y), Z) >= @_{o -> o -> o}(G, Z) because insert > @_{o -> o -> o}, [52] and [41], by (Copy) 57] sort(F, G, _|_) >= _|_ by (Bot) 58] sort(F, G, cons(X, Y)) > insert(F, G, sort(F, G, Y), X) because [59], by definition 59] sort*(F, G, cons(X, Y)) >= insert(F, G, sort(F, G, Y), X) because sort > insert, [60], [62], [64] and [70], by (Copy) 60] sort*(F, G, cons(X, Y)) >= F because [61], by (Select) 61] F >= F by (Meta) 62] sort*(F, G, cons(X, Y)) >= G because [63], by (Select) 63] G >= G by (Meta) 64] sort*(F, G, cons(X, Y)) >= sort(F, G, Y) because sort in Mul, [65], [66] and [67], by (Stat) 65] F >= F by (Meta) 66] G >= G by (Meta) 67] cons(X, Y) > Y because [68], by definition 68] cons*(X, Y) >= Y because [69], by (Select) 69] Y >= Y by (Meta) 70] sort*(F, G, cons(X, Y)) >= X because [71], by (Select) 71] cons(X, Y) >= X because [72], by (Star) 72] cons*(X, Y) >= X because [73], by (Select) 73] X >= X by (Meta) 74] ascending!fac6220sort(X) >= sort(min, max, X) because [75], by (Star) 75] ascending!fac6220sort*(X) >= sort(min, max, X) because ascending!fac6220sort > sort, [76], [77] and [78], by (Copy) 76] ascending!fac6220sort*(X) >= min because ascending!fac6220sort > min, by (Copy) 77] ascending!fac6220sort*(X) >= max because ascending!fac6220sort > max, by (Copy) 78] ascending!fac6220sort*(X) >= X because [79], by (Select) 79] X >= X by (Meta) 80] descending!fac6220sort(X) >= sort(max, min, X) because [81], by (Star) 81] descending!fac6220sort*(X) >= sort(max, min, X) because descending!fac6220sort > sort, [82], [83] and [84], by (Copy) 82] descending!fac6220sort*(X) >= max because descending!fac6220sort > max, by (Copy) 83] descending!fac6220sort*(X) >= min because descending!fac6220sort = min and descending!fac6220sort in Mul, by (Stat) 84] descending!fac6220sort*(X) >= X because [85], by (Select) 85] X >= X by (Meta) We can thus remove the following rules: insert(F, G, cons(X, Y), Z) => cons(F Z X, insert(F, G, Y, G Z X)) sort(F, G, cons(X, Y)) => insert(F, G, sort(F, G, Y), X) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): max 0 X >? X max X 0 >? X max s(X) s(Y) >? max X Y min 0 X >? 0 min X 0 >? 0 min s(X) s(Y) >? min X Y insert(F, G, nil, X) >? cons(X, nil) sort(F, G, nil) >? nil ascending!fac6220sort(X) >? sort(min, max, X) descending!fac6220sort(X) >? sort(max, min, X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 3 ascending!fac6220sort = \y0.3 + 3y0 cons = \y0y1.y0 + y1 descending!fac6220sort = \y0.3 + 3y0 insert = \G0G1y2y3.3 + 3y2 + 3y3 + G0(0,0) + G1(0,0) max = \y0y1.0 min = \y0y1.0 nil = 0 s = \y0.3 + 3y0 sort = \G0G1y2.2 + y2 + G0(0,0) + G1(0,0) Using this interpretation, the requirements translate to: [[max 0 _x0]] = 3 + x0 > x0 = [[_x0]] [[max _x0 0]] = 3 + x0 > x0 = [[_x0]] [[max s(_x0) s(_x1)]] = 6 + 3x0 + 3x1 > x0 + x1 = [[max _x0 _x1]] [[min 0 _x0]] = 3 + x0 >= 3 = [[0]] [[min _x0 0]] = 3 + x0 >= 3 = [[0]] [[min s(_x0) s(_x1)]] = 6 + 3x0 + 3x1 > x0 + x1 = [[min _x0 _x1]] [[insert(_F0, _F1, nil, _x2)]] = 3 + 3x2 + F0(0,0) + F1(0,0) > x2 = [[cons(_x2, nil)]] [[sort(_F0, _F1, nil)]] = 2 + F0(0,0) + F1(0,0) > 0 = [[nil]] [[ascending!fac6220sort(_x0)]] = 3 + 3x0 > 2 + x0 = [[sort(min, max, _x0)]] [[descending!fac6220sort(_x0)]] = 3 + 3x0 > 2 + x0 = [[sort(max, min, _x0)]] We can thus remove the following rules: max 0 X => X max X 0 => X max s(X) s(Y) => max X Y min s(X) s(Y) => min X Y insert(F, G, nil, X) => cons(X, nil) sort(F, G, nil) => nil ascending!fac6220sort(X) => sort(min, max, X) descending!fac6220sort(X) => sort(max, min, X) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): min(0, X) >? 0 min(X, 0) >? 0 We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 min = \y0y1.3 + 3y0 + 3y1 Using this interpretation, the requirements translate to: [[min(0, _x0)]] = 3 + 3x0 > 0 = [[0]] [[min(_x0, 0)]] = 3 + 3x0 > 0 = [[0]] We can thus remove the following rules: min(0, X) => 0 min(X, 0) => 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.