WORST_CASE(?,O(n^3)) * Step 1: DependencyPairs WORST_CASE(?,O(n^3)) + Considered Problem: - Strict TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) main(x1) -> sort#2(x1) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1,insert#3,leq#2,main ,sort#2} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: DependencyPairs {dpKind_ = DT} + Details: We add the following dependency tuples: Strict DPs cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) cond_insert_ord_x_ys_1#(True(),x3,x2,x1) -> c_2() insert#3#(x2,Nil()) -> c_3() insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(0(),x8) -> c_5() leq#2#(S(x12),0()) -> c_6() leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) main#(x1) -> c_8(sort#2#(x1)) sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) sort#2#(Nil()) -> c_10() Weak DPs and mark the set of starting terms. * Step 2: PredecessorEstimation WORST_CASE(?,O(n^3)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) cond_insert_ord_x_ys_1#(True(),x3,x2,x1) -> c_2() insert#3#(x2,Nil()) -> c_3() insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(0(),x8) -> c_5() leq#2#(S(x12),0()) -> c_6() leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) main#(x1) -> c_8(sort#2#(x1)) sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) sort#2#(Nil()) -> c_10() - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) main(x1) -> sort#2(x1) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: PredecessorEstimation {onSelection = all simple predecessor estimation selector} + Details: We estimate the number of application of {2,3,5,6,10} by application of Pre({2,3,5,6,10}) = {1,4,7,8,9}. Here rules are labelled as follows: 1: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) 2: cond_insert_ord_x_ys_1#(True(),x3,x2,x1) -> c_2() 3: insert#3#(x2,Nil()) -> c_3() 4: insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) 5: leq#2#(0(),x8) -> c_5() 6: leq#2#(S(x12),0()) -> c_6() 7: leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) 8: main#(x1) -> c_8(sort#2#(x1)) 9: sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) 10: sort#2#(Nil()) -> c_10() * Step 3: RemoveWeakSuffixes WORST_CASE(?,O(n^3)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) main#(x1) -> c_8(sort#2#(x1)) sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) - Weak DPs: cond_insert_ord_x_ys_1#(True(),x3,x2,x1) -> c_2() insert#3#(x2,Nil()) -> c_3() leq#2#(0(),x8) -> c_5() leq#2#(S(x12),0()) -> c_6() sort#2#(Nil()) -> c_10() - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) main(x1) -> sort#2(x1) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: RemoveWeakSuffixes + Details: Consider the dependency graph 1:S:cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) -->_1 insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)):2 -->_1 insert#3#(x2,Nil()) -> c_3():7 2:S:insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) -->_2 leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)):3 -->_2 leq#2#(S(x12),0()) -> c_6():9 -->_2 leq#2#(0(),x8) -> c_5():8 -->_1 cond_insert_ord_x_ys_1#(True(),x3,x2,x1) -> c_2():6 -->_1 cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)):1 3:S:leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) -->_1 leq#2#(S(x12),0()) -> c_6():9 -->_1 leq#2#(0(),x8) -> c_5():8 -->_1 leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)):3 4:S:main#(x1) -> c_8(sort#2#(x1)) -->_1 sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)):5 -->_1 sort#2#(Nil()) -> c_10():10 5:S:sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) -->_2 sort#2#(Nil()) -> c_10():10 -->_1 insert#3#(x2,Nil()) -> c_3():7 -->_2 sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)):5 -->_1 insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)):2 6:W:cond_insert_ord_x_ys_1#(True(),x3,x2,x1) -> c_2() 7:W:insert#3#(x2,Nil()) -> c_3() 8:W:leq#2#(0(),x8) -> c_5() 9:W:leq#2#(S(x12),0()) -> c_6() 10:W:sort#2#(Nil()) -> c_10() The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. 10: sort#2#(Nil()) -> c_10() 7: insert#3#(x2,Nil()) -> c_3() 6: cond_insert_ord_x_ys_1#(True(),x3,x2,x1) -> c_2() 8: leq#2#(0(),x8) -> c_5() 9: leq#2#(S(x12),0()) -> c_6() * Step 4: RemoveHeads WORST_CASE(?,O(n^3)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) main#(x1) -> c_8(sort#2#(x1)) sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) main(x1) -> sort#2(x1) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: RemoveHeads + Details: Consider the dependency graph 1:S:cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) -->_1 insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)):2 2:S:insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) -->_2 leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)):3 -->_1 cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)):1 3:S:leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) -->_1 leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)):3 4:S:main#(x1) -> c_8(sort#2#(x1)) -->_1 sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)):5 5:S:sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) -->_2 sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)):5 -->_1 insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)):2 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). [(4,main#(x1) -> c_8(sort#2#(x1)))] * Step 5: UsableRules WORST_CASE(?,O(n^3)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) main(x1) -> sort#2(x1) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: UsableRules + Details: We replace rewrite rules by usable rules: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) * Step 6: DecomposeDG WORST_CASE(?,O(n^3)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: DecomposeDG {onSelection = all below first cut in WDG, onUpper = Nothing, onLower = Nothing} + Details: We decompose the input problem according to the dependency graph into the upper component sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) and a lower component cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) Further, following extension rules are added to the lower component. sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) ** Step 6.a:1: SimplifyRHS WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: SimplifyRHS + Details: Consider the dependency graph 1:S:sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) -->_2 sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)):1 Due to missing edges in the depndency graph, the right-hand sides of following rules could be simplified: sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) ** Step 6.a:2: UsableRules WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/1,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: UsableRules + Details: We replace rewrite rules by usable rules: sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) ** Step 6.a:3: WeightGap WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/1,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnAny} + Details: The weightgap principle applies using the following constant growth matrix-interpretation: We apply a matrix interpretation of kind constructor based matrix interpretation: The following argument positions are considered usable: uargs(c_9) = {1} Following symbols are considered usable: all TcT has computed the following interpretation: p(0) = [0] p(Cons) = [1] x1 + [1] x2 + [5] p(False) = [0] p(Nil) = [0] p(S) = [1] x1 + [0] p(True) = [0] p(cond_insert_ord_x_ys_1) = [0] p(insert#3) = [0] p(leq#2) = [0] p(main) = [0] p(sort#2) = [0] p(cond_insert_ord_x_ys_1#) = [0] p(insert#3#) = [0] p(leq#2#) = [0] p(main#) = [0] p(sort#2#) = [5] x1 + [0] p(c_1) = [0] p(c_2) = [0] p(c_3) = [0] p(c_4) = [0] p(c_5) = [0] p(c_6) = [0] p(c_7) = [0] p(c_8) = [0] p(c_9) = [1] x1 + [0] p(c_10) = [0] Following rules are strictly oriented: sort#2#(Cons(x4,x2)) = [5] x2 + [5] x4 + [25] > [5] x2 + [0] = c_9(sort#2#(x2)) Following rules are (at-least) weakly oriented: Further, it can be verified that all rules not oriented are covered by the weightgap condition. ** Step 6.a:4: EmptyProcessor WORST_CASE(?,O(1)) + Considered Problem: - Weak DPs: sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/1,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: EmptyProcessor + Details: The problem is already closed. The intended complexity is O(1). ** Step 6.b:1: DecomposeDG WORST_CASE(?,O(n^2)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) - Weak DPs: sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: DecomposeDG {onSelection = all below first cut in WDG, onUpper = Nothing, onLower = Nothing} + Details: We decompose the input problem according to the dependency graph into the upper component cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) and a lower component leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) Further, following extension rules are added to the lower component. cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> insert#3#(x3,x1) insert#3#(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2) insert#3#(x6,Cons(x4,x2)) -> leq#2#(x6,x4) sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) *** Step 6.b:1.a:1: SimplifyRHS WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) - Weak DPs: sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: SimplifyRHS + Details: Consider the dependency graph 1:S:cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) -->_1 insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)):2 2:S:insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)) -->_1 cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)):1 3:W:sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) -->_1 insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2),leq#2#(x6,x4)):2 4:W:sort#2#(Cons(x4,x2)) -> sort#2#(x2) -->_1 sort#2#(Cons(x4,x2)) -> sort#2#(x2):4 -->_1 sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)):3 Due to missing edges in the depndency graph, the right-hand sides of following rules could be simplified: insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2)) *** Step 6.b:1.a:2: WeightGap WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2)) - Weak DPs: sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/1,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnAny} + Details: The weightgap principle applies using the following constant growth matrix-interpretation: We apply a matrix interpretation of kind constructor based matrix interpretation: The following argument positions are considered usable: uargs(Cons) = {2}, uargs(cond_insert_ord_x_ys_1) = {1}, uargs(insert#3) = {2}, uargs(cond_insert_ord_x_ys_1#) = {1}, uargs(insert#3#) = {2}, uargs(c_1) = {1}, uargs(c_4) = {1} Following symbols are considered usable: all TcT has computed the following interpretation: p(0) = [0] p(Cons) = [1] x2 + [4] p(False) = [6] p(Nil) = [0] p(S) = [0] p(True) = [6] p(cond_insert_ord_x_ys_1) = [1] x1 + [1] x4 + [4] p(insert#3) = [1] x2 + [6] p(leq#2) = [6] p(main) = [0] p(sort#2) = [2] x1 + [5] p(cond_insert_ord_x_ys_1#) = [1] x1 + [1] x4 + [7] p(insert#3#) = [1] x2 + [0] p(leq#2#) = [0] p(main#) = [0] p(sort#2#) = [3] x1 + [0] p(c_1) = [1] x1 + [0] p(c_2) = [0] p(c_3) = [1] p(c_4) = [1] x1 + [0] p(c_5) = [0] p(c_6) = [0] p(c_7) = [0] p(c_8) = [0] p(c_9) = [0] p(c_10) = [0] Following rules are strictly oriented: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) = [1] x1 + [13] > [1] x1 + [0] = c_1(insert#3#(x3,x1)) Following rules are (at-least) weakly oriented: insert#3#(x6,Cons(x4,x2)) = [1] x2 + [4] >= [1] x2 + [13] = c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2)) sort#2#(Cons(x4,x2)) = [3] x2 + [12] >= [2] x2 + [5] = insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) = [3] x2 + [12] >= [3] x2 + [0] = sort#2#(x2) cond_insert_ord_x_ys_1(False(),x3,x2,x1) = [1] x1 + [10] >= [1] x1 + [10] = Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) = [1] x1 + [10] >= [1] x1 + [8] = Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) = [6] >= [4] = Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) = [1] x2 + [10] >= [1] x2 + [10] = cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) = [6] >= [6] = True() leq#2(S(x12),0()) = [6] >= [6] = False() leq#2(S(x4),S(x2)) = [6] >= [6] = leq#2(x4,x2) sort#2(Cons(x4,x2)) = [2] x2 + [13] >= [2] x2 + [11] = insert#3(x4,sort#2(x2)) sort#2(Nil()) = [5] >= [0] = Nil() Further, it can be verified that all rules not oriented are covered by the weightgap condition. *** Step 6.b:1.a:3: WeightGap WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2)) - Weak DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/1,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnAny} + Details: The weightgap principle applies using the following constant growth matrix-interpretation: We apply a matrix interpretation of kind constructor based matrix interpretation: The following argument positions are considered usable: uargs(Cons) = {2}, uargs(cond_insert_ord_x_ys_1) = {1}, uargs(insert#3) = {2}, uargs(cond_insert_ord_x_ys_1#) = {1}, uargs(insert#3#) = {2}, uargs(c_1) = {1}, uargs(c_4) = {1} Following symbols are considered usable: all TcT has computed the following interpretation: p(0) = [1] p(Cons) = [1] x2 + [4] p(False) = [7] p(Nil) = [1] p(S) = [0] p(True) = [6] p(cond_insert_ord_x_ys_1) = [1] x1 + [1] x4 + [3] p(insert#3) = [1] x2 + [6] p(leq#2) = [7] p(main) = [1] x1 + [0] p(sort#2) = [2] x1 + [2] p(cond_insert_ord_x_ys_1#) = [1] x1 + [1] x4 + [2] p(insert#3#) = [1] x2 + [7] p(leq#2#) = [0] p(main#) = [2] x1 + [0] p(sort#2#) = [2] x1 + [1] p(c_1) = [1] x1 + [0] p(c_2) = [1] p(c_3) = [0] p(c_4) = [1] x1 + [1] p(c_5) = [0] p(c_6) = [2] p(c_7) = [0] p(c_8) = [2] p(c_9) = [1] x2 + [0] p(c_10) = [1] Following rules are strictly oriented: insert#3#(x6,Cons(x4,x2)) = [1] x2 + [11] > [1] x2 + [10] = c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2)) Following rules are (at-least) weakly oriented: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) = [1] x1 + [9] >= [1] x1 + [7] = c_1(insert#3#(x3,x1)) sort#2#(Cons(x4,x2)) = [2] x2 + [9] >= [2] x2 + [9] = insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) = [2] x2 + [9] >= [2] x2 + [1] = sort#2#(x2) cond_insert_ord_x_ys_1(False(),x3,x2,x1) = [1] x1 + [10] >= [1] x1 + [10] = Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) = [1] x1 + [9] >= [1] x1 + [8] = Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) = [7] >= [5] = Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) = [1] x2 + [10] >= [1] x2 + [10] = cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) = [7] >= [6] = True() leq#2(S(x12),0()) = [7] >= [7] = False() leq#2(S(x4),S(x2)) = [7] >= [7] = leq#2(x4,x2) sort#2(Cons(x4,x2)) = [2] x2 + [10] >= [2] x2 + [8] = insert#3(x4,sort#2(x2)) sort#2(Nil()) = [4] >= [1] = Nil() Further, it can be verified that all rules not oriented are covered by the weightgap condition. *** Step 6.b:1.a:4: EmptyProcessor WORST_CASE(?,O(1)) + Considered Problem: - Weak DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) insert#3#(x6,Cons(x4,x2)) -> c_4(cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2)) sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/1,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: EmptyProcessor + Details: The problem is already closed. The intended complexity is O(1). *** Step 6.b:1.b:1: WeightGap WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) - Weak DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> insert#3#(x3,x1) insert#3#(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2) insert#3#(x6,Cons(x4,x2)) -> leq#2#(x6,x4) sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnAny} + Details: The weightgap principle applies using the following constant growth matrix-interpretation: We apply a matrix interpretation of kind constructor based matrix interpretation: The following argument positions are considered usable: uargs(Cons) = {2}, uargs(cond_insert_ord_x_ys_1) = {1}, uargs(insert#3) = {2}, uargs(cond_insert_ord_x_ys_1#) = {1}, uargs(insert#3#) = {2}, uargs(c_7) = {1} Following symbols are considered usable: all TcT has computed the following interpretation: p(0) = [0] p(Cons) = [1] x1 + [1] x2 + [0] p(False) = [0] p(Nil) = [0] p(S) = [1] x1 + [1] p(True) = [0] p(cond_insert_ord_x_ys_1) = [1] x1 + [3] x2 + [1] x3 + [1] x4 + [0] p(insert#3) = [3] x1 + [1] x2 + [0] p(leq#2) = [0] p(main) = [0] p(sort#2) = [3] x1 + [0] p(cond_insert_ord_x_ys_1#) = [1] x1 + [4] x2 + [1] x4 + [0] p(insert#3#) = [4] x1 + [1] x2 + [0] p(leq#2#) = [2] x1 + [0] p(main#) = [0] p(sort#2#) = [5] x1 + [0] p(c_1) = [0] p(c_2) = [0] p(c_3) = [0] p(c_4) = [0] p(c_5) = [0] p(c_6) = [0] p(c_7) = [1] x1 + [0] p(c_8) = [0] p(c_9) = [0] p(c_10) = [0] Following rules are strictly oriented: leq#2#(S(x4),S(x2)) = [2] x4 + [2] > [2] x4 + [0] = c_7(leq#2#(x4,x2)) Following rules are (at-least) weakly oriented: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) = [1] x1 + [4] x3 + [0] >= [1] x1 + [4] x3 + [0] = insert#3#(x3,x1) insert#3#(x6,Cons(x4,x2)) = [1] x2 + [1] x4 + [4] x6 + [0] >= [1] x2 + [4] x6 + [0] = cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2) insert#3#(x6,Cons(x4,x2)) = [1] x2 + [1] x4 + [4] x6 + [0] >= [2] x6 + [0] = leq#2#(x6,x4) sort#2#(Cons(x4,x2)) = [5] x2 + [5] x4 + [0] >= [3] x2 + [4] x4 + [0] = insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) = [5] x2 + [5] x4 + [0] >= [5] x2 + [0] = sort#2#(x2) cond_insert_ord_x_ys_1(False(),x3,x2,x1) = [1] x1 + [1] x2 + [3] x3 + [0] >= [1] x1 + [1] x2 + [3] x3 + [0] = Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) = [1] x1 + [1] x2 + [3] x3 + [0] >= [1] x1 + [1] x2 + [1] x3 + [0] = Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) = [3] x2 + [0] >= [1] x2 + [0] = Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) = [1] x2 + [1] x4 + [3] x6 + [0] >= [1] x2 + [1] x4 + [3] x6 + [0] = cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) = [0] >= [0] = True() leq#2(S(x12),0()) = [0] >= [0] = False() leq#2(S(x4),S(x2)) = [0] >= [0] = leq#2(x4,x2) sort#2(Cons(x4,x2)) = [3] x2 + [3] x4 + [0] >= [3] x2 + [3] x4 + [0] = insert#3(x4,sort#2(x2)) sort#2(Nil()) = [0] >= [0] = Nil() Further, it can be verified that all rules not oriented are covered by the weightgap condition. *** Step 6.b:1.b:2: EmptyProcessor WORST_CASE(?,O(1)) + Considered Problem: - Weak DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> insert#3#(x3,x1) insert#3#(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1#(leq#2(x6,x4),x6,x4,x2) insert#3#(x6,Cons(x4,x2)) -> leq#2#(x6,x4) leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) sort#2#(Cons(x4,x2)) -> insert#3#(x4,sort#2(x2)) sort#2#(Cons(x4,x2)) -> sort#2#(x2) - Weak TRS: cond_insert_ord_x_ys_1(False(),x3,x2,x1) -> Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) -> Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) -> Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) -> cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) -> True() leq#2(S(x12),0()) -> False() leq#2(S(x4),S(x2)) -> leq#2(x4,x2) sort#2(Cons(x4,x2)) -> insert#3(x4,sort#2(x2)) sort#2(Nil()) -> Nil() - Signature: {cond_insert_ord_x_ys_1/4,insert#3/2,leq#2/2,main/1,sort#2/1,cond_insert_ord_x_ys_1#/4,insert#3#/2,leq#2#/2 ,main#/1,sort#2#/1} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0,c_1/1,c_2/0,c_3/0,c_4/2,c_5/0,c_6/0,c_7/1,c_8/1 ,c_9/2,c_10/0} - Obligation: innermost runtime complexity wrt. defined symbols {cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main# ,sort#2#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: EmptyProcessor + Details: The problem is already closed. The intended complexity is O(1). WORST_CASE(?,O(n^3))