WORST_CASE(?,O(n^2)) * Step 1: Desugar WORST_CASE(?,O(n^2)) + Considered Problem: type nat = 0 | S of nat ;; type 'a list = Nil | Cons of 'a * 'a list ;; type bool = False | True ;; let rec leq x y = match x with | 0 -> True | S(x') -> match y with | 0 -> False | S(y') -> leq x' y' ;; let rec insert ord x ys = match ys with | Nil -> Cons(x,Nil) | Cons(y,ys') -> match ord x y with | True -> Cons(x,Cons(y,ys')) | False -> Cons(y,insert ord x ys') ;; let rec sort ord ys = match ys with | Nil -> Nil | Cons(y,ys') -> insert ord y (sort ord ys') ;; let srt ys = sort leq ys;; + Applied Processor: Desugar {analysedFunction = Nothing} + Details: none * Step 2: Defunctionalization WORST_CASE(?,O(n^2)) + Considered Problem: λys : nat list. (λleq : nat -> nat -> bool. (λinsert : (nat -> nat -> bool) -> nat -> nat list -> nat list. (λsort : (nat -> nat -> bool) -> nat list -> nat list. (λsrt : nat list -> nat list. srt ys) (λys : nat list. sort leq ys)) (μsort : (nat -> nat -> bool) -> nat list -> nat list. λord : nat -> nat -> bool. λys : nat list. case ys of | Nil -> Nil | Cons -> λy : nat. λys' : nat list. insert ord y (sort ord ys'))) (μinsert : (nat -> nat -> bool) -> nat -> nat list -> nat list. λord : nat -> nat -> bool. λx : nat. λys : nat list. case ys of | Nil -> Cons(x,Nil) | Cons -> λy : nat. λys' : nat list. case ord x y of | True -> Cons(x,Cons(y,ys')) | False -> Cons(y,insert ord x ys'))) (μleq : nat -> nat -> bool. λx : nat. λy : nat. case x of | 0 -> True | S -> λx' : nat. case y of | 0 -> False | S -> λy' : nat. leq x' y') : nat list -> nat list where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool + Applied Processor: Defunctionalization + Details: none * Step 3: Inline WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x0, x1) x3 -> main_4(x0) srt(x1, x3) 4: cond_sort_ord_ys(Nil(), x2, x3) -> Nil() 5: cond_sort_ord_ys(Cons(x5, x6), x2, x3) -> x2 x3 x5 (sort(x2) x3 x6) 6: sort_ord(x2, x3) x4 -> cond_sort_ord_ys(x4, x2, x3) 7: sort_1(x2) x3 -> sort_ord(x2, x3) 8: sort(x2) x3 -> sort_1(x2) x3 9: main_2(x0, x1) x2 -> main_3(x0, x1) sort(x2) 10: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 11: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 12: cond_insert_ord_x_ys(Nil(), x2, x3) -> Cons(x3, Nil()) 13: cond_insert_ord_x_ys(Cons(x5, x6), x2, x3) -> cond_insert_ord_x_ys_1(x2 x3 x5, x2, x3, x5, x6) 14: insert_ord_x(x2, x3) x4 -> cond_insert_ord_x_ys(x4, x2, x3) 15: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 16: insert_1() x2 -> insert_ord(x2) 17: insert() x0 -> insert_1() x0 18: main_1(x0) x1 -> main_2(x0, x1) insert() 19: cond_leq_x_y_1(0(), x3) -> False() 20: cond_leq_x_y_1(S(x4), x3) -> leq() x3 x4 21: cond_leq_x_y(0(), x2) -> True() 22: cond_leq_x_y(S(x3), x2) -> cond_leq_x_y_1(x2, x3) 23: leq_x(x1) x2 -> cond_leq_x_y(x1, x2) 24: leq_1() x1 -> leq_x(x1) 25: leq() x0 -> leq_1() x0 26: main(x0) -> main_1(x0) leq() where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_leq_x_y :: nat -> nat -> bool cond_sort_ord_ys :: nat list -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list cond_insert_ord_x_ys :: nat list -> (nat -> nat -> bool) -> nat -> nat list cond_leq_x_y_1 :: nat -> nat -> bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: Inline {inlineType = InlineRewrite, inlineSelect = } + Details: none * Step 4: Inline WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x0, x3) x7 -> srt(x3, x7) x0 4: cond_sort_ord_ys(Nil(), x2, x3) -> Nil() 5: cond_sort_ord_ys(Cons(x5, x6), x2, x3) -> x2 x3 x5 (sort(x2) x3 x6) 6: sort_ord(x2, x3) x4 -> cond_sort_ord_ys(x4, x2, x3) 7: sort_1(x2) x3 -> sort_ord(x2, x3) 8: sort(x4) x6 -> sort_ord(x4, x6) 9: main_2(x0, x2) x5 -> main_4(x0) srt(x2, sort(x5)) 10: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 11: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 12: cond_insert_ord_x_ys(Nil(), x2, x3) -> Cons(x3, Nil()) 13: cond_insert_ord_x_ys(Cons(x5, x6), x2, x3) -> cond_insert_ord_x_ys_1(x2 x3 x5, x2, x3, x5, x6) 14: insert_ord_x(x2, x3) x4 -> cond_insert_ord_x_ys(x4, x2, x3) 15: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 16: insert_1() x2 -> insert_ord(x2) 17: insert() x4 -> insert_ord(x4) 18: main_1(x0) x2 -> main_3(x0, x2) sort(insert()) 19: cond_leq_x_y_1(0(), x3) -> False() 20: cond_leq_x_y_1(S(x4), x3) -> leq() x3 x4 21: cond_leq_x_y(0(), x2) -> True() 22: cond_leq_x_y(S(x3), x2) -> cond_leq_x_y_1(x2, x3) 23: leq_x(x1) x2 -> cond_leq_x_y(x1, x2) 24: leq_1() x1 -> leq_x(x1) 25: leq() x2 -> leq_x(x2) 26: main(x0) -> main_2(x0, leq()) insert() where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_leq_x_y :: nat -> nat -> bool cond_sort_ord_ys :: nat list -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list cond_insert_ord_x_ys :: nat list -> (nat -> nat -> bool) -> nat -> nat list cond_leq_x_y_1 :: nat -> nat -> bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: Inline {inlineType = InlineRewrite, inlineSelect = } + Details: none * Step 5: Inline WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x8, x2) x6 -> x6 x2 x8 4: cond_sort_ord_ys(Nil(), x2, x3) -> Nil() 5: cond_sort_ord_ys(Cons(x5, x6), x2, x3) -> x2 x3 x5 (sort(x2) x3 x6) 6: sort_ord(x2, x3) x4 -> cond_sort_ord_ys(x4, x2, x3) 7: sort_1(x2) x3 -> sort_ord(x2, x3) 8: sort(x4) x6 -> sort_ord(x4, x6) 9: main_2(x0, x5) x11 -> srt(x5, sort(x11)) x0 10: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 11: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 12: cond_insert_ord_x_ys(Nil(), x2, x3) -> Cons(x3, Nil()) 13: cond_insert_ord_x_ys(Cons(x5, x6), x2, x3) -> cond_insert_ord_x_ys_1(x2 x3 x5, x2, x3, x5, x6) 14: insert_ord_x(x2, x3) x4 -> cond_insert_ord_x_ys(x4, x2, x3) 15: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 16: insert_1() x2 -> insert_ord(x2) 17: insert() x4 -> insert_ord(x4) 18: main_1(x0) x6 -> srt(x6, sort(insert())) x0 19: cond_leq_x_y_1(0(), x3) -> False() 20: cond_leq_x_y_1(S(x4), x3) -> leq() x3 x4 21: cond_leq_x_y(0(), x2) -> True() 22: cond_leq_x_y(S(x3), x2) -> cond_leq_x_y_1(x2, x3) 23: leq_x(x1) x2 -> cond_leq_x_y(x1, x2) 24: leq_1() x1 -> leq_x(x1) 25: leq() x2 -> leq_x(x2) 26: main(x0) -> main_4(x0) srt(leq(), sort(insert())) where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_leq_x_y :: nat -> nat -> bool cond_sort_ord_ys :: nat list -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list cond_insert_ord_x_ys :: nat list -> (nat -> nat -> bool) -> nat -> nat list cond_leq_x_y_1 :: nat -> nat -> bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: Inline {inlineType = InlineRewrite, inlineSelect = } + Details: none * Step 6: Inline WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x8, x2) x6 -> x6 x2 x8 4: cond_sort_ord_ys(Nil(), x2, x3) -> Nil() 5: cond_sort_ord_ys(Cons(x5, x6), x2, x3) -> x2 x3 x5 (sort(x2) x3 x6) 6: sort_ord(x2, x3) x4 -> cond_sort_ord_ys(x4, x2, x3) 7: sort_1(x2) x3 -> sort_ord(x2, x3) 8: sort(x4) x6 -> sort_ord(x4, x6) 9: main_2(x8, x2) x23 -> sort(x23) x2 x8 10: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 11: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 12: cond_insert_ord_x_ys(Nil(), x2, x3) -> Cons(x3, Nil()) 13: cond_insert_ord_x_ys(Cons(x5, x6), x2, x3) -> cond_insert_ord_x_ys_1(x2 x3 x5, x2, x3, x5, x6) 14: insert_ord_x(x2, x3) x4 -> cond_insert_ord_x_ys(x4, x2, x3) 15: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 16: insert_1() x2 -> insert_ord(x2) 17: insert() x4 -> insert_ord(x4) 18: main_1(x8) x2 -> sort(insert()) x2 x8 19: cond_leq_x_y_1(0(), x3) -> False() 20: cond_leq_x_y_1(S(x4), x3) -> leq() x3 x4 21: cond_leq_x_y(0(), x2) -> True() 22: cond_leq_x_y(S(x3), x2) -> cond_leq_x_y_1(x2, x3) 23: leq_x(x1) x2 -> cond_leq_x_y(x1, x2) 24: leq_1() x1 -> leq_x(x1) 25: leq() x2 -> leq_x(x2) 26: main(x0) -> srt(leq(), sort(insert())) x0 where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_leq_x_y :: nat -> nat -> bool cond_sort_ord_ys :: nat list -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list cond_insert_ord_x_ys :: nat list -> (nat -> nat -> bool) -> nat -> nat list cond_leq_x_y_1 :: nat -> nat -> bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: Inline {inlineType = InlineRewrite, inlineSelect = } + Details: none * Step 7: Inline WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x8, x2) x6 -> x6 x2 x8 4: cond_sort_ord_ys(Nil(), x2, x3) -> Nil() 5: cond_sort_ord_ys(Cons(x5, x6), x2, x3) -> x2 x3 x5 (sort(x2) x3 x6) 6: sort_ord(x2, x3) x4 -> cond_sort_ord_ys(x4, x2, x3) 7: sort_1(x2) x3 -> sort_ord(x2, x3) 8: sort(x4) x6 -> sort_ord(x4, x6) 9: main_2(x8, x2) x23 -> sort(x23) x2 x8 10: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 11: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 12: cond_insert_ord_x_ys(Nil(), x2, x3) -> Cons(x3, Nil()) 13: cond_insert_ord_x_ys(Cons(x5, x6), x2, x3) -> cond_insert_ord_x_ys_1(x2 x3 x5, x2, x3, x5, x6) 14: insert_ord_x(x2, x3) x4 -> cond_insert_ord_x_ys(x4, x2, x3) 15: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 16: insert_1() x2 -> insert_ord(x2) 17: insert() x4 -> insert_ord(x4) 18: main_1(x8) x2 -> sort(insert()) x2 x8 19: cond_leq_x_y_1(0(), x3) -> False() 20: cond_leq_x_y_1(S(x4), x3) -> leq() x3 x4 21: cond_leq_x_y(0(), x2) -> True() 22: cond_leq_x_y(S(x3), x2) -> cond_leq_x_y_1(x2, x3) 23: leq_x(x1) x2 -> cond_leq_x_y(x1, x2) 24: leq_1() x1 -> leq_x(x1) 25: leq() x2 -> leq_x(x2) 26: main(x8) -> sort(insert()) leq() x8 where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_leq_x_y :: nat -> nat -> bool cond_sort_ord_ys :: nat list -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list cond_insert_ord_x_ys :: nat list -> (nat -> nat -> bool) -> nat -> nat list cond_leq_x_y_1 :: nat -> nat -> bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: Inline {inlineType = InlineFull, inlineSelect = } + Details: none * Step 8: Inline WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x8, x2) x6 -> x6 x2 x8 4: cond_sort_ord_ys(Nil(), x2, x3) -> Nil() 5: cond_sort_ord_ys(Cons(x5, x6), x2, x3) -> x2 x3 x5 (sort(x2) x3 x6) 6: sort_ord(x4, x6) Nil() -> Nil() 7: sort_ord(x4, x6) Cons(x10, x12) -> x4 x6 x10 (sort(x4) x6 x12) 8: sort_1(x2) x3 -> sort_ord(x2, x3) 9: sort(x4) x6 -> sort_ord(x4, x6) 10: main_2(x8, x2) x23 -> sort(x23) x2 x8 11: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 12: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 13: cond_insert_ord_x_ys(Nil(), x2, x3) -> Cons(x3, Nil()) 14: cond_insert_ord_x_ys(Cons(x5, x6), x2, x3) -> cond_insert_ord_x_ys_1(x2 x3 x5, x2, x3, x5, x6) 15: insert_ord_x(x4, x6) Nil() -> Cons(x6, Nil()) 16: insert_ord_x(x4, x6) Cons(x10, x12) -> cond_insert_ord_x_ys_1(x4 x6 x10, x4, x6, x10, x12) 17: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 18: insert_1() x2 -> insert_ord(x2) 19: insert() x4 -> insert_ord(x4) 20: main_1(x8) x2 -> sort(insert()) x2 x8 21: cond_leq_x_y_1(0(), x3) -> False() 22: cond_leq_x_y_1(S(x4), x3) -> leq() x3 x4 23: cond_leq_x_y(0(), x2) -> True() 24: cond_leq_x_y(S(x6), 0()) -> False() 25: cond_leq_x_y(S(x6), S(x8)) -> leq() x6 x8 26: leq_x(0()) x4 -> True() 27: leq_x(S(x6)) x4 -> cond_leq_x_y_1(x4, x6) 28: leq_1() x1 -> leq_x(x1) 29: leq() x2 -> leq_x(x2) 30: main(x8) -> sort(insert()) leq() x8 where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_leq_x_y :: nat -> nat -> bool cond_sort_ord_ys :: nat list -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list cond_insert_ord_x_ys :: nat list -> (nat -> nat -> bool) -> nat -> nat list cond_leq_x_y_1 :: nat -> nat -> bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: Inline {inlineType = InlineFull, inlineSelect = } + Details: none * Step 9: UsableRules WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x8, x2) x6 -> x6 x2 x8 4: cond_sort_ord_ys(Nil(), x2, x3) -> Nil() 5: cond_sort_ord_ys(Cons(x5, x6), x2, x3) -> x2 x3 x5 (sort(x2) x3 x6) 6: sort_ord(x4, x6) Nil() -> Nil() 7: sort_ord(x4, x6) Cons(x10, x12) -> x4 x6 x10 (sort(x4) x6 x12) 8: sort_1(x2) x3 -> sort_ord(x2, x3) 9: sort(x4) x6 -> sort_ord(x4, x6) 10: main_2(x8, x2) x23 -> sort(x23) x2 x8 11: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 12: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 13: cond_insert_ord_x_ys(Nil(), x2, x3) -> Cons(x3, Nil()) 14: cond_insert_ord_x_ys(Cons(x5, x6), x2, x3) -> cond_insert_ord_x_ys_1(x2 x3 x5, x2, x3, x5, x6) 15: insert_ord_x(x4, x6) Nil() -> Cons(x6, Nil()) 16: insert_ord_x(x4, x6) Cons(x10, x12) -> cond_insert_ord_x_ys_1(x4 x6 x10, x4, x6, x10, x12) 17: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 18: insert_1() x2 -> insert_ord(x2) 19: insert() x4 -> insert_ord(x4) 20: main_1(x8) x2 -> sort(insert()) x2 x8 21: cond_leq_x_y_1(0(), x3) -> False() 22: cond_leq_x_y_1(S(x4), x3) -> leq() x3 x4 23: cond_leq_x_y(0(), x2) -> True() 24: cond_leq_x_y(S(x6), 0()) -> False() 25: cond_leq_x_y(S(x6), S(x8)) -> leq() x6 x8 26: leq_x(0()) x4 -> True() 27: leq_x(S(x6)) 0() -> False() 28: leq_x(S(x6)) S(x8) -> leq() x6 x8 29: leq_1() x1 -> leq_x(x1) 30: leq() x2 -> leq_x(x2) 31: main(x8) -> sort(insert()) leq() x8 where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_leq_x_y :: nat -> nat -> bool cond_sort_ord_ys :: nat list -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list cond_insert_ord_x_ys :: nat list -> (nat -> nat -> bool) -> nat -> nat list cond_leq_x_y_1 :: nat -> nat -> bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: UsableRules {urType = Syntactic} + Details: none * Step 10: NeededRules WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x8, x2) x6 -> x6 x2 x8 6: sort_ord(x4, x6) Nil() -> Nil() 7: sort_ord(x4, x6) Cons(x10, x12) -> x4 x6 x10 (sort(x4) x6 x12) 8: sort_1(x2) x3 -> sort_ord(x2, x3) 9: sort(x4) x6 -> sort_ord(x4, x6) 10: main_2(x8, x2) x23 -> sort(x23) x2 x8 11: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 12: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 15: insert_ord_x(x4, x6) Nil() -> Cons(x6, Nil()) 16: insert_ord_x(x4, x6) Cons(x10, x12) -> cond_insert_ord_x_ys_1(x4 x6 x10, x4, x6, x10, x12) 17: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 18: insert_1() x2 -> insert_ord(x2) 19: insert() x4 -> insert_ord(x4) 20: main_1(x8) x2 -> sort(insert()) x2 x8 26: leq_x(0()) x4 -> True() 27: leq_x(S(x6)) 0() -> False() 28: leq_x(S(x6)) S(x8) -> leq() x6 x8 29: leq_1() x1 -> leq_x(x1) 30: leq() x2 -> leq_x(x2) 31: main(x8) -> sort(insert()) leq() x8 where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: NeededRules + Details: none * Step 11: CFA WORST_CASE(?,O(n^2)) + Considered Problem: 1: main_4(x0) x4 -> x4 x0 2: srt(x1, x3) x4 -> x3 x1 x4 3: main_3(x8, x2) x6 -> x6 x2 x8 4: sort_ord(x4, x6) Nil() -> Nil() 5: sort_ord(x4, x6) Cons(x10, x12) -> x4 x6 x10 (sort(x4) x6 x12) 6: sort_1(x2) x3 -> sort_ord(x2, x3) 7: sort(x4) x6 -> sort_ord(x4, x6) 8: main_2(x8, x2) x23 -> sort(x23) x2 x8 9: cond_insert_ord_x_ys_1(True(), x2, x3, x5, x6) -> Cons(x3, Cons(x5, x6)) 10: cond_insert_ord_x_ys_1(False(), x2, x3, x5, x6) -> Cons(x5, insert() x2 x3 x6) 11: insert_ord_x(x4, x6) Nil() -> Cons(x6, Nil()) 12: insert_ord_x(x4, x6) Cons(x10, x12) -> cond_insert_ord_x_ys_1(x4 x6 x10, x4, x6, x10, x12) 13: insert_ord(x2) x3 -> insert_ord_x(x2, x3) 14: insert_1() x2 -> insert_ord(x2) 15: insert() x4 -> insert_ord(x4) 16: main_1(x8) x2 -> sort(insert()) x2 x8 17: leq_x(0()) x4 -> True() 18: leq_x(S(x6)) 0() -> False() 19: leq_x(S(x6)) S(x8) -> leq() x6 x8 20: leq_1() x1 -> leq_x(x1) 21: leq() x2 -> leq_x(x2) 22: main(x8) -> sort(insert()) leq() x8 where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list srt :: (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq_1 :: nat -> nat -> bool main_1 :: nat list -> (nat -> nat -> bool) -> nat list sort_1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main_2 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> nat list main_3 :: nat list -> (nat -> nat -> bool) -> ((nat -> nat -> bool) -> nat list -> nat list) -> nat list main_4 :: nat list -> (nat list -> nat list) -> nat list cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: CFA {cfaRefinement = } + Details: {X{*} -> S(X{*}) | S(X{*}) | False() | 0() | S(X{*}) | True() | 0() | Cons(X{*},X{*}) | Nil() | Cons(X{*},X{*}) | Nil() | Cons(X{*},X{*}) | False() | Cons(X{*},X{*}) | Cons(X{*},X{*}) | True() | Cons(X{*},X{*}) | Nil() | Nil() ,V{x2_9} -> V{x4_12} ,V{x2_10} -> V{x4_12} ,V{x2_13} -> V{x4_15} ,V{x2_21} -> V{x6_19} | V{x6_12} ,V{x3_9} -> V{x6_12} ,V{x3_10} -> V{x6_12} ,V{x3_13} -> V{x3_10} | V{x10_5} ,V{x4_4} -> V{x4_7} ,V{x4_5} -> V{x4_7} ,V{x4_7} -> V{x4_5} | insert() ,V{x4_11} -> V{x2_13} ,V{x4_12} -> V{x2_13} ,V{x4_15} -> V{x2_10} | V{x6_5} ,V{x4_17} -> V{x8_19} | V{x10_12} ,V{x5_9} -> V{x10_12} ,V{x5_10} -> V{x10_12} ,V{x6_4} -> V{x6_7} ,V{x6_5} -> V{x6_7} ,V{x6_7} -> V{x6_5} | leq() ,V{x6_9} -> V{x12_12} ,V{x6_10} -> V{x12_12} ,V{x6_11} -> V{x3_13} ,V{x6_12} -> V{x3_13} ,V{x6_18} -> X{*} ,V{x6_19} -> X{*} ,V{x8_19} -> X{*} ,V{x8_22} -> X{*} ,V{x10_5} -> X{*} ,V{x10_12} -> V{x5_9} | V{x5_10} | V{x3_9} | V{x6_11} ,V{x12_5} -> X{*} ,V{x12_12} -> R{12} | R{11} | V{x6_9} | @(R{13},V{x6_10}) | @(@(R{15},V{x3_10}),V{x6_10}) | @(@(@(insert(),V{x2_10}),V{x3_10}),V{x6_10}) | Cons(V{x5_9},V{x6_9}) | Nil() ,R{0} -> R{22} | main(X{*}) ,R{4} -> Nil() ,R{5} -> R{12} | R{11} | @(R{13},R{5}) | @(R{13},R{4}) | @(@(R{15},V{x10_5}),R{4}) | @(@(R{15},V{x10_5}),R{5}) | @(R{13},@(R{7},V{x12_5})) | @(R{13},@(@(sort(V{x4_5}),V{x6_5}),V{x12_5})) | @(@(@(V{x4_5},V{x6_5}),V{x10_5}),R{5}) | @(@(@(V{x4_5},V{x6_5}),V{x10_5}),R{4}) | @(@(R{15},V{x10_5}),@(R{7},V{x12_5})) | @(@(@(V{x4_5},V{x6_5}),V{x10_5}),@(R{7},V{x12_5})) | @(@(R{15},V{x10_5}),@(@(sort(V{x4_5}),V{x6_5}),V{x12_5})) | @(@(@(V{x4_5},V{x6_5}),V{x10_5}),@(@(sort(V{x4_5}),V{x6_5}),V{x12_5})) ,R{7} -> sort_ord(V{x4_7},V{x6_7}) ,R{9} -> Cons(V{x3_9},Cons(V{x5_9},V{x6_9})) ,R{10} -> Cons(V{x5_10},R{12}) | Cons(V{x5_10},R{11}) | Cons(V{x5_10},@(R{13},V{x6_10})) | Cons(V{x5_10},@(@(R{15},V{x3_10}),V{x6_10})) | Cons(V{x5_10},@(@(@(insert(),V{x2_10}),V{x3_10}),V{x6_10})) ,R{11} -> Cons(V{x6_11},Nil()) ,R{12} -> R{9} | R{10} | cond_insert_ord_x_ys_1(R{19},V{x4_12},V{x6_12},V{x10_12},V{x12_12}) | cond_insert_ord_x_ys_1(R{18},V{x4_12},V{x6_12},V{x10_12},V{x12_12}) | cond_insert_ord_x_ys_1(R{17},V{x4_12},V{x6_12},V{x10_12},V{x12_12}) | cond_insert_ord_x_ys_1(@(R{21},V{x10_12}),V{x4_12},V{x6_12},V{x10_12},V{x12_12}) | cond_insert_ord_x_ys_1(@(@(V{x4_12},V{x6_12}),V{x10_12}),V{x4_12},V{x6_12},V{x10_12},V{x12_12}) ,R{13} -> insert_ord_x(V{x2_13},V{x3_13}) ,R{15} -> insert_ord(V{x4_15}) ,R{17} -> True() ,R{18} -> False() ,R{19} -> R{19} | R{18} | R{17} | @(R{21},V{x8_19}) | @(@(leq(),V{x6_19}),V{x8_19}) ,R{21} -> leq_x(V{x2_21}) ,R{22} -> R{5} | R{4} | @(R{7},V{x8_22}) | @(@(sort(insert()),leq()),V{x8_22})} * Step 12: UncurryATRS WORST_CASE(?,O(n^2)) + Considered Problem: 4: sort_ord(insert(), leq()) Nil() -> Nil() 5: sort_ord(insert(), leq()) Cons(x2, x1) -> insert() leq() x2 (sort(insert()) leq() x1) 7: sort(insert()) leq() -> sort_ord(insert(), leq()) 9: cond_insert_ord_x_ys_1(True(), leq(), x3, x2, x1) -> Cons(x3, Cons(x2, x1)) 10: cond_insert_ord_x_ys_1(False(), leq(), x3, x2, x1) -> Cons(x2, insert() leq() x3 x1) 11: insert_ord_x(leq(), x1) Nil() -> Cons(x1, Nil()) 12: insert_ord_x(leq(), x3) Cons(x2, x1) -> cond_insert_ord_x_ys_1(leq() x3 x2, leq(), x3, x2, x1) 13: insert_ord(leq()) x1 -> insert_ord_x(leq(), x1) 15: insert() leq() -> insert_ord(leq()) 17: leq_x(0()) x4 -> True() 18: leq_x(S(x6)) 0() -> False() 19: leq_x(S(x2)) S(x1) -> leq() x2 x1 21: leq() x2 -> leq_x(x2) 22: main(x1) -> sort(insert()) leq() x1 where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list leq_x :: nat -> nat -> bool insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool sort :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list main :: nat list -> nat list + Applied Processor: UncurryATRS + Details: none * Step 13: UsableRules WORST_CASE(?,O(n^2)) + Considered Problem: 1: sort_ord#1(insert(), leq(), Nil()) -> Nil() 2: sort_ord#1(insert(), leq(), Cons(x2, x1)) -> insert#3(leq(), x2, sort#2(insert(), leq(), x1)) 3: sort#1(insert(), leq()) -> sort_ord(insert(), leq()) 4: sort#2(insert(), leq(), x0) -> sort_ord#1(insert(), leq(), x0) 5: cond_insert_ord_x_ys_1(True(), leq(), x3, x2, x1) -> Cons(x3, Cons(x2, x1)) 6: cond_insert_ord_x_ys_1(False(), leq(), x3, x2, x1) -> Cons(x2, insert#3(leq(), x3, x1)) 7: insert_ord_x#1(leq(), x1, Nil()) -> Cons(x1, Nil()) 8: insert_ord_x#1(leq(), x3, Cons(x2, x1)) -> cond_insert_ord_x_ys_1(leq#2(x3, x2), leq(), x3, x2, x1) 9: insert_ord#1(leq(), x1) -> insert_ord_x(leq(), x1) 10: insert_ord#2(leq(), x1, x2) -> insert_ord_x#1(leq(), x1, x2) 11: insert#1(leq()) -> insert_ord(leq()) 12: insert#2(leq(), x0) -> insert_ord#1(leq(), x0) 13: insert#3(leq(), x0, x1) -> insert_ord#2(leq(), x0, x1) 14: leq_x#1(0(), x4) -> True() 15: leq_x#1(S(x6), 0()) -> False() 16: leq_x#1(S(x2), S(x1)) -> leq#2(x2, x1) 17: leq#1(x2) -> leq_x(x2) 18: leq#2(x2, x3) -> leq_x#1(x2, x3) 19: main(x1) -> sort#2(insert(), leq(), x1) where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert#1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert#2 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert#3 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord#1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord#2 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord_x :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord_x#1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool leq#1 :: nat -> nat -> bool leq#2 :: nat -> nat -> bool leq_x :: nat -> nat -> bool leq_x#1 :: nat -> nat -> bool main :: nat list -> nat list sort#1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list sort#2 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list sort_ord :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list sort_ord#1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list + Applied Processor: UsableRules {urType = DFA} + Details: none * Step 14: Inline WORST_CASE(?,O(n^2)) + Considered Problem: 1: sort_ord#1(insert(), leq(), Nil()) -> Nil() 2: sort_ord#1(insert(), leq(), Cons(x2, x1)) -> insert#3(leq(), x2, sort#2(insert(), leq(), x1)) 4: sort#2(insert(), leq(), x0) -> sort_ord#1(insert(), leq(), x0) 5: cond_insert_ord_x_ys_1(True(), leq(), x3, x2, x1) -> Cons(x3, Cons(x2, x1)) 6: cond_insert_ord_x_ys_1(False(), leq(), x3, x2, x1) -> Cons(x2, insert#3(leq(), x3, x1)) 7: insert_ord_x#1(leq(), x1, Nil()) -> Cons(x1, Nil()) 8: insert_ord_x#1(leq(), x3, Cons(x2, x1)) -> cond_insert_ord_x_ys_1(leq#2(x3, x2), leq(), x3, x2, x1) 10: insert_ord#2(leq(), x1, x2) -> insert_ord_x#1(leq(), x1, x2) 13: insert#3(leq(), x0, x1) -> insert_ord#2(leq(), x0, x1) 14: leq_x#1(0(), x4) -> True() 15: leq_x#1(S(x6), 0()) -> False() 16: leq_x#1(S(x2), S(x1)) -> leq#2(x2, x1) 18: leq#2(x2, x3) -> leq_x#1(x2, x3) 19: main(x1) -> sort#2(insert(), leq(), x1) where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert#3 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord#2 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord_x#1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool leq#2 :: nat -> nat -> bool leq_x#1 :: nat -> nat -> bool main :: nat list -> nat list sort#2 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list sort_ord#1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list + Applied Processor: Inline {inlineType = InlineFull, inlineSelect = } + Details: none * Step 15: UsableRules WORST_CASE(?,O(n^2)) + Considered Problem: 1: sort_ord#1(insert(), leq(), Nil()) -> Nil() 2: sort_ord#1(insert(), leq(), Cons(x2, x1)) -> insert#3(leq(), x2, sort#2(insert(), leq(), x1)) 3: sort#2(insert(), leq(), Nil()) -> Nil() 4: sort#2(insert(), leq(), Cons(x4, x2)) -> insert#3(leq(), x4, sort#2(insert(), leq(), x2)) 5: cond_insert_ord_x_ys_1(True(), leq(), x3, x2, x1) -> Cons(x3, Cons(x2, x1)) 6: cond_insert_ord_x_ys_1(False(), leq(), x3, x2, x1) -> Cons(x2, insert#3(leq(), x3, x1)) 7: insert_ord_x#1(leq(), x1, Nil()) -> Cons(x1, Nil()) 8: insert_ord_x#1(leq(), x3, Cons(x2, x1)) -> cond_insert_ord_x_ys_1(leq#2(x3, x2), leq(), x3, x2, x1) 9: insert_ord#2(leq(), x2, Nil()) -> Cons(x2, Nil()) 10: insert_ord#2(leq(), x6, Cons(x4, x2)) -> cond_insert_ord_x_ys_1(leq#2(x6, x4), leq(), x6, x4, x2) 11: insert#3(leq(), x2, x4) -> insert_ord_x#1(leq(), x2, x4) 12: leq_x#1(0(), x4) -> True() 13: leq_x#1(S(x6), 0()) -> False() 14: leq_x#1(S(x2), S(x1)) -> leq#2(x2, x1) 15: leq#2(0(), x8) -> True() 16: leq#2(S(x12), 0()) -> False() 17: leq#2(S(x4), S(x2)) -> leq#2(x4, x2) 18: main(x1) -> sort#2(insert(), leq(), x1) where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert#3 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord#2 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord_x#1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool leq#2 :: nat -> nat -> bool leq_x#1 :: nat -> nat -> bool main :: nat list -> nat list sort#2 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list sort_ord#1 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list + Applied Processor: UsableRules {urType = Syntactic} + Details: none * Step 16: Inline WORST_CASE(?,O(n^2)) + Considered Problem: 3: sort#2(insert(), leq(), Nil()) -> Nil() 4: sort#2(insert(), leq(), Cons(x4, x2)) -> insert#3(leq(), x4, sort#2(insert(), leq(), x2)) 5: cond_insert_ord_x_ys_1(True(), leq(), x3, x2, x1) -> Cons(x3, Cons(x2, x1)) 6: cond_insert_ord_x_ys_1(False(), leq(), x3, x2, x1) -> Cons(x2, insert#3(leq(), x3, x1)) 7: insert_ord_x#1(leq(), x1, Nil()) -> Cons(x1, Nil()) 8: insert_ord_x#1(leq(), x3, Cons(x2, x1)) -> cond_insert_ord_x_ys_1(leq#2(x3, x2), leq(), x3, x2, x1) 11: insert#3(leq(), x2, x4) -> insert_ord_x#1(leq(), x2, x4) 15: leq#2(0(), x8) -> True() 16: leq#2(S(x12), 0()) -> False() 17: leq#2(S(x4), S(x2)) -> leq#2(x4, x2) 18: main(x1) -> sort#2(insert(), leq(), x1) where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert#3 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord_x#1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool leq#2 :: nat -> nat -> bool main :: nat list -> nat list sort#2 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list + Applied Processor: Inline {inlineType = InlineFull, inlineSelect = } + Details: none * Step 17: UsableRules WORST_CASE(?,O(n^2)) + Considered Problem: 1: sort#2(insert(), leq(), Nil()) -> Nil() 2: sort#2(insert(), leq(), Cons(x4, x2)) -> insert#3(leq(), x4, sort#2(insert(), leq(), x2)) 3: cond_insert_ord_x_ys_1(True(), leq(), x3, x2, x1) -> Cons(x3, Cons(x2, x1)) 4: cond_insert_ord_x_ys_1(False(), leq(), x3, x2, x1) -> Cons(x2, insert#3(leq(), x3, x1)) 5: insert_ord_x#1(leq(), x1, Nil()) -> Cons(x1, Nil()) 6: insert_ord_x#1(leq(), x3, Cons(x2, x1)) -> cond_insert_ord_x_ys_1(leq#2(x3, x2), leq(), x3, x2, x1) 7: insert#3(leq(), x2, Nil()) -> Cons(x2, Nil()) 8: insert#3(leq(), x6, Cons(x4, x2)) -> cond_insert_ord_x_ys_1(leq#2(x6, x4), leq(), x6, x4, x2) 9: leq#2(0(), x8) -> True() 10: leq#2(S(x12), 0()) -> False() 11: leq#2(S(x4), S(x2)) -> leq#2(x4, x2) 12: main(x1) -> sort#2(insert(), leq(), x1) where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert#3 :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert_ord_x#1 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool leq#2 :: nat -> nat -> bool main :: nat list -> nat list sort#2 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list + Applied Processor: UsableRules {urType = Syntactic} + Details: none * Step 18: Compression WORST_CASE(?,O(n^2)) + Considered Problem: 1: sort#2(insert(), leq(), Nil()) -> Nil() 2: sort#2(insert(), leq(), Cons(x4, x2)) -> insert#3(leq(), x4, sort#2(insert(), leq(), x2)) 3: cond_insert_ord_x_ys_1(True(), leq(), x3, x2, x1) -> Cons(x3, Cons(x2, x1)) 4: cond_insert_ord_x_ys_1(False(), leq(), x3, x2, x1) -> Cons(x2, insert#3(leq(), x3, x1)) 7: insert#3(leq(), x2, Nil()) -> Cons(x2, Nil()) 8: insert#3(leq(), x6, Cons(x4, x2)) -> cond_insert_ord_x_ys_1(leq#2(x6, x4), leq(), x6, x4, x2) 9: leq#2(0(), x8) -> True() 10: leq#2(S(x12), 0()) -> False() 11: leq#2(S(x4), S(x2)) -> leq#2(x4, x2) 12: main(x1) -> sort#2(insert(), leq(), x1) where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool cond_insert_ord_x_ys_1 :: bool -> (nat -> nat -> bool) -> nat -> nat -> nat list -> nat list insert :: (nat -> nat -> bool) -> nat -> nat list -> nat list insert#3 :: (nat -> nat -> bool) -> nat -> nat list -> nat list leq :: nat -> nat -> bool leq#2 :: nat -> nat -> bool main :: nat list -> nat list sort#2 :: ((nat -> nat -> bool) -> nat -> nat list -> nat list) -> (nat -> nat -> bool) -> nat list -> nat list + Applied Processor: Compression + Details: none * Step 19: ToTctProblem WORST_CASE(?,O(n^2)) + Considered Problem: 1: sort#2(Nil()) -> Nil() 2: sort#2(Cons(x4, x2)) -> insert#3(x4, sort#2(x2)) 3: cond_insert_ord_x_ys_1(True(), x3, x2, x1) -> Cons(x3, Cons(x2, x1)) 4: cond_insert_ord_x_ys_1(False(), x3, x2, x1) -> Cons(x2, insert#3(x3, x1)) 5: insert#3(x2, Nil()) -> Cons(x2, Nil()) 6: insert#3(x6, Cons(x4, x2)) -> cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2) 7: leq#2(0(), x8) -> True() 8: leq#2(S(x12), 0()) -> False() 9: leq#2(S(x4), S(x2)) -> leq#2(x4, x2) 10: main(x1) -> sort#2(x1) where 0 :: nat Cons :: 'a -> 'a list -> 'a list False :: bool Nil :: 'a list S :: nat -> nat True :: bool cond_insert_ord_x_ys_1 :: bool -> nat -> nat -> nat list -> nat list insert#3 :: nat -> nat list -> nat list leq#2 :: nat -> nat -> bool main :: nat list -> nat list sort#2 :: nat list -> nat list + Applied Processor: ToTctProblem + Details: none * Step 20: DependencyPairs WORST_CASE(?,O(n^2)) + 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 {main} 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 21: UsableRules 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)) 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 {main#} 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)) 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() * Step 22: PredecessorEstimation 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)) 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) 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 {main#} 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 23: RemoveWeakSuffixes 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)) 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) 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 {main#} 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 24: Decompose 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)) 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) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: Decompose {onSelection = all cycle independent sub-graph, withBound = RelativeAdd} + Details: We analyse the complexity of following sub-problems (R) and (S). Problem (S) is obtained from the input problem by shifting strict rules from (R) into the weak component. Problem (R) - 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: 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) 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 {main#} and constructors {0,Cons,False,Nil,S,True} Problem (S) - Strict DPs: 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#(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 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 {main#} and constructors {0,Cons,False,Nil,S,True} ** Step 24.a:1: PredecessorEstimationCP 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: 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) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: PredecessorEstimationCP {onSelectionCP = any intersect of rules of CDG leaf and strict-rules, withComplexityPair = NaturalPI {shape = Mixed 2, restrict = Restrict, uargs = UArgs, urules = URules, selector = Nothing}} + Details: We first use the processor NaturalPI {shape = Mixed 2, restrict = Restrict, uargs = UArgs, urules = URules, selector = Nothing} to orient following rules strictly: 2: 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)) 3: leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) Consider the set of all dependency pairs 1: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) 2: 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)) 3: leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) 4: main#(x1) -> c_8(sort#2#(x1)) 5: sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) Processor NaturalPI {shape = Mixed 2, restrict = Restrict, uargs = UArgs, urules = URules, selector = Nothing}induces the complexity certificateTIME (?,O(n^2)) SPACE(?,?)on application of the dependency pairs {2,3} These cover all (indirect) predecessors of dependency pairs {1,2,3,4} their number of applications is equally bounded. The dependency pairs are shifted into the weak component. *** Step 24.a:1.a:1: NaturalPI 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: 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) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: NaturalPI {shape = Mixed 2, restrict = Restrict, uargs = UArgs, urules = URules, selector = Just first alternative for predecessorEstimation on any intersect of rules of CDG leaf and strict-rules} + Details: We apply a polynomial interpretation of kind constructor-based(mixed(2)): The following argument positions are considered usable: uargs(c_1) = {1}, uargs(c_4) = {1,2}, uargs(c_7) = {1}, uargs(c_8) = {1}, uargs(c_9) = {1,2} Following symbols are considered usable: {cond_insert_ord_x_ys_1,insert#3,leq#2,sort#2,cond_insert_ord_x_ys_1#,insert#3#,leq#2#,main#,sort#2#} TcT has computed the following interpretation: p(0) = 0 p(Cons) = 2 + x1 + x2 p(False) = 0 p(Nil) = 0 p(S) = 2 + x1 p(True) = 0 p(cond_insert_ord_x_ys_1) = 4 + x2 + x3 + x4 p(insert#3) = 2 + x1 + x2 p(leq#2) = 2*x1^2 + x2 p(main) = 4 + x1 + x1^2 p(sort#2) = x1 p(cond_insert_ord_x_ys_1#) = 1 + 2*x2 + 4*x2*x4 + 2*x4 p(insert#3#) = 1 + 4*x1*x2 + 2*x2 p(leq#2#) = 2*x2 p(main#) = 4 + 7*x1^2 p(sort#2#) = 2 + 3*x1^2 p(c_1) = x1 p(c_2) = 4 p(c_3) = 1 p(c_4) = 1 + x1 + x2 p(c_5) = 1 p(c_6) = 1 p(c_7) = x1 p(c_8) = 1 + x1 p(c_9) = 7 + x1 + x2 p(c_10) = 0 Following rules are strictly oriented: insert#3#(x6,Cons(x4,x2)) = 5 + 2*x2 + 4*x2*x6 + 2*x4 + 4*x4*x6 + 8*x6 > 2 + 2*x2 + 4*x2*x6 + 2*x4 + 2*x6 = 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)) = 4 + 2*x2 > 2*x2 = c_7(leq#2#(x4,x2)) Following rules are (at-least) weakly oriented: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) = 1 + 2*x1 + 4*x1*x3 + 2*x3 >= 1 + 2*x1 + 4*x1*x3 = c_1(insert#3#(x3,x1)) main#(x1) = 4 + 7*x1^2 >= 3 + 3*x1^2 = c_8(sort#2#(x1)) sort#2#(Cons(x4,x2)) = 14 + 12*x2 + 6*x2*x4 + 3*x2^2 + 12*x4 + 3*x4^2 >= 10 + 2*x2 + 4*x2*x4 + 3*x2^2 = c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) cond_insert_ord_x_ys_1(False(),x3,x2,x1) = 4 + x1 + x2 + x3 >= 4 + x1 + x2 + x3 = Cons(x2,insert#3(x3,x1)) cond_insert_ord_x_ys_1(True(),x3,x2,x1) = 4 + x1 + x2 + x3 >= 4 + x1 + x2 + x3 = Cons(x3,Cons(x2,x1)) insert#3(x2,Nil()) = 2 + x2 >= 2 + x2 = Cons(x2,Nil()) insert#3(x6,Cons(x4,x2)) = 4 + x2 + x4 + x6 >= 4 + x2 + x4 + x6 = cond_insert_ord_x_ys_1(leq#2(x6,x4),x6,x4,x2) leq#2(0(),x8) = x8 >= 0 = True() leq#2(S(x12),0()) = 8 + 8*x12 + 2*x12^2 >= 0 = False() leq#2(S(x4),S(x2)) = 10 + x2 + 8*x4 + 2*x4^2 >= x2 + 2*x4^2 = leq#2(x4,x2) sort#2(Cons(x4,x2)) = 2 + x2 + x4 >= 2 + x2 + x4 = insert#3(x4,sort#2(x2)) sort#2(Nil()) = 0 >= 0 = Nil() *** Step 24.a:1.a:2: Assumption WORST_CASE(?,O(1)) + Considered Problem: - Strict DPs: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) - Weak DPs: 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) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: Assumption {assumed = Certificate {spaceUB = Unknown, spaceLB = Unknown, timeUB = Poly (Just 0), timeLB = Unknown}} + Details: () *** Step 24.a:1.b:1: RemoveWeakSuffixes 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),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) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: RemoveWeakSuffixes + Details: Consider the dependency graph 1:W: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:W: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:W: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:W: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:W: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 The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. 4: main#(x1) -> c_8(sort#2#(x1)) 5: sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)) 1: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) 2: 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)) 3: leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) *** Step 24.a:1.b:2: EmptyProcessor WORST_CASE(?,O(1)) + Considered Problem: - 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: EmptyProcessor + Details: The problem is already closed. The intended complexity is O(1). ** Step 24.b:1: RemoveWeakSuffixes WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: 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#(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 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: RemoveWeakSuffixes + Details: Consider the dependency graph 1: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)):2 2:S:sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),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)):4 -->_2 sort#2#(Cons(x4,x2)) -> c_9(insert#3#(x4,sort#2(x2)),sort#2#(x2)):2 3:W: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)):4 4:W: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)):5 -->_1 cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)):3 5:W: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)):5 The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. 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)) 3: cond_insert_ord_x_ys_1#(False(),x3,x2,x1) -> c_1(insert#3#(x3,x1)) 5: leq#2#(S(x4),S(x2)) -> c_7(leq#2#(x4,x2)) ** Step 24.b:2: SimplifyRHS WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: 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) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: SimplifyRHS + Details: Consider the dependency graph 1: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)):2 2: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)):2 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 24.b:3: UsableRules WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: main#(x1) -> c_8(sort#2#(x1)) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: UsableRules + Details: We replace rewrite rules by usable rules: main#(x1) -> c_8(sort#2#(x1)) sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) ** Step 24.b:4: PredecessorEstimationCP WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: main#(x1) -> c_8(sort#2#(x1)) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: PredecessorEstimationCP {onSelectionCP = any intersect of rules of CDG leaf and strict-rules, withComplexityPair = NaturalMI {miDimension = 1, miDegree = 1, miKind = Algebraic, uargs = UArgs, urules = URules, selector = Nothing}} + Details: We first use the processor NaturalMI {miDimension = 1, miDegree = 1, miKind = Algebraic, uargs = UArgs, urules = URules, selector = Nothing} to orient following rules strictly: 1: main#(x1) -> c_8(sort#2#(x1)) 2: sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) The strictly oriented rules are moved into the weak component. *** Step 24.b:4.a:1: NaturalMI WORST_CASE(?,O(n^1)) + Considered Problem: - Strict DPs: main#(x1) -> c_8(sort#2#(x1)) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: NaturalMI {miDimension = 1, miDegree = 1, miKind = Algebraic, uargs = UArgs, urules = URules, selector = Just first alternative for predecessorEstimation on any intersect of rules of CDG leaf and strict-rules} + Details: We apply a matrix interpretation of kind constructor based matrix interpretation: The following argument positions are considered usable: uargs(c_8) = {1}, uargs(c_9) = {1} Following symbols are considered usable: {main#,sort#2#} TcT has computed the following interpretation: p(0) = [0] p(Cons) = [1] x1 + [1] x2 + [2] p(False) = [0] p(Nil) = [0] p(S) = [0] p(True) = [0] p(cond_insert_ord_x_ys_1) = [1] x2 + [2] x3 + [1] x4 + [0] p(insert#3) = [0] p(leq#2) = [1] x1 + [2] x2 + [0] p(main) = [0] p(sort#2) = [0] p(cond_insert_ord_x_ys_1#) = [1] x3 + [0] p(insert#3#) = [1] x1 + [0] p(leq#2#) = [2] x1 + [1] x2 + [0] p(main#) = [9] x1 + [14] p(sort#2#) = [8] x1 + [2] p(c_1) = [0] p(c_2) = [0] p(c_3) = [0] p(c_4) = [1] x1 + [0] p(c_5) = [0] p(c_6) = [0] p(c_7) = [0] p(c_8) = [1] x1 + [1] p(c_9) = [1] x1 + [12] p(c_10) = [0] Following rules are strictly oriented: main#(x1) = [9] x1 + [14] > [8] x1 + [3] = c_8(sort#2#(x1)) sort#2#(Cons(x4,x2)) = [8] x2 + [8] x4 + [18] > [8] x2 + [14] = c_9(sort#2#(x2)) Following rules are (at-least) weakly oriented: *** Step 24.b:4.a:2: Assumption WORST_CASE(?,O(1)) + Considered Problem: - Weak DPs: main#(x1) -> c_8(sort#2#(x1)) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: Assumption {assumed = Certificate {spaceUB = Unknown, spaceLB = Unknown, timeUB = Poly (Just 0), timeLB = Unknown}} + Details: () *** Step 24.b:4.b:1: RemoveWeakSuffixes WORST_CASE(?,O(1)) + Considered Problem: - Weak DPs: main#(x1) -> c_8(sort#2#(x1)) 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 {main#} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: RemoveWeakSuffixes + Details: Consider the dependency graph 1:W:main#(x1) -> c_8(sort#2#(x1)) -->_1 sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)):2 2:W:sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) -->_1 sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)):2 The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed. 1: main#(x1) -> c_8(sort#2#(x1)) 2: sort#2#(Cons(x4,x2)) -> c_9(sort#2#(x2)) *** Step 24.b:4.b:2: EmptyProcessor WORST_CASE(?,O(1)) + Considered Problem: - 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 {main#} 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^2))