/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 app : [o * o] --> o cons : [o * o] --> o eq : [o * o] --> o false : [] --> o if : [o * o * o] --> o ifinter : [o * o * o * o] --> o ifmem : [o * o * o] --> o inter : [o * o] --> o mem : [o * o] --> o nil : [] --> o s : [o] --> o true : [] --> o if(true, X, Y) => X if(false, X, Y) => Y eq(0, 0) => true eq(0, s(X)) => false eq(s(X), 0) => false eq(s(X), s(Y)) => eq(X, Y) app(nil, X) => X app(cons(X, Y), Z) => cons(X, app(Y, Z)) app(app(X, Y), Z) => app(X, app(Y, Z)) mem(X, nil) => false mem(X, cons(Y, Z)) => ifmem(eq(X, Y), X, Z) ifmem(true, X, Y) => true ifmem(false, X, Y) => mem(X, Y) inter(X, nil) => nil inter(nil, X) => nil inter(app(X, Y), Z) => app(inter(X, Z), inter(Y, Z)) inter(X, app(Y, Z)) => app(inter(X, Y), inter(X, Z)) inter(cons(X, Y), Z) => ifinter(mem(X, Z), X, Y, Z) inter(X, cons(Y, Z)) => ifinter(mem(Y, X), Y, Z, X) ifinter(true, X, Y, Z) => cons(X, inter(Y, Z)) ifinter(false, X, Y, Z) => inter(Y, Z) 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] eq#(s(X), s(Y)) =#> eq#(X, Y) 1] app#(cons(X, Y), Z) =#> app#(Y, Z) 2] app#(app(X, Y), Z) =#> app#(X, app(Y, Z)) 3] app#(app(X, Y), Z) =#> app#(Y, Z) 4] mem#(X, cons(Y, Z)) =#> ifmem#(eq(X, Y), X, Z) 5] mem#(X, cons(Y, Z)) =#> eq#(X, Y) 6] ifmem#(false, X, Y) =#> mem#(X, Y) 7] inter#(app(X, Y), Z) =#> app#(inter(X, Z), inter(Y, Z)) 8] inter#(app(X, Y), Z) =#> inter#(X, Z) 9] inter#(app(X, Y), Z) =#> inter#(Y, Z) 10] inter#(X, app(Y, Z)) =#> app#(inter(X, Y), inter(X, Z)) 11] inter#(X, app(Y, Z)) =#> inter#(X, Y) 12] inter#(X, app(Y, Z)) =#> inter#(X, Z) 13] inter#(cons(X, Y), Z) =#> ifinter#(mem(X, Z), X, Y, Z) 14] inter#(cons(X, Y), Z) =#> mem#(X, Z) 15] inter#(X, cons(Y, Z)) =#> ifinter#(mem(Y, X), Y, Z, X) 16] inter#(X, cons(Y, Z)) =#> mem#(Y, X) 17] ifinter#(true, X, Y, Z) =#> inter#(Y, Z) 18] ifinter#(false, X, Y, Z) =#> inter#(Y, Z) Rules R_0: if(true, X, Y) => X if(false, X, Y) => Y eq(0, 0) => true eq(0, s(X)) => false eq(s(X), 0) => false eq(s(X), s(Y)) => eq(X, Y) app(nil, X) => X app(cons(X, Y), Z) => cons(X, app(Y, Z)) app(app(X, Y), Z) => app(X, app(Y, Z)) mem(X, nil) => false mem(X, cons(Y, Z)) => ifmem(eq(X, Y), X, Z) ifmem(true, X, Y) => true ifmem(false, X, Y) => mem(X, Y) inter(X, nil) => nil inter(nil, X) => nil inter(app(X, Y), Z) => app(inter(X, Z), inter(Y, Z)) inter(X, app(Y, Z)) => app(inter(X, Y), inter(X, Z)) inter(cons(X, Y), Z) => ifinter(mem(X, Z), X, Y, Z) inter(X, cons(Y, Z)) => ifinter(mem(Y, X), Y, Z, X) ifinter(true, X, Y, Z) => cons(X, inter(Y, Z)) ifinter(false, X, Y, Z) => inter(Y, Z) 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, 3 * 2 : 1, 2, 3 * 3 : 1, 2, 3 * 4 : 6 * 5 : 0 * 6 : 4, 5 * 7 : 1, 2, 3 * 8 : 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 9 : 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 10 : 1, 2, 3 * 11 : 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 12 : 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 13 : 17, 18 * 14 : 4, 5 * 15 : 17, 18 * 16 : 4, 5 * 17 : 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 18 : 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 This graph has the following strongly connected components: P_1: eq#(s(X), s(Y)) =#> eq#(X, Y) P_2: app#(cons(X, Y), Z) =#> app#(Y, Z) app#(app(X, Y), Z) =#> app#(X, app(Y, Z)) app#(app(X, Y), Z) =#> app#(Y, Z) P_3: mem#(X, cons(Y, Z)) =#> ifmem#(eq(X, Y), X, Z) ifmem#(false, X, Y) =#> mem#(X, Y) P_4: inter#(app(X, Y), Z) =#> inter#(X, Z) inter#(app(X, Y), Z) =#> inter#(Y, Z) inter#(X, app(Y, Z)) =#> inter#(X, Y) inter#(X, app(Y, Z)) =#> inter#(X, Z) inter#(cons(X, Y), Z) =#> ifinter#(mem(X, Z), X, Y, Z) inter#(X, cons(Y, Z)) =#> ifinter#(mem(Y, X), Y, Z, X) ifinter#(true, X, Y, Z) =#> inter#(Y, Z) ifinter#(false, X, Y, Z) =#> inter#(Y, Z) 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) and (P_4, 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) and (P_4, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_4, R_0, minimal, formative). We will use the reduction pair processor with usable rules [Kop12, Thm. 7.44]. The usable rules of (P_4, R_0) are: eq(0, 0) => true eq(0, s(X)) => false eq(s(X), 0) => false eq(s(X), s(Y)) => eq(X, Y) mem(X, nil) => false mem(X, cons(Y, Z)) => ifmem(eq(X, Y), X, Z) ifmem(true, X, Y) => true ifmem(false, X, Y) => mem(X, Y) It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: inter#(app(X, Y), Z) >? inter#(X, Z) inter#(app(X, Y), Z) >? inter#(Y, Z) inter#(X, app(Y, Z)) >? inter#(X, Y) inter#(X, app(Y, Z)) >? inter#(X, Z) inter#(cons(X, Y), Z) >? ifinter#(mem(X, Z), X, Y, Z) inter#(X, cons(Y, Z)) >? ifinter#(mem(Y, X), Y, Z, X) ifinter#(true, X, Y, Z) >? inter#(Y, Z) ifinter#(false, X, Y, Z) >? inter#(Y, Z) eq(0, 0) >= true eq(0, s(X)) >= false eq(s(X), 0) >= false eq(s(X), s(Y)) >= eq(X, Y) mem(X, nil) >= false mem(X, cons(Y, Z)) >= ifmem(eq(X, Y), X, Z) ifmem(true, X, Y) >= true ifmem(false, X, Y) >= mem(X, Y) We orient these requirements with a polynomial interpretation in the natural numbers. We consider usable_rules with respect to the following argument filtering: ifinter#(x_1,x_2,x_3,x_4) = ifinter#(x_2x_3,x_4) This leaves the following ordering requirements: inter#(app(X, Y), Z) >= inter#(X, Z) inter#(app(X, Y), Z) >= inter#(Y, Z) inter#(X, app(Y, Z)) >= inter#(X, Y) inter#(X, app(Y, Z)) >= inter#(X, Z) inter#(cons(X, Y), Z) > ifinter#(mem(X, Z), X, Y, Z) inter#(X, cons(Y, Z)) >= ifinter#(mem(Y, X), Y, Z, X) ifinter#(true, X, Y, Z) >= inter#(Y, Z) ifinter#(false, X, Y, Z) >= inter#(Y, Z) The following interpretation satisfies the requirements: 0 = 3 app = \y0y1.3 + 2y0 + 2y1 cons = \y0y1.3 + 3y1 eq = \y0y1.0 false = 0 ifinter# = \y0y1y2y3.1 + y3 + 3y2 ifmem = \y0y1y2.0 inter# = \y0y1.1 + y1 + 3y0 mem = \y0y1.0 nil = 3 s = \y0.3 true = 0 Using this interpretation, the requirements translate to: [[inter#(app(_x0, _x1), _x2)]] = 10 + x2 + 6x0 + 6x1 > 1 + x2 + 3x0 = [[inter#(_x0, _x2)]] [[inter#(app(_x0, _x1), _x2)]] = 10 + x2 + 6x0 + 6x1 > 1 + x2 + 3x1 = [[inter#(_x1, _x2)]] [[inter#(_x0, app(_x1, _x2))]] = 4 + 2x1 + 2x2 + 3x0 > 1 + x1 + 3x0 = [[inter#(_x0, _x1)]] [[inter#(_x0, app(_x1, _x2))]] = 4 + 2x1 + 2x2 + 3x0 > 1 + x2 + 3x0 = [[inter#(_x0, _x2)]] [[inter#(cons(_x0, _x1), _x2)]] = 10 + x2 + 9x1 > 1 + x2 + 3x1 = [[ifinter#(mem(_x0, _x2), _x0, _x1, _x2)]] [[inter#(_x0, cons(_x1, _x2))]] = 4 + 3x0 + 3x2 > 1 + x0 + 3x2 = [[ifinter#(mem(_x1, _x0), _x1, _x2, _x0)]] [[ifinter#(true, _x0, _x1, _x2)]] = 1 + x2 + 3x1 >= 1 + x2 + 3x1 = [[inter#(_x1, _x2)]] [[ifinter#(false, _x0, _x1, _x2)]] = 1 + x2 + 3x1 >= 1 + x2 + 3x1 = [[inter#(_x1, _x2)]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_4, R_0, minimal, formative) by (P_5, R_0, minimal, formative), where P_5 consists of: ifinter#(true, X, Y, Z) =#> inter#(Y, Z) ifinter#(false, X, Y, Z) =#> inter#(Y, Z) 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_5, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_5, 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 : * 1 : This graph has no strongly connected components. By [Kop12, Thm. 7.31], this implies finiteness of the dependency pair problem. 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(ifmem#) = 3 nu(mem#) = 2 Thus, we can orient the dependency pairs as follows: nu(mem#(X, cons(Y, Z))) = cons(Y, Z) |> Z = nu(ifmem#(eq(X, Y), X, Z)) nu(ifmem#(false, X, Y)) = Y = Y = nu(mem#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_3, R_0, minimal, f) by (P_6, R_0, minimal, f), where P_6 contains: ifmem#(false, X, Y) =#> mem#(X, Y) Thus, the original system is terminating if each of (P_1, R_0, minimal, formative), (P_2, 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 place the elements of P in a dependency graph approximation G (see e.g. [Kop12, Thm. 7.27, 7.29], as follows: * 0 : This graph has no strongly connected components. By [Kop12, Thm. 7.31], this implies finiteness of the dependency pair problem. 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). We apply the subterm criterion with the following projection function: nu(app#) = 1 Thus, we can orient the dependency pairs as follows: nu(app#(cons(X, Y), Z)) = cons(X, Y) |> Y = nu(app#(Y, Z)) nu(app#(app(X, Y), Z)) = app(X, Y) |> X = nu(app#(X, app(Y, Z))) nu(app#(app(X, Y), Z)) = app(X, Y) |> Y = nu(app#(Y, Z)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_2, 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 (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(eq#) = 1 Thus, we can orient the dependency pairs as follows: nu(eq#(s(X), s(Y))) = s(X) |> X = nu(eq#(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 +++ [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.