/export/starexec/sandbox/solver/bin/starexec_run_FirstOrder /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- YES We consider the system theBenchmark. We are asked to determine termination of the following first-order TRS. 0 : [] --> o add : [o * o] --> o app : [o * o] --> o concat : [o * o] --> o cons : [o * o] --> o false : [] --> o leaf : [] --> o less!6220leaves : [o * o] --> o minus : [o * o] --> o nil : [] --> o quot : [o * o] --> o reverse : [o] --> o s : [o] --> o shuffle : [o] --> o true : [] --> o minus(X, 0) => X minus(s(X), s(Y)) => minus(X, Y) quot(0, s(X)) => 0 quot(s(X), s(Y)) => s(quot(minus(X, Y), s(Y))) app(nil, X) => X app(add(X, Y), Z) => add(X, app(Y, Z)) reverse(nil) => nil reverse(add(X, Y)) => app(reverse(Y), add(X, nil)) shuffle(nil) => nil shuffle(add(X, Y)) => add(X, shuffle(reverse(Y))) concat(leaf, X) => X concat(cons(X, Y), Z) => cons(X, concat(Y, Z)) less!6220leaves(X, leaf) => false less!6220leaves(leaf, cons(X, Y)) => true less!6220leaves(cons(X, Y), cons(Z, U)) => less!6220leaves(concat(X, Y), concat(Z, U)) As the system is orthogonal, it is terminating if it is innermost terminating by [Gra95]. Then, by [FuhGieParSchSwi11], it suffices to prove (innermost) termination of the typed system, with sort annotations chosen to respect the rules, as follows: 0 : [] --> ze add : [lb * ze] --> ze app : [ze * ze] --> ze concat : [ze * ze] --> ze cons : [ze * ze] --> ze false : [] --> af leaf : [] --> ze less!6220leaves : [ze * ze] --> af minus : [ze * ze] --> ze nil : [] --> ze quot : [ze * ze] --> ze reverse : [ze] --> ze s : [ze] --> ze shuffle : [ze] --> ze true : [] --> af We use the dependency pair framework as described in [Kop12, Ch. 6/7], with static dependency pairs (see [KusIsoSakBla09] and the adaptation for AFSMs in [Kop12, Ch. 7.8]). We thus obtain the following dependency pair problem (P_0, R_0, minimal, formative): Dependency Pairs P_0: 0] minus#(s(X), s(Y)) =#> minus#(X, Y) 1] quot#(s(X), s(Y)) =#> quot#(minus(X, Y), s(Y)) 2] quot#(s(X), s(Y)) =#> minus#(X, Y) 3] app#(add(X, Y), Z) =#> app#(Y, Z) 4] reverse#(add(X, Y)) =#> app#(reverse(Y), add(X, nil)) 5] reverse#(add(X, Y)) =#> reverse#(Y) 6] shuffle#(add(X, Y)) =#> shuffle#(reverse(Y)) 7] shuffle#(add(X, Y)) =#> reverse#(Y) 8] concat#(cons(X, Y), Z) =#> concat#(Y, Z) 9] less!6220leaves#(cons(X, Y), cons(Z, U)) =#> less!6220leaves#(concat(X, Y), concat(Z, U)) 10] less!6220leaves#(cons(X, Y), cons(Z, U)) =#> concat#(X, Y) 11] less!6220leaves#(cons(X, Y), cons(Z, U)) =#> concat#(Z, U) Rules R_0: minus(X, 0) => X minus(s(X), s(Y)) => minus(X, Y) quot(0, s(X)) => 0 quot(s(X), s(Y)) => s(quot(minus(X, Y), s(Y))) app(nil, X) => X app(add(X, Y), Z) => add(X, app(Y, Z)) reverse(nil) => nil reverse(add(X, Y)) => app(reverse(Y), add(X, nil)) shuffle(nil) => nil shuffle(add(X, Y)) => add(X, shuffle(reverse(Y))) concat(leaf, X) => X concat(cons(X, Y), Z) => cons(X, concat(Y, Z)) less!6220leaves(X, leaf) => false less!6220leaves(leaf, cons(X, Y)) => true less!6220leaves(cons(X, Y), cons(Z, U)) => less!6220leaves(concat(X, Y), concat(Z, U)) Thus, the original system is terminating if (P_0, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_0, R_0, minimal, formative). We place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : 0 * 1 : 1, 2 * 2 : 0 * 3 : 3 * 4 : 3 * 5 : 4, 5 * 6 : 6, 7 * 7 : 4, 5 * 8 : 8 * 9 : 9, 10, 11 * 10 : 8 * 11 : 8 This graph has the following strongly connected components: P_1: minus#(s(X), s(Y)) =#> minus#(X, Y) P_2: quot#(s(X), s(Y)) =#> quot#(minus(X, Y), s(Y)) P_3: app#(add(X, Y), Z) =#> app#(Y, Z) P_4: reverse#(add(X, Y)) =#> reverse#(Y) P_5: shuffle#(add(X, Y)) =#> shuffle#(reverse(Y)) P_6: concat#(cons(X, Y), Z) =#> concat#(Y, Z) P_7: less!6220leaves#(cons(X, Y), cons(Z, U)) =#> less!6220leaves#(concat(X, Y), concat(Z, U)) By [Kop12, Thm. 7.31], we may replace any dependency pair problem (P_0, R_0, m, f) by (P_1, R_0, m, f), (P_2, R_0, m, f), (P_3, R_0, m, f), (P_4, R_0, m, f), (P_5, R_0, m, f), (P_6, R_0, m, f) and (P_7, R_0, m, f). Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative), (P_5, R_0, minimal, formative), (P_6, R_0, minimal, formative) and (P_7, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_7, R_0, minimal, formative). The formative rules of (P_7, R_0) are R_1 ::= minus(X, 0) => X minus(s(X), s(Y)) => minus(X, Y) quot(0, s(X)) => 0 quot(s(X), s(Y)) => s(quot(minus(X, Y), s(Y))) app(nil, X) => X app(add(X, Y), Z) => add(X, app(Y, Z)) reverse(nil) => nil reverse(add(X, Y)) => app(reverse(Y), add(X, nil)) shuffle(nil) => nil shuffle(add(X, Y)) => add(X, shuffle(reverse(Y))) concat(leaf, X) => X concat(cons(X, Y), Z) => cons(X, concat(Y, Z)) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_7, R_0, minimal, formative) by (P_7, R_1, minimal, formative). Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative), (P_5, R_0, minimal, formative), (P_6, R_0, minimal, formative) and (P_7, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_7, R_1, minimal, formative). We will use the reduction pair processor with usable rules [Kop12, Thm. 7.44]. The usable rules of (P_7, R_1) are: concat(leaf, X) => X concat(cons(X, Y), Z) => cons(X, concat(Y, Z)) It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: less!6220leaves#(cons(X, Y), cons(Z, U)) >? less!6220leaves#(concat(X, Y), concat(Z, U)) concat(leaf, X) >= X concat(cons(X, Y), Z) >= cons(X, concat(Y, Z)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: concat = \y0y1.y0 + y1 cons = \y0y1.3 + y0 + y1 leaf = 0 less!6220leaves# = \y0y1.3y0 + 3y1 Using this interpretation, the requirements translate to: [[less!6220leaves#(cons(_x0, _x1), cons(_x2, _x3))]] = 18 + 3x0 + 3x1 + 3x2 + 3x3 > 3x0 + 3x1 + 3x2 + 3x3 = [[less!6220leaves#(concat(_x0, _x1), concat(_x2, _x3))]] [[concat(leaf, _x0)]] = x0 >= x0 = [[_x0]] [[concat(cons(_x0, _x1), _x2)]] = 3 + x0 + x1 + x2 >= 3 + x0 + x1 + x2 = [[cons(_x0, concat(_x1, _x2))]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_7, R_1) by ({}, R_1). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative), (P_5, R_0, minimal, formative) and (P_6, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_6, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(concat#) = 1 Thus, we can orient the dependency pairs as follows: nu(concat#(cons(X, Y), Z)) = cons(X, Y) |> Y = nu(concat#(Y, Z)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_6, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative) and (P_5, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_5, R_0, minimal, formative). The formative rules of (P_5, R_0) are R_2 ::= minus(X, 0) => X minus(s(X), s(Y)) => minus(X, Y) quot(0, s(X)) => 0 quot(s(X), s(Y)) => s(quot(minus(X, Y), s(Y))) app(nil, X) => X app(add(X, Y), Z) => add(X, app(Y, Z)) reverse(nil) => nil reverse(add(X, Y)) => app(reverse(Y), add(X, nil)) shuffle(nil) => nil shuffle(add(X, Y)) => add(X, shuffle(reverse(Y))) concat(leaf, X) => X By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_5, R_0, minimal, formative) by (P_5, R_2, minimal, formative). Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative), (P_4, R_0, minimal, formative) and (P_5, R_2, minimal, formative) is finite. We consider the dependency pair problem (P_5, R_2, minimal, formative). We will use the reduction pair processor with usable rules [Kop12, Thm. 7.44]. The usable rules of (P_5, R_2) are: app(nil, X) => X app(add(X, Y), Z) => add(X, app(Y, Z)) reverse(nil) => nil reverse(add(X, Y)) => app(reverse(Y), add(X, nil)) It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: shuffle#(add(X, Y)) >? shuffle#(reverse(Y)) app(nil, X) >= X app(add(X, Y), Z) >= add(X, app(Y, Z)) reverse(nil) >= nil reverse(add(X, Y)) >= app(reverse(Y), add(X, nil)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: add = \y0y1.2 + y1 app = \y0y1.y0 + y1 nil = 0 reverse = \y0.y0 shuffle# = \y0.2y0 Using this interpretation, the requirements translate to: [[shuffle#(add(_x0, _x1))]] = 4 + 2x1 > 2x1 = [[shuffle#(reverse(_x1))]] [[app(nil, _x0)]] = x0 >= x0 = [[_x0]] [[app(add(_x0, _x1), _x2)]] = 2 + x1 + x2 >= 2 + x1 + x2 = [[add(_x0, app(_x1, _x2))]] [[reverse(nil)]] = 0 >= 0 = [[nil]] [[reverse(add(_x0, _x1))]] = 2 + x1 >= 2 + x1 = [[app(reverse(_x1), add(_x0, nil))]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_5, R_2) by ({}, R_2). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative), (P_3, R_0, minimal, formative) and (P_4, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_4, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(reverse#) = 1 Thus, we can orient the dependency pairs as follows: nu(reverse#(add(X, Y))) = add(X, Y) |> Y = nu(reverse#(Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_4, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, R_0, minimal, formative) and (P_3, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_3, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(app#) = 1 Thus, we can orient the dependency pairs as follows: nu(app#(add(X, Y), Z)) = add(X, Y) |> Y = nu(app#(Y, Z)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_3, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if each of (P_1, R_0, minimal, formative) and (P_2, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_2, R_0, minimal, formative). The formative rules of (P_2, R_0) are exactly R_2: minus(X, 0) => X minus(s(X), s(Y)) => minus(X, Y) quot(0, s(X)) => 0 quot(s(X), s(Y)) => s(quot(minus(X, Y), s(Y))) app(nil, X) => X app(add(X, Y), Z) => add(X, app(Y, Z)) reverse(nil) => nil reverse(add(X, Y)) => app(reverse(Y), add(X, nil)) shuffle(nil) => nil shuffle(add(X, Y)) => add(X, shuffle(reverse(Y))) concat(leaf, X) => X By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_2, R_0, minimal, formative) by (P_2, R_2, minimal, formative). Thus, the original system is terminating if each of (P_1, R_0, minimal, formative) and (P_2, R_2, minimal, formative) is finite. We consider the dependency pair problem (P_2, R_2, minimal, formative). We will use the reduction pair processor with usable rules [Kop12, Thm. 7.44]. The usable rules of (P_2, R_2) are: minus(X, 0) => X minus(s(X), s(Y)) => minus(X, Y) It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: quot#(s(X), s(Y)) >? quot#(minus(X, Y), s(Y)) minus(X, 0) >= X minus(s(X), s(Y)) >= minus(X, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 minus = \y0y1.y0 quot# = \y0y1.3y0 s = \y0.3 + 3y0 Using this interpretation, the requirements translate to: [[quot#(s(_x0), s(_x1))]] = 9 + 9x0 > 3x0 = [[quot#(minus(_x0, _x1), s(_x1))]] [[minus(_x0, 0)]] = x0 >= x0 = [[_x0]] [[minus(s(_x0), s(_x1))]] = 3 + 3x0 >= x0 = [[minus(_x0, _x1)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_2, R_2) by ({}, R_2). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. Thus, the original system is terminating if (P_1, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_1, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(minus#) = 1 Thus, we can orient the dependency pairs as follows: nu(minus#(s(X), s(Y))) = s(X) |> X = nu(minus#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_1, R_0, minimal, f) by ({}, R_0, minimal, f). By the empty set processor [Kop12, Thm. 7.15] this problem may be immediately removed. As all dependency pair problems were succesfully simplified with sound (and complete) processors until nothing remained, we conclude termination. +++ Citations +++ [FuhGieParSchSwi11] C. Fuhs, J. Giesl, M. Parting, P. Schneider-Kamp, and S. Swiderski. Proving Termination by Dependency Pairs and Inductive Theorem Proving. In volume 47(2) of Journal of Automated Reasoning. 133--160, 2011. [Gra95] B. Gramlich. Abstract Relations Between Restricted Termination and Confluence Properties of Rewrite Systems. In volume 24(1-2) of Fundamentae Informaticae. 3--23, 1995. [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012. [KusIsoSakBla09] K. Kusakari, Y. Isogai, M. Sakai, and F. Blanqui. Static Dependency Pair Method Based On Strong Computability for Higher-Order Rewrite Systems. In volume 92(10) of IEICE Transactions on Information and Systems. 2007--2015, 2009.