YES(O(1),O(n^1)) We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict Trs: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , sqr(s(X)) -> s(add(sqr(X), dbl(X))) , s(X) -> n__s(X) , add(0(), X) -> X , add(s(X), Y) -> s(add(X, Y)) , dbl(0()) -> 0() , dbl(s(X)) -> s(s(dbl(X))) , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(X2)) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) Arguments of following rules are not normal-forms: { sqr(s(X)) -> s(add(sqr(X), dbl(X))) , add(s(X), Y) -> s(add(X, Y)) , dbl(s(X)) -> s(s(dbl(X))) , first(s(X), cons(Y, Z)) -> cons(Y, n__first(X, activate(Z))) } All above mentioned rules can be savely removed. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict Trs: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , s(X) -> n__s(X) , add(0(), X) -> X , dbl(0()) -> 0() , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(X2)) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We add the following innermost weak dependency pairs: Strict DPs: { terms^#(N) -> c_1(sqr^#(N)) , terms^#(X) -> c_2() , sqr^#(0()) -> c_3() , s^#(X) -> c_4() , add^#(0(), X) -> c_5() , dbl^#(0()) -> c_6() , first^#(X1, X2) -> c_7() , first^#(0(), X) -> c_8() , activate^#(X) -> c_9() , activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) , activate^#(n__s(X)) -> c_11(s^#(activate(X))) , activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) } and mark the set of starting terms. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { terms^#(N) -> c_1(sqr^#(N)) , terms^#(X) -> c_2() , sqr^#(0()) -> c_3() , s^#(X) -> c_4() , add^#(0(), X) -> c_5() , dbl^#(0()) -> c_6() , first^#(X1, X2) -> c_7() , first^#(0(), X) -> c_8() , activate^#(X) -> c_9() , activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) , activate^#(n__s(X)) -> c_11(s^#(activate(X))) , activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) } Strict Trs: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , s(X) -> n__s(X) , add(0(), X) -> X , dbl(0()) -> 0() , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(X2)) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We replace rewrite rules by usable rules: Strict Usable Rules: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , s(X) -> n__s(X) , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(X2)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { terms^#(N) -> c_1(sqr^#(N)) , terms^#(X) -> c_2() , sqr^#(0()) -> c_3() , s^#(X) -> c_4() , add^#(0(), X) -> c_5() , dbl^#(0()) -> c_6() , first^#(X1, X2) -> c_7() , first^#(0(), X) -> c_8() , activate^#(X) -> c_9() , activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) , activate^#(n__s(X)) -> c_11(s^#(activate(X))) , activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) } Strict Trs: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , s(X) -> n__s(X) , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(X2)) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) The weightgap principle applies (using the following constant growth matrix-interpretation) The following argument positions are usable: Uargs(terms) = {1}, Uargs(cons) = {1}, Uargs(recip) = {1}, Uargs(s) = {1}, Uargs(first) = {1, 2}, Uargs(terms^#) = {1}, Uargs(c_1) = {1}, Uargs(s^#) = {1}, Uargs(first^#) = {1, 2}, Uargs(c_10) = {1}, Uargs(c_11) = {1}, Uargs(c_12) = {1} TcT has computed the following constructor-restricted matrix interpretation. [terms](x1) = [1 0] x1 + [2] [0 1] [2] [cons](x1, x2) = [1 0] x1 + [0] [0 0] [1] [recip](x1) = [1 0] x1 + [0] [0 0] [2] [sqr](x1) = [1] [0] [n__terms](x1) = [1 0] x1 + [0] [0 1] [2] [n__s](x1) = [1 0] x1 + [0] [0 1] [2] [0] = [0] [0] [s](x1) = [1 0] x1 + [1] [0 1] [2] [first](x1, x2) = [1 0] x1 + [1 0] x2 + [2] [0 1] [0 1] [2] [nil] = [1] [1] [n__first](x1, x2) = [1 0] x1 + [1 0] x2 + [0] [0 1] [0 1] [2] [activate](x1) = [1 2] x1 + [1] [0 2] [0] [terms^#](x1) = [1 0] x1 + [1] [0 0] [2] [c_1](x1) = [1 0] x1 + [1] [0 1] [1] [sqr^#](x1) = [1 0] x1 + [2] [1 1] [2] [c_2] = [0] [1] [c_3] = [1] [1] [s^#](x1) = [1 0] x1 + [1] [0 0] [2] [c_4] = [0] [1] [add^#](x1, x2) = [2 2] x1 + [2] [1 2] [2] [c_5] = [1] [1] [dbl^#](x1) = [1 2] x1 + [2] [2 2] [2] [c_6] = [1] [1] [first^#](x1, x2) = [1 0] x1 + [1 0] x2 + [2] [0 0] [0 0] [2] [c_7] = [1] [1] [c_8] = [1] [1] [activate^#](x1) = [1 2] x1 + [1] [0 0] [0] [c_9] = [0] [1] [c_10](x1) = [1 0] x1 + [2] [0 1] [2] [c_11](x1) = [1 0] x1 + [2] [0 1] [2] [c_12](x1) = [1 0] x1 + [2] [0 1] [2] The following symbols are considered usable {terms, sqr, s, first, activate, terms^#, sqr^#, s^#, add^#, dbl^#, first^#, activate^#} The order satisfies the following ordering constraints: [terms(N)] = [1 0] N + [2] [0 1] [2] > [1] [1] = [cons(recip(sqr(N)), n__terms(n__s(N)))] [terms(X)] = [1 0] X + [2] [0 1] [2] > [1 0] X + [0] [0 1] [2] = [n__terms(X)] [sqr(0())] = [1] [0] > [0] [0] = [0()] [s(X)] = [1 0] X + [1] [0 1] [2] > [1 0] X + [0] [0 1] [2] = [n__s(X)] [first(X1, X2)] = [1 0] X1 + [1 0] X2 + [2] [0 1] [0 1] [2] > [1 0] X1 + [1 0] X2 + [0] [0 1] [0 1] [2] = [n__first(X1, X2)] [first(0(), X)] = [1 0] X + [2] [0 1] [2] > [1] [1] = [nil()] [activate(X)] = [1 2] X + [1] [0 2] [0] > [1 0] X + [0] [0 1] [0] = [X] [activate(n__terms(X))] = [1 2] X + [5] [0 2] [4] > [1 2] X + [3] [0 2] [2] = [terms(activate(X))] [activate(n__s(X))] = [1 2] X + [5] [0 2] [4] > [1 2] X + [2] [0 2] [2] = [s(activate(X))] [activate(n__first(X1, X2))] = [1 2] X1 + [1 2] X2 + [5] [0 2] [0 2] [4] > [1 2] X1 + [1 2] X2 + [4] [0 2] [0 2] [2] = [first(activate(X1), activate(X2))] [terms^#(N)] = [1 0] N + [1] [0 0] [2] ? [1 0] N + [3] [1 1] [3] = [c_1(sqr^#(N))] [terms^#(X)] = [1 0] X + [1] [0 0] [2] > [0] [1] = [c_2()] [sqr^#(0())] = [2] [2] > [1] [1] = [c_3()] [s^#(X)] = [1 0] X + [1] [0 0] [2] > [0] [1] = [c_4()] [add^#(0(), X)] = [2] [2] > [1] [1] = [c_5()] [dbl^#(0())] = [2] [2] > [1] [1] = [c_6()] [first^#(X1, X2)] = [1 0] X1 + [1 0] X2 + [2] [0 0] [0 0] [2] > [1] [1] = [c_7()] [first^#(0(), X)] = [1 0] X + [2] [0 0] [2] > [1] [1] = [c_8()] [activate^#(X)] = [1 2] X + [1] [0 0] [0] ? [0] [1] = [c_9()] [activate^#(n__terms(X))] = [1 2] X + [5] [0 0] [0] ? [1 2] X + [4] [0 0] [4] = [c_10(terms^#(activate(X)))] [activate^#(n__s(X))] = [1 2] X + [5] [0 0] [0] ? [1 2] X + [4] [0 0] [4] = [c_11(s^#(activate(X)))] [activate^#(n__first(X1, X2))] = [1 2] X1 + [1 2] X2 + [5] [0 0] [0 0] [0] ? [1 2] X1 + [1 2] X2 + [6] [0 0] [0 0] [4] = [c_12(first^#(activate(X1), activate(X2)))] 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(1)). Strict DPs: { terms^#(N) -> c_1(sqr^#(N)) , activate^#(X) -> c_9() , activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) , activate^#(n__s(X)) -> c_11(s^#(activate(X))) , activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) } Weak DPs: { terms^#(X) -> c_2() , sqr^#(0()) -> c_3() , s^#(X) -> c_4() , add^#(0(), X) -> c_5() , dbl^#(0()) -> c_6() , first^#(X1, X2) -> c_7() , first^#(0(), X) -> c_8() } Weak Trs: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , s(X) -> n__s(X) , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(X2)) } Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) We estimate the number of application of {1,2,4,5} by applications of Pre({1,2,4,5}) = {3}. Here rules are labeled as follows: DPs: { 1: terms^#(N) -> c_1(sqr^#(N)) , 2: activate^#(X) -> c_9() , 3: activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) , 4: activate^#(n__s(X)) -> c_11(s^#(activate(X))) , 5: activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) , 6: terms^#(X) -> c_2() , 7: sqr^#(0()) -> c_3() , 8: s^#(X) -> c_4() , 9: add^#(0(), X) -> c_5() , 10: dbl^#(0()) -> c_6() , 11: first^#(X1, X2) -> c_7() , 12: first^#(0(), X) -> c_8() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Strict DPs: { activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) } Weak DPs: { terms^#(N) -> c_1(sqr^#(N)) , terms^#(X) -> c_2() , sqr^#(0()) -> c_3() , s^#(X) -> c_4() , add^#(0(), X) -> c_5() , dbl^#(0()) -> c_6() , first^#(X1, X2) -> c_7() , first^#(0(), X) -> c_8() , activate^#(X) -> c_9() , activate^#(n__s(X)) -> c_11(s^#(activate(X))) , activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) } Weak Trs: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , s(X) -> n__s(X) , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(X2)) } Obligation: innermost runtime complexity Answer: YES(O(1),O(1)) We estimate the number of application of {1} by applications of Pre({1}) = {}. Here rules are labeled as follows: DPs: { 1: activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) , 2: terms^#(N) -> c_1(sqr^#(N)) , 3: terms^#(X) -> c_2() , 4: sqr^#(0()) -> c_3() , 5: s^#(X) -> c_4() , 6: add^#(0(), X) -> c_5() , 7: dbl^#(0()) -> c_6() , 8: first^#(X1, X2) -> c_7() , 9: first^#(0(), X) -> c_8() , 10: activate^#(X) -> c_9() , 11: activate^#(n__s(X)) -> c_11(s^#(activate(X))) , 12: activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Weak DPs: { terms^#(N) -> c_1(sqr^#(N)) , terms^#(X) -> c_2() , sqr^#(0()) -> c_3() , s^#(X) -> c_4() , add^#(0(), X) -> c_5() , dbl^#(0()) -> c_6() , first^#(X1, X2) -> c_7() , first^#(0(), X) -> c_8() , activate^#(X) -> c_9() , activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) , activate^#(n__s(X)) -> c_11(s^#(activate(X))) , activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) } Weak Trs: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , s(X) -> n__s(X) , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(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. { terms^#(N) -> c_1(sqr^#(N)) , terms^#(X) -> c_2() , sqr^#(0()) -> c_3() , s^#(X) -> c_4() , add^#(0(), X) -> c_5() , dbl^#(0()) -> c_6() , first^#(X1, X2) -> c_7() , first^#(0(), X) -> c_8() , activate^#(X) -> c_9() , activate^#(n__terms(X)) -> c_10(terms^#(activate(X))) , activate^#(n__s(X)) -> c_11(s^#(activate(X))) , activate^#(n__first(X1, X2)) -> c_12(first^#(activate(X1), activate(X2))) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Weak Trs: { terms(N) -> cons(recip(sqr(N)), n__terms(n__s(N))) , terms(X) -> n__terms(X) , sqr(0()) -> 0() , s(X) -> n__s(X) , first(X1, X2) -> n__first(X1, X2) , first(0(), X) -> nil() , activate(X) -> X , activate(n__terms(X)) -> terms(activate(X)) , activate(n__s(X)) -> s(activate(X)) , activate(n__first(X1, X2)) -> first(activate(X1), activate(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^1))