YES(O(1),O(n^2)) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict Trs: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) , sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) , sel(0(), cons(X, Z)) -> X } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We add the following innermost weak dependency pairs: Strict DPs: { from^#(X) -> c_1() , from^#(X) -> c_2() , first^#(X1, X2) -> c_3() , first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , first^#(0(), Z) -> c_5() , activate^#(X) -> c_6() , activate^#(n__from(X)) -> c_7(from^#(X)) , activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) , sel^#(0(), cons(X, Z)) -> c_10() } and mark the set of starting terms. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { from^#(X) -> c_1() , from^#(X) -> c_2() , first^#(X1, X2) -> c_3() , first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , first^#(0(), Z) -> c_5() , activate^#(X) -> c_6() , activate^#(n__from(X)) -> c_7(from^#(X)) , activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) , sel^#(0(), cons(X, Z)) -> c_10() } Strict Trs: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) , sel(s(X), cons(Y, Z)) -> sel(X, activate(Z)) , sel(0(), cons(X, Z)) -> X } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We replace rewrite rules by usable rules: Strict Usable Rules: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { from^#(X) -> c_1() , from^#(X) -> c_2() , first^#(X1, X2) -> c_3() , first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , first^#(0(), Z) -> c_5() , activate^#(X) -> c_6() , activate^#(n__from(X)) -> c_7(from^#(X)) , activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) , sel^#(0(), cons(X, Z)) -> c_10() } Strict Trs: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) The weightgap principle applies (using the following constant growth matrix-interpretation) The following argument positions are usable: Uargs(cons) = {2}, Uargs(n__first) = {2}, Uargs(c_4) = {1}, Uargs(c_7) = {1}, Uargs(c_8) = {1}, Uargs(sel^#) = {2}, Uargs(c_9) = {1} TcT has computed the following constructor-restricted matrix interpretation. [from](x1) = [1] [2] [cons](x1, x2) = [1 0] x2 + [0] [0 0] [2] [n__from](x1) = [0] [0] [s](x1) = [1 2] x1 + [0] [0 1] [2] [first](x1, x2) = [1 2] x1 + [1 0] x2 + [1] [0 0] [0 2] [0] [0] = [0] [0] [nil] = [0] [0] [n__first](x1, x2) = [1 2] x1 + [1 0] x2 + [0] [0 0] [0 1] [0] [activate](x1) = [1 0] x1 + [2] [0 2] [2] [from^#](x1) = [0 0] x1 + [1] [1 1] [1] [c_1] = [0] [1] [c_2] = [0] [1] [first^#](x1, x2) = [0 0] x1 + [0 0] x2 + [2] [1 1] [2 1] [2] [c_3] = [1] [1] [c_4](x1) = [1 0] x1 + [1] [0 1] [1] [activate^#](x1) = [0 0] x1 + [2] [2 1] [2] [c_5] = [1] [1] [c_6] = [2] [1] [c_7](x1) = [1 0] x1 + [2] [0 1] [2] [c_8](x1) = [1 0] x1 + [1] [0 1] [1] [sel^#](x1, x2) = [2 0] x2 + [0] [0 0] [0] [c_9](x1) = [1 0] x1 + [2] [0 1] [2] [c_10] = [2] [0] The following symbols are considered usable {from, first, activate, from^#, first^#, activate^#, sel^#} The order satisfies the following ordering constraints: [from(X)] = [1] [2] > [0] [2] = [cons(X, n__from(s(X)))] [from(X)] = [1] [2] > [0] [0] = [n__from(X)] [first(X1, X2)] = [1 2] X1 + [1 0] X2 + [1] [0 0] [0 2] [0] > [1 2] X1 + [1 0] X2 + [0] [0 0] [0 1] [0] = [n__first(X1, X2)] [first(s(X), cons(Y, Z))] = [1 4] X + [1 0] Z + [5] [0 0] [0 0] [4] > [1 2] X + [1 0] Z + [2] [0 0] [0 0] [2] = [cons(Y, n__first(X, activate(Z)))] [first(0(), Z)] = [1 0] Z + [1] [0 2] [0] > [0] [0] = [nil()] [activate(X)] = [1 0] X + [2] [0 2] [2] > [1 0] X + [0] [0 1] [0] = [X] [activate(n__from(X))] = [2] [2] > [1] [2] = [from(X)] [activate(n__first(X1, X2))] = [1 2] X1 + [1 0] X2 + [2] [0 0] [0 2] [2] > [1 2] X1 + [1 0] X2 + [1] [0 0] [0 2] [0] = [first(X1, X2)] [from^#(X)] = [0 0] X + [1] [1 1] [1] > [0] [1] = [c_1()] [from^#(X)] = [0 0] X + [1] [1 1] [1] > [0] [1] = [c_2()] [first^#(X1, X2)] = [0 0] X1 + [0 0] X2 + [2] [1 1] [2 1] [2] > [1] [1] = [c_3()] [first^#(s(X), cons(Y, Z))] = [0 0] X + [0 0] Z + [2] [1 3] [2 0] [6] ? [0 0] Z + [3] [2 1] [3] = [c_4(activate^#(Z))] [first^#(0(), Z)] = [0 0] Z + [2] [2 1] [2] > [1] [1] = [c_5()] [activate^#(X)] = [0 0] X + [2] [2 1] [2] >= [2] [1] = [c_6()] [activate^#(n__from(X))] = [2] [2] ? [0 0] X + [3] [1 1] [3] = [c_7(from^#(X))] [activate^#(n__first(X1, X2))] = [0 0] X1 + [0 0] X2 + [2] [2 4] [2 1] [2] ? [0 0] X1 + [0 0] X2 + [3] [1 1] [2 1] [3] = [c_8(first^#(X1, X2))] [sel^#(s(X), cons(Y, Z))] = [2 0] Z + [0] [0 0] [0] ? [2 0] Z + [6] [0 0] [2] = [c_9(sel^#(X, activate(Z)))] [sel^#(0(), cons(X, Z))] = [2 0] Z + [0] [0 0] [0] ? [2] [0] = [c_10()] Further, it can be verified that all rules not oriented are covered by the weightgap condition. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , activate^#(X) -> c_6() , activate^#(n__from(X)) -> c_7(from^#(X)) , activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) , sel^#(0(), cons(X, Z)) -> c_10() } Weak DPs: { from^#(X) -> c_1() , from^#(X) -> c_2() , first^#(X1, X2) -> c_3() , first^#(0(), Z) -> c_5() } Weak Trs: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We estimate the number of application of {2,3,6} by applications of Pre({2,3,6}) = {1,5}. Here rules are labeled as follows: DPs: { 1: first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , 2: activate^#(X) -> c_6() , 3: activate^#(n__from(X)) -> c_7(from^#(X)) , 4: activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , 5: sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) , 6: sel^#(0(), cons(X, Z)) -> c_10() , 7: from^#(X) -> c_1() , 8: from^#(X) -> c_2() , 9: first^#(X1, X2) -> c_3() , 10: first^#(0(), Z) -> c_5() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) } Weak DPs: { from^#(X) -> c_1() , from^#(X) -> c_2() , first^#(X1, X2) -> c_3() , first^#(0(), Z) -> c_5() , activate^#(X) -> c_6() , activate^#(n__from(X)) -> c_7(from^#(X)) , sel^#(0(), cons(X, Z)) -> c_10() } Weak Trs: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { from^#(X) -> c_1() , from^#(X) -> c_2() , first^#(X1, X2) -> c_3() , first^#(0(), Z) -> c_5() , activate^#(X) -> c_6() , activate^#(n__from(X)) -> c_7(from^#(X)) , sel^#(0(), cons(X, Z)) -> c_10() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) } Weak Trs: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We use the processor 'Small Polynomial Path Order (PS,1-bounded)' to orient following rules strictly. DPs: { 1: first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , 2: activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , 3: sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) } Trs: { from(X) -> n__from(X) , first(0(), Z) -> nil() } Sub-proof: ---------- The input was oriented with the instance of 'Small Polynomial Path Order (PS,1-bounded)' as induced by the safe mapping safe(from) = {1}, safe(cons) = {1, 2}, safe(n__from) = {1}, safe(s) = {1}, safe(first) = {}, safe(0) = {}, safe(nil) = {}, safe(n__first) = {1, 2}, safe(activate) = {}, safe(sel) = {}, safe(from^#) = {}, safe(c_1) = {}, safe(c_2) = {}, safe(first^#) = {1}, safe(c_3) = {}, safe(c_4) = {}, safe(activate^#) = {}, safe(c_5) = {}, safe(c_6) = {}, safe(c_7) = {}, safe(c_8) = {}, safe(sel^#) = {2}, safe(c_9) = {}, safe(c_10) = {} and precedence from ~ first, from ~ activate, from ~ sel^#, first ~ activate, first ~ sel^#, activate ~ sel^#, first^# ~ activate^# . Following symbols are considered recursive: {from, first, activate, first^#, activate^#, sel^#} The recursion depth is 1. Further, following argument filtering is employed: pi(from) = [], pi(cons) = [2], pi(n__from) = [], pi(s) = [1], pi(first) = [], pi(0) = [], pi(nil) = [], pi(n__first) = [2], pi(activate) = [], pi(sel) = [], pi(from^#) = [], pi(c_1) = [], pi(c_2) = [], pi(first^#) = [2], pi(c_3) = [], pi(c_4) = [1], pi(activate^#) = [1], pi(c_5) = [], pi(c_6) = [], pi(c_7) = [], pi(c_8) = [1], pi(sel^#) = [1], pi(c_9) = [1], pi(c_10) = [] Usable defined function symbols are a subset of: {from^#, first^#, activate^#, sel^#} For your convenience, here are the satisfied ordering constraints: pi(first^#(s(X), cons(Y, Z))) = first^#(cons(; Z);) > c_4(activate^#(Z;);) = pi(c_4(activate^#(Z))) pi(activate^#(n__first(X1, X2))) = activate^#(n__first(; X2);) > c_8(first^#(X2;);) = pi(c_8(first^#(X1, X2))) pi(sel^#(s(X), cons(Y, Z))) = sel^#(s(; X);) > c_9(sel^#(X;);) = pi(c_9(sel^#(X, activate(Z)))) The strictly oriented rules are moved into the weak component. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Weak DPs: { first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) } Weak Trs: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) } Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { first^#(s(X), cons(Y, Z)) -> c_4(activate^#(Z)) , activate^#(n__first(X1, X2)) -> c_8(first^#(X1, X2)) , sel^#(s(X), cons(Y, Z)) -> c_9(sel^#(X, activate(Z))) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Weak Trs: { from(X) -> cons(X, n__from(s(X))) , from(X) -> n__from(X) , first(X1, X2) -> n__first(X1, X2) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , first(0(), Z) -> nil() , activate(X) -> X , activate(n__from(X)) -> from(X) , activate(n__first(X1, X2)) -> first(X1, X2) } Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) No rule is usable, rules are removed from the input problem. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Rules: Empty Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) Empty rules are trivially bounded Hurray, we answered YES(O(1),O(n^2))