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: { insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , isort(Cons(x, xs), r) -> isort(xs, insert(x, r)) , isort(Nil(), r) -> Nil() , inssort(xs) -> isort(xs, Nil()) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We add the following dependency tuples: Strict DPs: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r), <^#(S(x), x)) , isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) , isort^#(Nil(), r) -> c_3() , inssort^#(xs) -> c_4(isort^#(xs, Nil())) } Weak DPs: { insert[Ite]^#(True(), x, r) -> c_5() , insert[Ite]^#(False(), x', Cons(x, xs)) -> c_6(insert^#(x', xs)) , <^#(x, 0()) -> c_7() , <^#(S(x), S(y)) -> c_8(<^#(x, y)) , <^#(0(), S(y)) -> c_9() } 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: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r), <^#(S(x), x)) , isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) , isort^#(Nil(), r) -> c_3() , inssort^#(xs) -> c_4(isort^#(xs, Nil())) } Weak DPs: { insert[Ite]^#(True(), x, r) -> c_5() , insert[Ite]^#(False(), x', Cons(x, xs)) -> c_6(insert^#(x', xs)) , <^#(x, 0()) -> c_7() , <^#(S(x), S(y)) -> c_8(<^#(x, y)) , <^#(0(), S(y)) -> c_9() } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() , isort(Cons(x, xs), r) -> isort(xs, insert(x, r)) , isort(Nil(), r) -> Nil() , inssort(xs) -> isort(xs, Nil()) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We estimate the number of application of {3} by applications of Pre({3}) = {2,4}. Here rules are labeled as follows: DPs: { 1: insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r), <^#(S(x), x)) , 2: isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) , 3: isort^#(Nil(), r) -> c_3() , 4: inssort^#(xs) -> c_4(isort^#(xs, Nil())) , 5: insert[Ite]^#(True(), x, r) -> c_5() , 6: insert[Ite]^#(False(), x', Cons(x, xs)) -> c_6(insert^#(x', xs)) , 7: <^#(x, 0()) -> c_7() , 8: <^#(S(x), S(y)) -> c_8(<^#(x, y)) , 9: <^#(0(), S(y)) -> c_9() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r), <^#(S(x), x)) , isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) , inssort^#(xs) -> c_4(isort^#(xs, Nil())) } Weak DPs: { insert[Ite]^#(True(), x, r) -> c_5() , insert[Ite]^#(False(), x', Cons(x, xs)) -> c_6(insert^#(x', xs)) , <^#(x, 0()) -> c_7() , <^#(S(x), S(y)) -> c_8(<^#(x, y)) , <^#(0(), S(y)) -> c_9() , isort^#(Nil(), r) -> c_3() } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() , isort(Cons(x, xs), r) -> isort(xs, insert(x, r)) , isort(Nil(), r) -> Nil() , inssort(xs) -> isort(xs, Nil()) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. { insert[Ite]^#(True(), x, r) -> c_5() , <^#(x, 0()) -> c_7() , <^#(S(x), S(y)) -> c_8(<^#(x, y)) , <^#(0(), S(y)) -> c_9() , isort^#(Nil(), r) -> c_3() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r), <^#(S(x), x)) , isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) , inssort^#(xs) -> c_4(isort^#(xs, Nil())) } Weak DPs: { insert[Ite]^#(False(), x', Cons(x, xs)) -> c_6(insert^#(x', xs)) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() , isort(Cons(x, xs), r) -> isort(xs, insert(x, r)) , isort(Nil(), r) -> Nil() , inssort(xs) -> isort(xs, Nil()) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) Due to missing edges in the dependency-graph, the right-hand sides of following rules could be simplified: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r), <^#(S(x), x)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) , isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) , inssort^#(xs) -> c_3(isort^#(xs, Nil())) } Weak DPs: { insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() , isort(Cons(x, xs), r) -> isort(xs, insert(x, r)) , isort(Nil(), r) -> Nil() , inssort(xs) -> isort(xs, Nil()) } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We replace rewrite rules by usable rules: Weak Usable Rules: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) , isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) , inssort^#(xs) -> c_3(isort^#(xs, Nil())) } Weak DPs: { insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) Consider the dependency graph 1: insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) -->_1 insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) :4 2: isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) -->_1 isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) :2 -->_2 insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) :1 3: inssort^#(xs) -> c_3(isort^#(xs, Nil())) -->_1 isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) :2 4: insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) -->_1 insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) :1 Following roots of the dependency graph are removed, as the considered set of starting terms is closed under reduction with respect to these rules (modulo compound contexts). { inssort^#(xs) -> c_3(isort^#(xs, Nil())) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^2)). Strict DPs: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) , isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) } Weak DPs: { insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^2)) We decompose the input problem according to the dependency graph into the upper component { isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) } and lower component { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) , insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) } Further, following extension rules are added to the lower component. { isort^#(Cons(x, xs), r) -> insert^#(x, r) , isort^#(Cons(x, xs), r) -> isort^#(xs, insert(x, r)) } TcT solves the upper component with certificate YES(O(1),O(n^1)). Sub-proof: ---------- We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } 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: isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) } Trs: { <(x, 0()) -> False() , <(0(), S(y)) -> True() } Sub-proof: ---------- The input was oriented with the instance of 'Small Polynomial Path Order (PS,1-bounded)' as induced by the safe mapping safe(insert[Ite]) = {1}, safe(insert) = {}, safe(True) = {}, safe(S) = {1}, safe(<) = {}, safe(Cons) = {1, 2}, safe(Nil) = {}, safe(0) = {}, safe(isort) = {}, safe(inssort) = {}, safe(False) = {}, safe(insert^#) = {}, safe(c_1) = {}, safe(insert[Ite]^#) = {}, safe(<^#) = {}, safe(isort^#) = {2}, safe(c_2) = {}, safe(c_3) = {}, safe(inssort^#) = {}, safe(c_4) = {}, safe(c_5) = {}, safe(c_6) = {}, safe(c_7) = {}, safe(c_8) = {}, safe(c_9) = {}, safe(c) = {}, safe(c_1) = {}, safe(c_2) = {}, safe(c_3) = {}, safe(c_4) = {} and precedence insert[Ite] > insert, insert[Ite] > <, insert > <, isort^# > insert, isort^# > < . Following symbols are considered recursive: {insert[Ite], isort^#} The recursion depth is 1. Further, following argument filtering is employed: pi(insert[Ite]) = [1], pi(insert) = [1, 2], pi(True) = [], pi(S) = [], pi(<) = [1, 2], pi(Cons) = [1, 2], pi(Nil) = [], pi(0) = [], pi(isort) = [], pi(inssort) = [], pi(False) = [], pi(insert^#) = [1], pi(c_1) = [], pi(insert[Ite]^#) = [], pi(<^#) = [], pi(isort^#) = [1], pi(c_2) = [], pi(c_3) = [], pi(inssort^#) = [], pi(c_4) = [], pi(c_5) = [], pi(c_6) = [], pi(c_7) = [], pi(c_8) = [], pi(c_9) = [], pi(c) = [], pi(c_1) = [], pi(c_2) = [1, 2], pi(c_3) = [], pi(c_4) = [] Usable defined function symbols are a subset of: {insert^#, insert[Ite]^#, <^#, isort^#, inssort^#} For your convenience, here are the satisfied ordering constraints: pi(isort^#(Cons(x, xs), r)) = isort^#(Cons(; x, xs);) > c_2(isort^#(xs;), insert^#(x;);) = pi(c_2(isort^#(xs, insert(x, r)), insert^#(x, r))) 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: { isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } 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. { isort^#(Cons(x, xs), r) -> c_2(isort^#(xs, insert(x, r)), insert^#(x, r)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } 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 We return to the main proof. We are left with following problem, upon which TcT provides the certificate YES(O(1),O(n^1)). Strict DPs: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) } Weak DPs: { insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) , isort^#(Cons(x, xs), r) -> insert^#(x, r) , isort^#(Cons(x, xs), r) -> isort^#(xs, insert(x, r)) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } Obligation: innermost runtime complexity Answer: YES(O(1),O(n^1)) We use the processor 'matrix interpretation of dimension 1' to orient following rules strictly. DPs: { 1: insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) , 2: insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) , 3: isort^#(Cons(x, xs), r) -> insert^#(x, r) } Sub-proof: ---------- The following argument positions are usable: Uargs(c_1) = {1}, Uargs(c_4) = {1} TcT has computed the following constructor-based matrix interpretation satisfying not(EDA). [insert[Ite]](x1, x2, x3) = [1] x3 + [6] [insert](x1, x2) = [1] x2 + [6] [True] = [0] [S](x1) = [0] [<](x1, x2) = [0] [Cons](x1, x2) = [1] x2 + [6] [Nil] = [0] [0] = [0] [isort](x1, x2) = [7] x1 + [7] x2 + [0] [inssort](x1) = [7] x1 + [0] [False] = [0] [insert^#](x1, x2) = [2] x2 + [7] [c_1](x1, x2) = [7] x1 + [7] x2 + [0] [insert[Ite]^#](x1, x2, x3) = [4] x2 + [2] x3 + [0] [<^#](x1, x2) = [7] x1 + [7] x2 + [0] [isort^#](x1, x2) = [2] x1 + [2] x2 + [0] [c_2](x1, x2) = [7] x1 + [7] x2 + [0] [c_3] = [0] [inssort^#](x1) = [7] x1 + [0] [c_4](x1) = [7] x1 + [0] [c_5] = [0] [c_6](x1) = [7] x1 + [0] [c_7] = [0] [c_8](x1) = [7] x1 + [0] [c_9] = [0] [c] = [0] [c_1](x1) = [1] x1 + [3] [c_2](x1, x2) = [7] x1 + [7] x2 + [0] [c_3](x1) = [7] x1 + [0] [c_4](x1) = [1] x1 + [3] The following symbols are considered usable {insert[Ite], insert, <, insert^#, insert[Ite]^#, isort^#} The order satisfies the following ordering constraints: [insert[Ite](True(), x, r)] = [1] r + [6] >= [1] r + [6] = [Cons(x, r)] [insert[Ite](False(), x', Cons(x, xs))] = [1] xs + [12] >= [1] xs + [12] = [Cons(x, insert(x', xs))] [insert(S(x), r)] = [1] r + [6] >= [1] r + [6] = [insert[Ite](<(S(x), x), S(x), r)] [<(x, 0())] = [0] >= [0] = [False()] [<(S(x), S(y))] = [0] >= [0] = [<(x, y)] [<(0(), S(y))] = [0] >= [0] = [True()] [insert^#(S(x), r)] = [2] r + [7] > [2] r + [3] = [c_1(insert[Ite]^#(<(S(x), x), S(x), r))] [insert[Ite]^#(False(), x', Cons(x, xs))] = [2] xs + [4] x' + [12] > [2] xs + [10] = [c_4(insert^#(x', xs))] [isort^#(Cons(x, xs), r)] = [2] xs + [2] r + [12] > [2] r + [7] = [insert^#(x, r)] [isort^#(Cons(x, xs), r)] = [2] xs + [2] r + [12] >= [2] xs + [2] r + [12] = [isort^#(xs, insert(x, r))] 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: { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) , insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) , isort^#(Cons(x, xs), r) -> insert^#(x, r) , isort^#(Cons(x, xs), r) -> isort^#(xs, insert(x, r)) } Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } 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. { insert^#(S(x), r) -> c_1(insert[Ite]^#(<(S(x), x), S(x), r)) , insert[Ite]^#(False(), x', Cons(x, xs)) -> c_4(insert^#(x', xs)) , isort^#(Cons(x, xs), r) -> insert^#(x, r) , isort^#(Cons(x, xs), r) -> isort^#(xs, insert(x, r)) } We are left with following problem, upon which TcT provides the certificate YES(O(1),O(1)). Weak Trs: { insert[Ite](True(), x, r) -> Cons(x, r) , insert[Ite](False(), x', Cons(x, xs)) -> Cons(x, insert(x', xs)) , insert(S(x), r) -> insert[Ite](<(S(x), x), S(x), r) , <(x, 0()) -> False() , <(S(x), S(y)) -> <(x, y) , <(0(), S(y)) -> True() } 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))