/export/starexec/sandbox2/solver/bin/starexec_run_FirstOrder /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- YES We consider the system theBenchmark. We are asked to determine termination of the following first-order TRS. 0 : [] --> o active : [o] --> o add : [o * o] --> o and : [o * o] --> o cons : [o * o] --> o false : [] --> o first : [o * o] --> o from : [o] --> o if : [o * o * o] --> o mark : [o] --> o nil : [] --> o ok : [o] --> o proper : [o] --> o s : [o] --> o top : [o] --> o true : [] --> o active(and(true, X)) => mark(X) active(and(false, X)) => mark(false) active(if(true, X, Y)) => mark(X) active(if(false, X, Y)) => mark(Y) active(add(0, X)) => mark(X) active(add(s(X), Y)) => mark(s(add(X, Y))) active(first(0, X)) => mark(nil) active(first(s(X), cons(Y, Z))) => mark(cons(Y, first(X, Z))) active(from(X)) => mark(cons(X, from(s(X)))) active(and(X, Y)) => and(active(X), Y) active(if(X, Y, Z)) => if(active(X), Y, Z) active(add(X, Y)) => add(active(X), Y) active(first(X, Y)) => first(active(X), Y) active(first(X, Y)) => first(X, active(Y)) and(mark(X), Y) => mark(and(X, Y)) if(mark(X), Y, Z) => mark(if(X, Y, Z)) add(mark(X), Y) => mark(add(X, Y)) first(mark(X), Y) => mark(first(X, Y)) first(X, mark(Y)) => mark(first(X, Y)) proper(and(X, Y)) => and(proper(X), proper(Y)) proper(true) => ok(true) proper(false) => ok(false) proper(if(X, Y, Z)) => if(proper(X), proper(Y), proper(Z)) proper(add(X, Y)) => add(proper(X), proper(Y)) proper(0) => ok(0) proper(s(X)) => s(proper(X)) proper(first(X, Y)) => first(proper(X), proper(Y)) proper(nil) => ok(nil) proper(cons(X, Y)) => cons(proper(X), proper(Y)) proper(from(X)) => from(proper(X)) and(ok(X), ok(Y)) => ok(and(X, Y)) if(ok(X), ok(Y), ok(Z)) => ok(if(X, Y, Z)) add(ok(X), ok(Y)) => ok(add(X, Y)) s(ok(X)) => ok(s(X)) first(ok(X), ok(Y)) => ok(first(X, Y)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) from(ok(X)) => ok(from(X)) top(mark(X)) => top(proper(X)) top(ok(X)) => top(active(X)) 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] active#(add(s(X), Y)) =#> s#(add(X, Y)) 1] active#(add(s(X), Y)) =#> add#(X, Y) 2] active#(first(s(X), cons(Y, Z))) =#> cons#(Y, first(X, Z)) 3] active#(first(s(X), cons(Y, Z))) =#> first#(X, Z) 4] active#(from(X)) =#> cons#(X, from(s(X))) 5] active#(from(X)) =#> from#(s(X)) 6] active#(from(X)) =#> s#(X) 7] active#(and(X, Y)) =#> and#(active(X), Y) 8] active#(and(X, Y)) =#> active#(X) 9] active#(if(X, Y, Z)) =#> if#(active(X), Y, Z) 10] active#(if(X, Y, Z)) =#> active#(X) 11] active#(add(X, Y)) =#> add#(active(X), Y) 12] active#(add(X, Y)) =#> active#(X) 13] active#(first(X, Y)) =#> first#(active(X), Y) 14] active#(first(X, Y)) =#> active#(X) 15] active#(first(X, Y)) =#> first#(X, active(Y)) 16] active#(first(X, Y)) =#> active#(Y) 17] and#(mark(X), Y) =#> and#(X, Y) 18] if#(mark(X), Y, Z) =#> if#(X, Y, Z) 19] add#(mark(X), Y) =#> add#(X, Y) 20] first#(mark(X), Y) =#> first#(X, Y) 21] first#(X, mark(Y)) =#> first#(X, Y) 22] proper#(and(X, Y)) =#> and#(proper(X), proper(Y)) 23] proper#(and(X, Y)) =#> proper#(X) 24] proper#(and(X, Y)) =#> proper#(Y) 25] proper#(if(X, Y, Z)) =#> if#(proper(X), proper(Y), proper(Z)) 26] proper#(if(X, Y, Z)) =#> proper#(X) 27] proper#(if(X, Y, Z)) =#> proper#(Y) 28] proper#(if(X, Y, Z)) =#> proper#(Z) 29] proper#(add(X, Y)) =#> add#(proper(X), proper(Y)) 30] proper#(add(X, Y)) =#> proper#(X) 31] proper#(add(X, Y)) =#> proper#(Y) 32] proper#(s(X)) =#> s#(proper(X)) 33] proper#(s(X)) =#> proper#(X) 34] proper#(first(X, Y)) =#> first#(proper(X), proper(Y)) 35] proper#(first(X, Y)) =#> proper#(X) 36] proper#(first(X, Y)) =#> proper#(Y) 37] proper#(cons(X, Y)) =#> cons#(proper(X), proper(Y)) 38] proper#(cons(X, Y)) =#> proper#(X) 39] proper#(cons(X, Y)) =#> proper#(Y) 40] proper#(from(X)) =#> from#(proper(X)) 41] proper#(from(X)) =#> proper#(X) 42] and#(ok(X), ok(Y)) =#> and#(X, Y) 43] if#(ok(X), ok(Y), ok(Z)) =#> if#(X, Y, Z) 44] add#(ok(X), ok(Y)) =#> add#(X, Y) 45] s#(ok(X)) =#> s#(X) 46] first#(ok(X), ok(Y)) =#> first#(X, Y) 47] cons#(ok(X), ok(Y)) =#> cons#(X, Y) 48] from#(ok(X)) =#> from#(X) 49] top#(mark(X)) =#> top#(proper(X)) 50] top#(mark(X)) =#> proper#(X) 51] top#(ok(X)) =#> top#(active(X)) 52] top#(ok(X)) =#> active#(X) Rules R_0: active(and(true, X)) => mark(X) active(and(false, X)) => mark(false) active(if(true, X, Y)) => mark(X) active(if(false, X, Y)) => mark(Y) active(add(0, X)) => mark(X) active(add(s(X), Y)) => mark(s(add(X, Y))) active(first(0, X)) => mark(nil) active(first(s(X), cons(Y, Z))) => mark(cons(Y, first(X, Z))) active(from(X)) => mark(cons(X, from(s(X)))) active(and(X, Y)) => and(active(X), Y) active(if(X, Y, Z)) => if(active(X), Y, Z) active(add(X, Y)) => add(active(X), Y) active(first(X, Y)) => first(active(X), Y) active(first(X, Y)) => first(X, active(Y)) and(mark(X), Y) => mark(and(X, Y)) if(mark(X), Y, Z) => mark(if(X, Y, Z)) add(mark(X), Y) => mark(add(X, Y)) first(mark(X), Y) => mark(first(X, Y)) first(X, mark(Y)) => mark(first(X, Y)) proper(and(X, Y)) => and(proper(X), proper(Y)) proper(true) => ok(true) proper(false) => ok(false) proper(if(X, Y, Z)) => if(proper(X), proper(Y), proper(Z)) proper(add(X, Y)) => add(proper(X), proper(Y)) proper(0) => ok(0) proper(s(X)) => s(proper(X)) proper(first(X, Y)) => first(proper(X), proper(Y)) proper(nil) => ok(nil) proper(cons(X, Y)) => cons(proper(X), proper(Y)) proper(from(X)) => from(proper(X)) and(ok(X), ok(Y)) => ok(and(X, Y)) if(ok(X), ok(Y), ok(Z)) => ok(if(X, Y, Z)) add(ok(X), ok(Y)) => ok(add(X, Y)) s(ok(X)) => ok(s(X)) first(ok(X), ok(Y)) => ok(first(X, Y)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) from(ok(X)) => ok(from(X)) top(mark(X)) => top(proper(X)) top(ok(X)) => top(active(X)) 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 : 45 * 1 : 19, 44 * 2 : 47 * 3 : 20, 21, 46 * 4 : 47 * 5 : 48 * 6 : 45 * 7 : 17, 42 * 8 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 9 : 18, 43 * 10 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 11 : 19, 44 * 12 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 13 : 20, 21, 46 * 14 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 15 : 20, 21, 46 * 16 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 * 17 : 17, 42 * 18 : 18, 43 * 19 : 19, 44 * 20 : 20, 21, 46 * 21 : 20, 21, 46 * 22 : 17, 42 * 23 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 24 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 25 : 18, 43 * 26 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 27 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 28 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 29 : 19, 44 * 30 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 31 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 32 : 45 * 33 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 34 : 20, 21, 46 * 35 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 36 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 37 : 47 * 38 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 39 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 40 : 48 * 41 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 42 : 17, 42 * 43 : 18, 43 * 44 : 19, 44 * 45 : 45 * 46 : 20, 21, 46 * 47 : 47 * 48 : 48 * 49 : 49, 50, 51, 52 * 50 : 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41 * 51 : 49, 50, 51, 52 * 52 : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 This graph has the following strongly connected components: P_1: active#(and(X, Y)) =#> active#(X) active#(if(X, Y, Z)) =#> active#(X) active#(add(X, Y)) =#> active#(X) active#(first(X, Y)) =#> active#(X) active#(first(X, Y)) =#> active#(Y) P_2: and#(mark(X), Y) =#> and#(X, Y) and#(ok(X), ok(Y)) =#> and#(X, Y) P_3: if#(mark(X), Y, Z) =#> if#(X, Y, Z) if#(ok(X), ok(Y), ok(Z)) =#> if#(X, Y, Z) P_4: add#(mark(X), Y) =#> add#(X, Y) add#(ok(X), ok(Y)) =#> add#(X, Y) P_5: first#(mark(X), Y) =#> first#(X, Y) first#(X, mark(Y)) =#> first#(X, Y) first#(ok(X), ok(Y)) =#> first#(X, Y) P_6: proper#(and(X, Y)) =#> proper#(X) proper#(and(X, Y)) =#> proper#(Y) proper#(if(X, Y, Z)) =#> proper#(X) proper#(if(X, Y, Z)) =#> proper#(Y) proper#(if(X, Y, Z)) =#> proper#(Z) proper#(add(X, Y)) =#> proper#(X) proper#(add(X, Y)) =#> proper#(Y) proper#(s(X)) =#> proper#(X) proper#(first(X, Y)) =#> proper#(X) proper#(first(X, Y)) =#> proper#(Y) proper#(cons(X, Y)) =#> proper#(X) proper#(cons(X, Y)) =#> proper#(Y) proper#(from(X)) =#> proper#(X) P_7: s#(ok(X)) =#> s#(X) P_8: cons#(ok(X), ok(Y)) =#> cons#(X, Y) P_9: from#(ok(X)) =#> from#(X) P_10: top#(mark(X)) =#> top#(proper(X)) top#(ok(X)) =#> top#(active(X)) 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), (P_7, R_0, m, f), (P_8, R_0, m, f), (P_9, R_0, m, f) and (P_10, 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), (P_7, R_0, minimal, formative), (P_8, R_0, minimal, formative), (P_9, R_0, minimal, formative) and (P_10, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_10, R_0, minimal, formative). The formative rules of (P_10, R_0) are R_1 ::= active(and(true, X)) => mark(X) active(and(false, X)) => mark(false) active(if(true, X, Y)) => mark(X) active(if(false, X, Y)) => mark(Y) active(add(0, X)) => mark(X) active(add(s(X), Y)) => mark(s(add(X, Y))) active(first(0, X)) => mark(nil) active(first(s(X), cons(Y, Z))) => mark(cons(Y, first(X, Z))) active(from(X)) => mark(cons(X, from(s(X)))) active(and(X, Y)) => and(active(X), Y) active(if(X, Y, Z)) => if(active(X), Y, Z) active(add(X, Y)) => add(active(X), Y) active(first(X, Y)) => first(active(X), Y) active(first(X, Y)) => first(X, active(Y)) and(mark(X), Y) => mark(and(X, Y)) if(mark(X), Y, Z) => mark(if(X, Y, Z)) add(mark(X), Y) => mark(add(X, Y)) first(mark(X), Y) => mark(first(X, Y)) first(X, mark(Y)) => mark(first(X, Y)) proper(and(X, Y)) => and(proper(X), proper(Y)) proper(true) => ok(true) proper(false) => ok(false) proper(if(X, Y, Z)) => if(proper(X), proper(Y), proper(Z)) proper(add(X, Y)) => add(proper(X), proper(Y)) proper(0) => ok(0) proper(s(X)) => s(proper(X)) proper(first(X, Y)) => first(proper(X), proper(Y)) proper(nil) => ok(nil) proper(cons(X, Y)) => cons(proper(X), proper(Y)) proper(from(X)) => from(proper(X)) and(ok(X), ok(Y)) => ok(and(X, Y)) if(ok(X), ok(Y), ok(Z)) => ok(if(X, Y, Z)) add(ok(X), ok(Y)) => ok(add(X, Y)) s(ok(X)) => ok(s(X)) first(ok(X), ok(Y)) => ok(first(X, Y)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) from(ok(X)) => ok(from(X)) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_10, R_0, minimal, formative) by (P_10, 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), (P_7, R_0, minimal, formative), (P_8, R_0, minimal, formative), (P_9, R_0, minimal, formative) and (P_10, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_10, R_1, minimal, formative). We will use the reduction pair processor [Kop12, Thm. 7.16]. It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: top#(mark(X)) >? top#(proper(X)) top#(ok(X)) >? top#(active(X)) active(and(true, X)) >= mark(X) active(and(false, X)) >= mark(false) active(if(true, X, Y)) >= mark(X) active(if(false, X, Y)) >= mark(Y) active(add(0, X)) >= mark(X) active(add(s(X), Y)) >= mark(s(add(X, Y))) active(first(0, X)) >= mark(nil) active(first(s(X), cons(Y, Z))) >= mark(cons(Y, first(X, Z))) active(from(X)) >= mark(cons(X, from(s(X)))) active(and(X, Y)) >= and(active(X), Y) active(if(X, Y, Z)) >= if(active(X), Y, Z) active(add(X, Y)) >= add(active(X), Y) active(first(X, Y)) >= first(active(X), Y) active(first(X, Y)) >= first(X, active(Y)) and(mark(X), Y) >= mark(and(X, Y)) if(mark(X), Y, Z) >= mark(if(X, Y, Z)) add(mark(X), Y) >= mark(add(X, Y)) first(mark(X), Y) >= mark(first(X, Y)) first(X, mark(Y)) >= mark(first(X, Y)) proper(and(X, Y)) >= and(proper(X), proper(Y)) proper(true) >= ok(true) proper(false) >= ok(false) proper(if(X, Y, Z)) >= if(proper(X), proper(Y), proper(Z)) proper(add(X, Y)) >= add(proper(X), proper(Y)) proper(0) >= ok(0) proper(s(X)) >= s(proper(X)) proper(first(X, Y)) >= first(proper(X), proper(Y)) proper(nil) >= ok(nil) proper(cons(X, Y)) >= cons(proper(X), proper(Y)) proper(from(X)) >= from(proper(X)) and(ok(X), ok(Y)) >= ok(and(X, Y)) if(ok(X), ok(Y), ok(Z)) >= ok(if(X, Y, Z)) add(ok(X), ok(Y)) >= ok(add(X, Y)) s(ok(X)) >= ok(s(X)) first(ok(X), ok(Y)) >= ok(first(X, Y)) cons(ok(X), ok(Y)) >= ok(cons(X, Y)) from(ok(X)) >= ok(from(X)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 1 active = \y0.y0 add = \y0y1.y1 + 2y0 and = \y0y1.1 + 2y0 + 2y1 cons = \y0y1.0 false = 0 first = \y0y1.y1 + 2y0 from = \y0.1 if = \y0y1y2.1 + y1 + 2y0 + 2y2 mark = \y0.1 + y0 nil = 0 ok = \y0.y0 proper = \y0.y0 s = \y0.1 top# = \y0.2y0 true = 0 Using this interpretation, the requirements translate to: [[top#(mark(_x0))]] = 2 + 2x0 > 2x0 = [[top#(proper(_x0))]] [[top#(ok(_x0))]] = 2x0 >= 2x0 = [[top#(active(_x0))]] [[active(and(true, _x0))]] = 1 + 2x0 >= 1 + x0 = [[mark(_x0)]] [[active(and(false, _x0))]] = 1 + 2x0 >= 1 = [[mark(false)]] [[active(if(true, _x0, _x1))]] = 1 + x0 + 2x1 >= 1 + x0 = [[mark(_x0)]] [[active(if(false, _x0, _x1))]] = 1 + x0 + 2x1 >= 1 + x1 = [[mark(_x1)]] [[active(add(0, _x0))]] = 2 + x0 >= 1 + x0 = [[mark(_x0)]] [[active(add(s(_x0), _x1))]] = 2 + x1 >= 2 = [[mark(s(add(_x0, _x1)))]] [[active(first(0, _x0))]] = 2 + x0 >= 1 = [[mark(nil)]] [[active(first(s(_x0), cons(_x1, _x2)))]] = 2 >= 1 = [[mark(cons(_x1, first(_x0, _x2)))]] [[active(from(_x0))]] = 1 >= 1 = [[mark(cons(_x0, from(s(_x0))))]] [[active(and(_x0, _x1))]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[and(active(_x0), _x1)]] [[active(if(_x0, _x1, _x2))]] = 1 + x1 + 2x0 + 2x2 >= 1 + x1 + 2x0 + 2x2 = [[if(active(_x0), _x1, _x2)]] [[active(add(_x0, _x1))]] = x1 + 2x0 >= x1 + 2x0 = [[add(active(_x0), _x1)]] [[active(first(_x0, _x1))]] = x1 + 2x0 >= x1 + 2x0 = [[first(active(_x0), _x1)]] [[active(first(_x0, _x1))]] = x1 + 2x0 >= x1 + 2x0 = [[first(_x0, active(_x1))]] [[and(mark(_x0), _x1)]] = 3 + 2x0 + 2x1 >= 2 + 2x0 + 2x1 = [[mark(and(_x0, _x1))]] [[if(mark(_x0), _x1, _x2)]] = 3 + x1 + 2x0 + 2x2 >= 2 + x1 + 2x0 + 2x2 = [[mark(if(_x0, _x1, _x2))]] [[add(mark(_x0), _x1)]] = 2 + x1 + 2x0 >= 1 + x1 + 2x0 = [[mark(add(_x0, _x1))]] [[first(mark(_x0), _x1)]] = 2 + x1 + 2x0 >= 1 + x1 + 2x0 = [[mark(first(_x0, _x1))]] [[first(_x0, mark(_x1))]] = 1 + x1 + 2x0 >= 1 + x1 + 2x0 = [[mark(first(_x0, _x1))]] [[proper(and(_x0, _x1))]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[and(proper(_x0), proper(_x1))]] [[proper(true)]] = 0 >= 0 = [[ok(true)]] [[proper(false)]] = 0 >= 0 = [[ok(false)]] [[proper(if(_x0, _x1, _x2))]] = 1 + x1 + 2x0 + 2x2 >= 1 + x1 + 2x0 + 2x2 = [[if(proper(_x0), proper(_x1), proper(_x2))]] [[proper(add(_x0, _x1))]] = x1 + 2x0 >= x1 + 2x0 = [[add(proper(_x0), proper(_x1))]] [[proper(0)]] = 1 >= 1 = [[ok(0)]] [[proper(s(_x0))]] = 1 >= 1 = [[s(proper(_x0))]] [[proper(first(_x0, _x1))]] = x1 + 2x0 >= x1 + 2x0 = [[first(proper(_x0), proper(_x1))]] [[proper(nil)]] = 0 >= 0 = [[ok(nil)]] [[proper(cons(_x0, _x1))]] = 0 >= 0 = [[cons(proper(_x0), proper(_x1))]] [[proper(from(_x0))]] = 1 >= 1 = [[from(proper(_x0))]] [[and(ok(_x0), ok(_x1))]] = 1 + 2x0 + 2x1 >= 1 + 2x0 + 2x1 = [[ok(and(_x0, _x1))]] [[if(ok(_x0), ok(_x1), ok(_x2))]] = 1 + x1 + 2x0 + 2x2 >= 1 + x1 + 2x0 + 2x2 = [[ok(if(_x0, _x1, _x2))]] [[add(ok(_x0), ok(_x1))]] = x1 + 2x0 >= x1 + 2x0 = [[ok(add(_x0, _x1))]] [[s(ok(_x0))]] = 1 >= 1 = [[ok(s(_x0))]] [[first(ok(_x0), ok(_x1))]] = x1 + 2x0 >= x1 + 2x0 = [[ok(first(_x0, _x1))]] [[cons(ok(_x0), ok(_x1))]] = 0 >= 0 = [[ok(cons(_x0, _x1))]] [[from(ok(_x0))]] = 1 >= 1 = [[ok(from(_x0))]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace the dependency pair problem (P_10, R_1, minimal, formative) by (P_11, R_1, minimal, formative), where P_11 consists of: top#(ok(X)) =#> top#(active(X)) 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), (P_7, R_0, minimal, formative), (P_8, R_0, minimal, formative), (P_9, R_0, minimal, formative) and (P_11, R_1, minimal, formative) is finite. We consider the dependency pair problem (P_11, R_1, minimal, formative). The formative rules of (P_11, R_1) are R_2 ::= active(and(X, Y)) => and(active(X), Y) active(if(X, Y, Z)) => if(active(X), Y, Z) active(add(X, Y)) => add(active(X), Y) active(first(X, Y)) => first(active(X), Y) active(first(X, Y)) => first(X, active(Y)) proper(and(X, Y)) => and(proper(X), proper(Y)) proper(true) => ok(true) proper(false) => ok(false) proper(if(X, Y, Z)) => if(proper(X), proper(Y), proper(Z)) proper(add(X, Y)) => add(proper(X), proper(Y)) proper(0) => ok(0) proper(s(X)) => s(proper(X)) proper(first(X, Y)) => first(proper(X), proper(Y)) proper(nil) => ok(nil) proper(cons(X, Y)) => cons(proper(X), proper(Y)) proper(from(X)) => from(proper(X)) and(ok(X), ok(Y)) => ok(and(X, Y)) if(ok(X), ok(Y), ok(Z)) => ok(if(X, Y, Z)) add(ok(X), ok(Y)) => ok(add(X, Y)) s(ok(X)) => ok(s(X)) first(ok(X), ok(Y)) => ok(first(X, Y)) cons(ok(X), ok(Y)) => ok(cons(X, Y)) from(ok(X)) => ok(from(X)) By [Kop12, Thm. 7.17], we may replace the dependency pair problem (P_11, R_1, minimal, formative) by (P_11, 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), (P_5, R_0, minimal, formative), (P_6, R_0, minimal, formative), (P_7, R_0, minimal, formative), (P_8, R_0, minimal, formative), (P_9, R_0, minimal, formative) and (P_11, R_2, minimal, formative) is finite. We consider the dependency pair problem (P_11, R_2, minimal, formative). We will use the reduction pair processor with usable rules [Kop12, Thm. 7.44]. The usable rules of (P_11, R_2) are: active(and(X, Y)) => and(active(X), Y) active(if(X, Y, Z)) => if(active(X), Y, Z) active(add(X, Y)) => add(active(X), Y) active(first(X, Y)) => first(active(X), Y) active(first(X, Y)) => first(X, active(Y)) and(ok(X), ok(Y)) => ok(and(X, Y)) if(ok(X), ok(Y), ok(Z)) => ok(if(X, Y, Z)) add(ok(X), ok(Y)) => ok(add(X, Y)) first(ok(X), ok(Y)) => ok(first(X, Y)) It suffices to find a standard reduction pair [Kop12, Def. 6.69]. Thus, we must orient: top#(ok(X)) >? top#(active(X)) active(and(X, Y)) >= and(active(X), Y) active(if(X, Y, Z)) >= if(active(X), Y, Z) active(add(X, Y)) >= add(active(X), Y) active(first(X, Y)) >= first(active(X), Y) active(first(X, Y)) >= first(X, active(Y)) and(ok(X), ok(Y)) >= ok(and(X, Y)) if(ok(X), ok(Y), ok(Z)) >= ok(if(X, Y, Z)) add(ok(X), ok(Y)) >= ok(add(X, Y)) first(ok(X), ok(Y)) >= ok(first(X, Y)) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: active = \y0.2 + 2y0 add = \y0y1.3 + 2y0 + 2y1 and = \y0y1.3 + 3y1 first = \y0y1.1 + y0 + y1 if = \y0y1y2.3 + y1 + 2y0 + 2y2 ok = \y0.3 + 3y0 top# = \y0.3y0 Using this interpretation, the requirements translate to: [[top#(ok(_x0))]] = 9 + 9x0 > 6 + 6x0 = [[top#(active(_x0))]] [[active(and(_x0, _x1))]] = 8 + 6x1 >= 3 + 3x1 = [[and(active(_x0), _x1)]] [[active(if(_x0, _x1, _x2))]] = 8 + 2x1 + 4x0 + 4x2 >= 7 + x1 + 2x2 + 4x0 = [[if(active(_x0), _x1, _x2)]] [[active(add(_x0, _x1))]] = 8 + 4x0 + 4x1 >= 7 + 2x1 + 4x0 = [[add(active(_x0), _x1)]] [[active(first(_x0, _x1))]] = 4 + 2x0 + 2x1 >= 3 + x1 + 2x0 = [[first(active(_x0), _x1)]] [[active(first(_x0, _x1))]] = 4 + 2x0 + 2x1 >= 3 + x0 + 2x1 = [[first(_x0, active(_x1))]] [[and(ok(_x0), ok(_x1))]] = 12 + 9x1 >= 12 + 9x1 = [[ok(and(_x0, _x1))]] [[if(ok(_x0), ok(_x1), ok(_x2))]] = 18 + 3x1 + 6x0 + 6x2 >= 12 + 3x1 + 6x0 + 6x2 = [[ok(if(_x0, _x1, _x2))]] [[add(ok(_x0), ok(_x1))]] = 15 + 6x0 + 6x1 >= 12 + 6x0 + 6x1 = [[ok(add(_x0, _x1))]] [[first(ok(_x0), ok(_x1))]] = 7 + 3x0 + 3x1 >= 6 + 3x0 + 3x1 = [[ok(first(_x0, _x1))]] By the observations in [Kop12, Sec. 6.6], this reduction pair suffices; we may thus replace a dependency pair problem (P_11, 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), (P_4, R_0, minimal, formative), (P_5, R_0, minimal, formative), (P_6, R_0, minimal, formative), (P_7, R_0, minimal, formative), (P_8, R_0, minimal, formative) and (P_9, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_9, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(from#) = 1 Thus, we can orient the dependency pairs as follows: nu(from#(ok(X))) = ok(X) |> X = nu(from#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_9, 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), (P_5, R_0, minimal, formative), (P_6, R_0, minimal, formative), (P_7, R_0, minimal, formative) and (P_8, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_8, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(cons#) = 1 Thus, we can orient the dependency pairs as follows: nu(cons#(ok(X), ok(Y))) = ok(X) |> X = nu(cons#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_8, 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), (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). We apply the subterm criterion with the following projection function: nu(s#) = 1 Thus, we can orient the dependency pairs as follows: nu(s#(ok(X))) = ok(X) |> X = nu(s#(X)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_7, 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), (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(proper#) = 1 Thus, we can orient the dependency pairs as follows: nu(proper#(and(X, Y))) = and(X, Y) |> X = nu(proper#(X)) nu(proper#(and(X, Y))) = and(X, Y) |> Y = nu(proper#(Y)) nu(proper#(if(X, Y, Z))) = if(X, Y, Z) |> X = nu(proper#(X)) nu(proper#(if(X, Y, Z))) = if(X, Y, Z) |> Y = nu(proper#(Y)) nu(proper#(if(X, Y, Z))) = if(X, Y, Z) |> Z = nu(proper#(Z)) nu(proper#(add(X, Y))) = add(X, Y) |> X = nu(proper#(X)) nu(proper#(add(X, Y))) = add(X, Y) |> Y = nu(proper#(Y)) nu(proper#(s(X))) = s(X) |> X = nu(proper#(X)) nu(proper#(first(X, Y))) = first(X, Y) |> X = nu(proper#(X)) nu(proper#(first(X, Y))) = first(X, Y) |> Y = nu(proper#(Y)) nu(proper#(cons(X, Y))) = cons(X, Y) |> X = nu(proper#(X)) nu(proper#(cons(X, Y))) = cons(X, Y) |> Y = nu(proper#(Y)) nu(proper#(from(X))) = from(X) |> X = nu(proper#(X)) 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). We apply the subterm criterion with the following projection function: nu(first#) = 1 Thus, we can orient the dependency pairs as follows: nu(first#(mark(X), Y)) = mark(X) |> X = nu(first#(X, Y)) nu(first#(X, mark(Y))) = X = X = nu(first#(X, Y)) nu(first#(ok(X), ok(Y))) = ok(X) |> X = nu(first#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_5, R_0, minimal, f) by (P_12, R_0, minimal, f), where P_12 contains: first#(X, mark(Y)) =#> first#(X, Y) 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_12, R_0, minimal, formative) is finite. We consider the dependency pair problem (P_12, R_0, minimal, formative). We apply the subterm criterion with the following projection function: nu(first#) = 2 Thus, we can orient the dependency pairs as follows: nu(first#(X, mark(Y))) = mark(Y) |> Y = nu(first#(X, Y)) By [Kop12, Thm. 7.35], we may replace a dependency pair problem (P_12, 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) 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(add#) = 1 Thus, we can orient the dependency pairs as follows: nu(add#(mark(X), Y)) = mark(X) |> X = nu(add#(X, Y)) nu(add#(ok(X), ok(Y))) = ok(X) |> X = nu(add#(X, 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(if#) = 1 Thus, we can orient the dependency pairs as follows: nu(if#(mark(X), Y, Z)) = mark(X) |> X = nu(if#(X, Y, Z)) nu(if#(ok(X), ok(Y), ok(Z))) = ok(X) |> X = nu(if#(X, 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). We apply the subterm criterion with the following projection function: nu(and#) = 1 Thus, we can orient the dependency pairs as follows: nu(and#(mark(X), Y)) = mark(X) |> X = nu(and#(X, Y)) nu(and#(ok(X), ok(Y))) = ok(X) |> X = nu(and#(X, Y)) 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(active#) = 1 Thus, we can orient the dependency pairs as follows: nu(active#(and(X, Y))) = and(X, Y) |> X = nu(active#(X)) nu(active#(if(X, Y, Z))) = if(X, Y, Z) |> X = nu(active#(X)) nu(active#(add(X, Y))) = add(X, Y) |> X = nu(active#(X)) nu(active#(first(X, Y))) = first(X, Y) |> X = nu(active#(X)) nu(active#(first(X, Y))) = first(X, Y) |> Y = nu(active#(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.