/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^2)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). (0) CpxTRS (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxWeightedTrs (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 501 ms] (10) BOUNDS(1, n^2) (11) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (12) TRS for Loop Detection (13) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (14) BEST (15) proven lower bound (16) LowerBoundPropagationProof [FINISHED, 0 ms] (17) BOUNDS(n^1, INF) (18) TRS for Loop Detection ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: fold#3(insert_ord(x2), Nil) -> Nil fold#3(insert_ord(x6), Cons(x4, x2)) -> insert_ord#2(x6, x4, fold#3(insert_ord(x6), x2)) cond_insert_ord_x_ys_1(True, x3, x2, x1) -> Cons(x3, Cons(x2, x1)) cond_insert_ord_x_ys_1(False, x0, x5, x2) -> Cons(x5, insert_ord#2(leq, x0, x2)) insert_ord#2(leq, x2, Nil) -> Cons(x2, Nil) insert_ord#2(leq, 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(x3) -> fold#3(insert_ord(leq), x3) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: fold#3(insert_ord(x2), Nil) -> Nil [1] fold#3(insert_ord(x6), Cons(x4, x2)) -> insert_ord#2(x6, x4, fold#3(insert_ord(x6), x2)) [1] cond_insert_ord_x_ys_1(True, x3, x2, x1) -> Cons(x3, Cons(x2, x1)) [1] cond_insert_ord_x_ys_1(False, x0, x5, x2) -> Cons(x5, insert_ord#2(leq, x0, x2)) [1] insert_ord#2(leq, x2, Nil) -> Cons(x2, Nil) [1] insert_ord#2(leq, x6, Cons(x4, x2)) -> cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2) [1] leq#2(0, x8) -> True [1] leq#2(S(x12), 0) -> False [1] leq#2(S(x4), S(x2)) -> leq#2(x4, x2) [1] main(x3) -> fold#3(insert_ord(leq), x3) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (4) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: fold#3(insert_ord(x2), Nil) -> Nil [1] fold#3(insert_ord(x6), Cons(x4, x2)) -> insert_ord#2(x6, x4, fold#3(insert_ord(x6), x2)) [1] cond_insert_ord_x_ys_1(True, x3, x2, x1) -> Cons(x3, Cons(x2, x1)) [1] cond_insert_ord_x_ys_1(False, x0, x5, x2) -> Cons(x5, insert_ord#2(leq, x0, x2)) [1] insert_ord#2(leq, x2, Nil) -> Cons(x2, Nil) [1] insert_ord#2(leq, x6, Cons(x4, x2)) -> cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2) [1] leq#2(0, x8) -> True [1] leq#2(S(x12), 0) -> False [1] leq#2(S(x4), S(x2)) -> leq#2(x4, x2) [1] main(x3) -> fold#3(insert_ord(leq), x3) [1] The TRS has the following type information: fold#3 :: insert_ord -> Nil:Cons -> Nil:Cons insert_ord :: leq -> insert_ord Nil :: Nil:Cons Cons :: 0:S -> Nil:Cons -> Nil:Cons insert_ord#2 :: leq -> 0:S -> Nil:Cons -> Nil:Cons cond_insert_ord_x_ys_1 :: True:False -> 0:S -> 0:S -> Nil:Cons -> Nil:Cons True :: True:False False :: True:False leq :: leq leq#2 :: 0:S -> 0:S -> True:False 0 :: 0:S S :: 0:S -> 0:S main :: Nil:Cons -> Nil:Cons Rewrite Strategy: INNERMOST ---------------------------------------- (5) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: fold#3(v0, v1) -> null_fold#3 [0] insert_ord#2(v0, v1, v2) -> null_insert_ord#2 [0] And the following fresh constants: null_fold#3, null_insert_ord#2, const ---------------------------------------- (6) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: fold#3(insert_ord(x2), Nil) -> Nil [1] fold#3(insert_ord(x6), Cons(x4, x2)) -> insert_ord#2(x6, x4, fold#3(insert_ord(x6), x2)) [1] cond_insert_ord_x_ys_1(True, x3, x2, x1) -> Cons(x3, Cons(x2, x1)) [1] cond_insert_ord_x_ys_1(False, x0, x5, x2) -> Cons(x5, insert_ord#2(leq, x0, x2)) [1] insert_ord#2(leq, x2, Nil) -> Cons(x2, Nil) [1] insert_ord#2(leq, x6, Cons(x4, x2)) -> cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2) [1] leq#2(0, x8) -> True [1] leq#2(S(x12), 0) -> False [1] leq#2(S(x4), S(x2)) -> leq#2(x4, x2) [1] main(x3) -> fold#3(insert_ord(leq), x3) [1] fold#3(v0, v1) -> null_fold#3 [0] insert_ord#2(v0, v1, v2) -> null_insert_ord#2 [0] The TRS has the following type information: fold#3 :: insert_ord -> Nil:Cons:null_fold#3:null_insert_ord#2 -> Nil:Cons:null_fold#3:null_insert_ord#2 insert_ord :: leq -> insert_ord Nil :: Nil:Cons:null_fold#3:null_insert_ord#2 Cons :: 0:S -> Nil:Cons:null_fold#3:null_insert_ord#2 -> Nil:Cons:null_fold#3:null_insert_ord#2 insert_ord#2 :: leq -> 0:S -> Nil:Cons:null_fold#3:null_insert_ord#2 -> Nil:Cons:null_fold#3:null_insert_ord#2 cond_insert_ord_x_ys_1 :: True:False -> 0:S -> 0:S -> Nil:Cons:null_fold#3:null_insert_ord#2 -> Nil:Cons:null_fold#3:null_insert_ord#2 True :: True:False False :: True:False leq :: leq leq#2 :: 0:S -> 0:S -> True:False 0 :: 0:S S :: 0:S -> 0:S main :: Nil:Cons:null_fold#3:null_insert_ord#2 -> Nil:Cons:null_fold#3:null_insert_ord#2 null_fold#3 :: Nil:Cons:null_fold#3:null_insert_ord#2 null_insert_ord#2 :: Nil:Cons:null_fold#3:null_insert_ord#2 const :: insert_ord Rewrite Strategy: INNERMOST ---------------------------------------- (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: Nil => 0 True => 1 False => 0 leq => 0 0 => 0 null_fold#3 => 0 null_insert_ord#2 => 0 const => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: cond_insert_ord_x_ys_1(z, z', z'', z1) -{ 1 }-> 1 + x3 + (1 + x2 + x1) :|: x1 >= 0, z = 1, z' = x3, z1 = x1, z'' = x2, x3 >= 0, x2 >= 0 cond_insert_ord_x_ys_1(z, z', z'', z1) -{ 1 }-> 1 + x5 + insert_ord#2(0, x0, x2) :|: x0 >= 0, x5 >= 0, z1 = x2, z'' = x5, z = 0, x2 >= 0, z' = x0 fold#3(z, z') -{ 1 }-> insert_ord#2(x6, x4, fold#3(1 + x6, x2)) :|: x4 >= 0, z = 1 + x6, z' = 1 + x4 + x2, x6 >= 0, x2 >= 0 fold#3(z, z') -{ 1 }-> 0 :|: z = 1 + x2, x2 >= 0, z' = 0 fold#3(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 insert_ord#2(z, z', z'') -{ 1 }-> cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2) :|: z' = x6, x4 >= 0, z'' = 1 + x4 + x2, x6 >= 0, z = 0, x2 >= 0 insert_ord#2(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 insert_ord#2(z, z', z'') -{ 1 }-> 1 + x2 + 0 :|: z'' = 0, z' = x2, z = 0, x2 >= 0 leq#2(z, z') -{ 1 }-> leq#2(x4, x2) :|: x4 >= 0, z' = 1 + x2, z = 1 + x4, x2 >= 0 leq#2(z, z') -{ 1 }-> 1 :|: x8 >= 0, z = 0, z' = x8 leq#2(z, z') -{ 1 }-> 0 :|: z = 1 + x12, x12 >= 0, z' = 0 main(z) -{ 1 }-> fold#3(1 + 0, x3) :|: z = x3, x3 >= 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (9) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V, V6, V10),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6, V10),0,[fun2(V1, V, V6, V10, Out)],[V1 >= 0,V >= 0,V6 >= 0,V10 >= 0]). eq(start(V1, V, V6, V10),0,[fun1(V1, V, V6, Out)],[V1 >= 0,V >= 0,V6 >= 0]). eq(start(V1, V, V6, V10),0,[fun3(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V6, V10),0,[main(V1, Out)],[V1 >= 0]). eq(fun(V1, V, Out),1,[],[Out = 0,V1 = 1 + V2,V2 >= 0,V = 0]). eq(fun(V1, V, Out),1,[fun(1 + V4, V3, Ret2),fun1(V4, V5, Ret2, Ret)],[Out = Ret,V5 >= 0,V1 = 1 + V4,V = 1 + V3 + V5,V4 >= 0,V3 >= 0]). eq(fun2(V1, V, V6, V10, Out),1,[],[Out = 2 + V7 + V8 + V9,V8 >= 0,V1 = 1,V = V7,V10 = V8,V6 = V9,V7 >= 0,V9 >= 0]). eq(fun2(V1, V, V6, V10, Out),1,[fun1(0, V12, V11, Ret1)],[Out = 1 + Ret1 + V13,V12 >= 0,V13 >= 0,V10 = V11,V6 = V13,V1 = 0,V11 >= 0,V = V12]). eq(fun1(V1, V, V6, Out),1,[],[Out = 1 + V14,V6 = 0,V = V14,V1 = 0,V14 >= 0]). eq(fun1(V1, V, V6, Out),1,[fun3(V17, V16, Ret0),fun2(Ret0, V17, V16, V15, Ret3)],[Out = Ret3,V = V17,V16 >= 0,V6 = 1 + V15 + V16,V17 >= 0,V1 = 0,V15 >= 0]). eq(fun3(V1, V, Out),1,[],[Out = 1,V18 >= 0,V1 = 0,V = V18]). eq(fun3(V1, V, Out),1,[],[Out = 0,V1 = 1 + V19,V19 >= 0,V = 0]). eq(fun3(V1, V, Out),1,[fun3(V21, V20, Ret4)],[Out = Ret4,V21 >= 0,V = 1 + V20,V1 = 1 + V21,V20 >= 0]). eq(main(V1, Out),1,[fun(1 + 0, V22, Ret5)],[Out = Ret5,V1 = V22,V22 >= 0]). eq(fun(V1, V, Out),0,[],[Out = 0,V24 >= 0,V23 >= 0,V1 = V24,V = V23]). eq(fun1(V1, V, V6, Out),0,[],[Out = 0,V26 >= 0,V6 = V27,V25 >= 0,V1 = V26,V = V25,V27 >= 0]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun2(V1,V,V6,V10,Out),[V1,V,V6,V10],[Out]). input_output_vars(fun1(V1,V,V6,Out),[V1,V,V6],[Out]). input_output_vars(fun3(V1,V,Out),[V1,V],[Out]). input_output_vars(main(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun3/3] 1. recursive : [fun1/4,fun2/5] 2. recursive [non_tail] : [fun/3] 3. non_recursive : [main/2] 4. non_recursive : [start/4] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun3/3 1. SCC is partially evaluated into fun1/4 2. SCC is partially evaluated into fun/3 3. SCC is completely evaluated into other SCCs 4. SCC is partially evaluated into start/4 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun3/3 * CE 16 is refined into CE [17] * CE 15 is refined into CE [18] * CE 14 is refined into CE [19] ### Cost equations --> "Loop" of fun3/3 * CEs [18] --> Loop 12 * CEs [19] --> Loop 13 * CEs [17] --> Loop 14 ### Ranking functions of CR fun3(V1,V,Out) * RF of phase [14]: [V,V1] #### Partial ranking functions of CR fun3(V1,V,Out) * Partial RF of phase [14]: - RF of loop [14:1]: V V1 ### Specialization of cost equations fun1/4 * CE 10 is refined into CE [20] * CE 8 is refined into CE [21,22] * CE 9 is refined into CE [23] * CE 7 is refined into CE [24,25] ### Cost equations --> "Loop" of fun1/4 * CEs [25] --> Loop 15 * CEs [24] --> Loop 16 * CEs [20] --> Loop 17 * CEs [22] --> Loop 18 * CEs [23] --> Loop 19 * CEs [21] --> Loop 20 ### Ranking functions of CR fun1(V1,V,V6,Out) * RF of phase [15,16]: [V6] #### Partial ranking functions of CR fun1(V1,V,V6,Out) * Partial RF of phase [15,16]: - RF of loop [15:1]: V6-1 - RF of loop [16:1]: V6 ### Specialization of cost equations fun/3 * CE 11 is refined into CE [26] * CE 13 is refined into CE [27] * CE 12 is refined into CE [28,29,30,31,32] ### Cost equations --> "Loop" of fun/3 * CEs [32] --> Loop 21 * CEs [31] --> Loop 22 * CEs [30] --> Loop 23 * CEs [28] --> Loop 24 * CEs [29] --> Loop 25 * CEs [26,27] --> Loop 26 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [21,22,23,24,25]: [V] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [21,22,23,24,25]: - RF of loop [21:1,24:1,25:1]: V - RF of loop [22:1,23:1]: V/2-1/2 ### Specialization of cost equations start/4 * CE 2 is refined into CE [33] * CE 1 is refined into CE [34,35,36,37,38] * CE 3 is refined into CE [39,40] * CE 4 is refined into CE [41,42,43,44,45] * CE 5 is refined into CE [46,47,48,49] * CE 6 is refined into CE [50,51] ### Cost equations --> "Loop" of start/4 * CEs [47] --> Loop 27 * CEs [33] --> Loop 28 * CEs [35] --> Loop 29 * CEs [42] --> Loop 30 * CEs [41] --> Loop 31 * CEs [34,36,37,38,39,40,43,44,45,46,48,49,50,51] --> Loop 32 ### Ranking functions of CR start(V1,V,V6,V10) #### Partial ranking functions of CR start(V1,V,V6,V10) Computing Bounds ===================================== #### Cost of chains of fun3(V1,V,Out): * Chain [[14],13]: 1*it(14)+1 Such that:it(14) =< V1 with precondition: [Out=1,V1>=1,V>=V1] * Chain [[14],12]: 1*it(14)+1 Such that:it(14) =< V with precondition: [Out=0,V>=1,V1>=V+1] * Chain [13]: 1 with precondition: [V1=0,Out=1,V>=0] * Chain [12]: 1 with precondition: [V=0,Out=0,V1>=1] #### Cost of chains of fun1(V1,V,V6,Out): * Chain [[15,16],19]: 7*it(15)+1 Such that:aux(3) =< -V+Out it(15) =< aux(3) with precondition: [V1=0,V+V6+1=Out,V>=1,V6>=1] * Chain [[15,16],18]: 7*it(15)+1*s(4)+3 Such that:s(4) =< -V6+Out aux(1) =< V6 aux(2) =< 2*V6-Out it(15) =< aux(1) it(15) =< aux(2) with precondition: [V1=0,V+V6+1=Out,V>=1,V6>=V+2] * Chain [[15,16],17]: 7*it(15)+0 Such that:aux(1) =< V6 aux(2) =< Out it(15) =< aux(1) it(15) =< aux(2) with precondition: [V1=0,V>=1,Out>=1,V6>=Out] * Chain [20]: 3 with precondition: [V1=0,V=0,V6+1=Out,V6>=1] * Chain [19]: 1 with precondition: [V1=0,V6=0,V+1=Out,V>=0] * Chain [18]: 1*s(4)+3 Such that:s(4) =< V with precondition: [V1=0,V+V6+1=Out,V>=1,V6>=V+1] * Chain [17]: 0 with precondition: [Out=0,V1>=0,V>=0,V6>=0] #### Cost of chains of fun(V1,V,Out): * Chain [[21,22,23,24,25],26]: 9*it(21)+5*it(22)+7*s(31)+7*s(34)+7*s(35)+1 Such that:aux(14) =< V aux(15) =< V/2 it(21) =< aux(14) it(22) =< aux(14) it(22) =< aux(15) aux(9) =< aux(14)+1 aux(8) =< aux(14) aux(7) =< aux(14)-2 s(32) =< it(22)*aux(14) s(38) =< it(22)*aux(9) s(37) =< it(22)*aux(8) s(36) =< it(22)*aux(7) s(34) =< s(38) s(35) =< s(37) s(35) =< s(36) s(31) =< s(32) with precondition: [V1>=1,V>=1,Out>=0,V>=Out] * Chain [26]: 1 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of start(V1,V,V6,V10): * Chain [32]: 12*s(41)+2*s(42)+7*s(45)+7*s(46)+7*s(49)+5*s(53)+7*s(61)+7*s(62)+7*s(63)+7*s(69)+7*s(70)+7*s(73)+10*s(75)+5*s(79)+7*s(87)+7*s(88)+7*s(89)+4 Such that:s(77) =< V1/2 s(68) =< -V+V6 s(44) =< -V+V10 s(51) =< V/2 s(64) =< V6+1 s(40) =< V10+1 aux(18) =< V1 aux(19) =< V aux(20) =< V+1 aux(21) =< V6 aux(22) =< V10 s(75) =< aux(18) s(41) =< aux(19) s(42) =< aux(20) s(79) =< aux(18) s(79) =< s(77) s(80) =< aux(18)+1 s(81) =< aux(18) s(82) =< aux(18)-2 s(83) =< s(79)*aux(18) s(84) =< s(79)*s(80) s(85) =< s(79)*s(81) s(86) =< s(79)*s(82) s(87) =< s(84) s(88) =< s(85) s(88) =< s(86) s(89) =< s(83) s(69) =< s(64) s(70) =< aux(21) s(70) =< s(68) s(45) =< s(40) s(46) =< aux(22) s(46) =< s(44) s(53) =< aux(19) s(53) =< s(51) s(54) =< aux(19)+1 s(55) =< aux(19) s(56) =< aux(19)-2 s(57) =< s(53)*aux(19) s(58) =< s(53)*s(54) s(59) =< s(53)*s(55) s(60) =< s(53)*s(56) s(61) =< s(58) s(62) =< s(59) s(62) =< s(60) s(63) =< s(57) s(73) =< aux(21) s(49) =< aux(22) with precondition: [V1>=0] * Chain [31]: 3 with precondition: [V1=0,V=0,V6>=1] * Chain [30]: 1 with precondition: [V1=0,V6=0,V>=0] * Chain [29]: 2 with precondition: [V1=0,V10=0,V>=0,V6>=0] * Chain [28]: 1 with precondition: [V1=1,V>=0,V6>=0,V10>=0] * Chain [27]: 1 with precondition: [V=0,V1>=1] Closed-form bounds of start(V1,V,V6,V10): ------------------------------------- * Chain [32] with precondition: [V1>=0] - Upper bound: 22*V1+4+21*V1*V1+nat(V)*24+nat(V)*21*nat(V)+nat(V6)*14+nat(V10)*14+nat(V+1)*2+nat(V6+1)*7+nat(V10+1)*7 - Complexity: n^2 * Chain [31] with precondition: [V1=0,V=0,V6>=1] - Upper bound: 3 - Complexity: constant * Chain [30] with precondition: [V1=0,V6=0,V>=0] - Upper bound: 1 - Complexity: constant * Chain [29] with precondition: [V1=0,V10=0,V>=0,V6>=0] - Upper bound: 2 - Complexity: constant * Chain [28] with precondition: [V1=1,V>=0,V6>=0,V10>=0] - Upper bound: 1 - Complexity: constant * Chain [27] with precondition: [V=0,V1>=1] - Upper bound: 1 - Complexity: constant ### Maximum cost of start(V1,V,V6,V10): max([2,22*V1+3+21*V1*V1+nat(V)*24+nat(V)*21*nat(V)+nat(V6)*14+nat(V10)*14+nat(V+1)*2+nat(V6+1)*7+nat(V10+1)*7])+1 Asymptotic class: n^2 * Total analysis performed in 401 ms. ---------------------------------------- (10) BOUNDS(1, n^2) ---------------------------------------- (11) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (12) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: fold#3(insert_ord(x2), Nil) -> Nil fold#3(insert_ord(x6), Cons(x4, x2)) -> insert_ord#2(x6, x4, fold#3(insert_ord(x6), x2)) cond_insert_ord_x_ys_1(True, x3, x2, x1) -> Cons(x3, Cons(x2, x1)) cond_insert_ord_x_ys_1(False, x0, x5, x2) -> Cons(x5, insert_ord#2(leq, x0, x2)) insert_ord#2(leq, x2, Nil) -> Cons(x2, Nil) insert_ord#2(leq, 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(x3) -> fold#3(insert_ord(leq), x3) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence leq#2(S(x4), S(x2)) ->^+ leq#2(x4, x2) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [x4 / S(x4), x2 / S(x2)]. The result substitution is [ ]. ---------------------------------------- (14) Complex Obligation (BEST) ---------------------------------------- (15) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: fold#3(insert_ord(x2), Nil) -> Nil fold#3(insert_ord(x6), Cons(x4, x2)) -> insert_ord#2(x6, x4, fold#3(insert_ord(x6), x2)) cond_insert_ord_x_ys_1(True, x3, x2, x1) -> Cons(x3, Cons(x2, x1)) cond_insert_ord_x_ys_1(False, x0, x5, x2) -> Cons(x5, insert_ord#2(leq, x0, x2)) insert_ord#2(leq, x2, Nil) -> Cons(x2, Nil) insert_ord#2(leq, 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(x3) -> fold#3(insert_ord(leq), x3) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (16) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (17) BOUNDS(n^1, INF) ---------------------------------------- (18) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: fold#3(insert_ord(x2), Nil) -> Nil fold#3(insert_ord(x6), Cons(x4, x2)) -> insert_ord#2(x6, x4, fold#3(insert_ord(x6), x2)) cond_insert_ord_x_ys_1(True, x3, x2, x1) -> Cons(x3, Cons(x2, x1)) cond_insert_ord_x_ys_1(False, x0, x5, x2) -> Cons(x5, insert_ord#2(leq, x0, x2)) insert_ord#2(leq, x2, Nil) -> Cons(x2, Nil) insert_ord#2(leq, 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(x3) -> fold#3(insert_ord(leq), x3) S is empty. Rewrite Strategy: INNERMOST