/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^2)) proof of /export/starexec/sandbox/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, 612 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: length(nil) -> 0 length(cons(x, l)) -> s(length(l)) lt(x, 0) -> false lt(0, s(y)) -> true lt(s(x), s(y)) -> lt(x, y) head(cons(x, l)) -> x head(nil) -> undefined tail(nil) -> nil tail(cons(x, l)) -> l reverse(l) -> rev(0, l, nil, l) rev(x, l, accu, orig) -> if(lt(x, length(orig)), x, l, accu, orig) if(true, x, l, accu, orig) -> rev(s(x), tail(l), cons(head(l), accu), orig) if(false, x, l, accu, orig) -> accu 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: length(nil) -> 0 [1] length(cons(x, l)) -> s(length(l)) [1] lt(x, 0) -> false [1] lt(0, s(y)) -> true [1] lt(s(x), s(y)) -> lt(x, y) [1] head(cons(x, l)) -> x [1] head(nil) -> undefined [1] tail(nil) -> nil [1] tail(cons(x, l)) -> l [1] reverse(l) -> rev(0, l, nil, l) [1] rev(x, l, accu, orig) -> if(lt(x, length(orig)), x, l, accu, orig) [1] if(true, x, l, accu, orig) -> rev(s(x), tail(l), cons(head(l), accu), orig) [1] if(false, x, l, accu, orig) -> accu [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: length(nil) -> 0 [1] length(cons(x, l)) -> s(length(l)) [1] lt(x, 0) -> false [1] lt(0, s(y)) -> true [1] lt(s(x), s(y)) -> lt(x, y) [1] head(cons(x, l)) -> x [1] head(nil) -> undefined [1] tail(nil) -> nil [1] tail(cons(x, l)) -> l [1] reverse(l) -> rev(0, l, nil, l) [1] rev(x, l, accu, orig) -> if(lt(x, length(orig)), x, l, accu, orig) [1] if(true, x, l, accu, orig) -> rev(s(x), tail(l), cons(head(l), accu), orig) [1] if(false, x, l, accu, orig) -> accu [1] The TRS has the following type information: length :: nil:cons -> 0:s nil :: nil:cons 0 :: 0:s cons :: undefined -> nil:cons -> nil:cons s :: 0:s -> 0:s lt :: 0:s -> 0:s -> false:true false :: false:true true :: false:true head :: nil:cons -> undefined undefined :: undefined tail :: nil:cons -> nil:cons reverse :: nil:cons -> nil:cons rev :: 0:s -> nil:cons -> nil:cons -> nil:cons -> nil:cons if :: false:true -> 0:s -> nil:cons -> nil:cons -> 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: none And the following fresh constants: none ---------------------------------------- (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: length(nil) -> 0 [1] length(cons(x, l)) -> s(length(l)) [1] lt(x, 0) -> false [1] lt(0, s(y)) -> true [1] lt(s(x), s(y)) -> lt(x, y) [1] head(cons(x, l)) -> x [1] head(nil) -> undefined [1] tail(nil) -> nil [1] tail(cons(x, l)) -> l [1] reverse(l) -> rev(0, l, nil, l) [1] rev(x, l, accu, orig) -> if(lt(x, length(orig)), x, l, accu, orig) [1] if(true, x, l, accu, orig) -> rev(s(x), tail(l), cons(head(l), accu), orig) [1] if(false, x, l, accu, orig) -> accu [1] The TRS has the following type information: length :: nil:cons -> 0:s nil :: nil:cons 0 :: 0:s cons :: undefined -> nil:cons -> nil:cons s :: 0:s -> 0:s lt :: 0:s -> 0:s -> false:true false :: false:true true :: false:true head :: nil:cons -> undefined undefined :: undefined tail :: nil:cons -> nil:cons reverse :: nil:cons -> nil:cons rev :: 0:s -> nil:cons -> nil:cons -> nil:cons -> nil:cons if :: false:true -> 0:s -> nil:cons -> nil:cons -> nil:cons -> nil:cons 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 0 => 0 false => 0 true => 1 undefined => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: head(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l head(z) -{ 1 }-> 0 :|: z = 0 if(z, z', z'', z1, z2) -{ 1 }-> accu :|: z2 = orig, z' = x, z1 = accu, orig >= 0, x >= 0, l >= 0, z = 0, accu >= 0, z'' = l if(z, z', z'', z1, z2) -{ 1 }-> rev(1 + x, tail(l), 1 + head(l) + accu, orig) :|: z2 = orig, z' = x, z1 = accu, z = 1, orig >= 0, x >= 0, l >= 0, accu >= 0, z'' = l length(z) -{ 1 }-> 0 :|: z = 0 length(z) -{ 1 }-> 1 + length(l) :|: x >= 0, l >= 0, z = 1 + x + l lt(z, z') -{ 1 }-> lt(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x lt(z, z') -{ 1 }-> 1 :|: z' = 1 + y, y >= 0, z = 0 lt(z, z') -{ 1 }-> 0 :|: x >= 0, z = x, z' = 0 rev(z, z', z'', z1) -{ 1 }-> if(lt(x, length(orig)), x, l, accu, orig) :|: z' = l, orig >= 0, x >= 0, l >= 0, z'' = accu, z = x, accu >= 0, z1 = orig reverse(z) -{ 1 }-> rev(0, l, 0, l) :|: z = l, l >= 0 tail(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l tail(z) -{ 1 }-> 0 :|: z = 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(V, V3, V14, V18, V23),0,[length(V, Out)],[V >= 0]). eq(start(V, V3, V14, V18, V23),0,[lt(V, V3, Out)],[V >= 0,V3 >= 0]). eq(start(V, V3, V14, V18, V23),0,[head(V, Out)],[V >= 0]). eq(start(V, V3, V14, V18, V23),0,[tail(V, Out)],[V >= 0]). eq(start(V, V3, V14, V18, V23),0,[reverse(V, Out)],[V >= 0]). eq(start(V, V3, V14, V18, V23),0,[rev(V, V3, V14, V18, Out)],[V >= 0,V3 >= 0,V14 >= 0,V18 >= 0]). eq(start(V, V3, V14, V18, V23),0,[if(V, V3, V14, V18, V23, Out)],[V >= 0,V3 >= 0,V14 >= 0,V18 >= 0,V23 >= 0]). eq(length(V, Out),1,[],[Out = 0,V = 0]). eq(length(V, Out),1,[length(V1, Ret1)],[Out = 1 + Ret1,V2 >= 0,V1 >= 0,V = 1 + V1 + V2]). eq(lt(V, V3, Out),1,[],[Out = 0,V4 >= 0,V = V4,V3 = 0]). eq(lt(V, V3, Out),1,[],[Out = 1,V3 = 1 + V5,V5 >= 0,V = 0]). eq(lt(V, V3, Out),1,[lt(V6, V7, Ret)],[Out = Ret,V3 = 1 + V7,V6 >= 0,V7 >= 0,V = 1 + V6]). eq(head(V, Out),1,[],[Out = V8,V8 >= 0,V9 >= 0,V = 1 + V8 + V9]). eq(head(V, Out),1,[],[Out = 0,V = 0]). eq(tail(V, Out),1,[],[Out = 0,V = 0]). eq(tail(V, Out),1,[],[Out = V11,V10 >= 0,V11 >= 0,V = 1 + V10 + V11]). eq(reverse(V, Out),1,[rev(0, V12, 0, V12, Ret2)],[Out = Ret2,V = V12,V12 >= 0]). eq(rev(V, V3, V14, V18, Out),1,[length(V13, Ret01),lt(V16, Ret01, Ret0),if(Ret0, V16, V17, V15, V13, Ret3)],[Out = Ret3,V3 = V17,V13 >= 0,V16 >= 0,V17 >= 0,V14 = V15,V = V16,V15 >= 0,V18 = V13]). eq(if(V, V3, V14, V18, V23, Out),1,[tail(V19, Ret11),head(V19, Ret201),rev(1 + V22, Ret11, 1 + Ret201 + V20, V21, Ret4)],[Out = Ret4,V23 = V21,V3 = V22,V18 = V20,V = 1,V21 >= 0,V22 >= 0,V19 >= 0,V20 >= 0,V14 = V19]). eq(if(V, V3, V14, V18, V23, Out),1,[],[Out = V24,V23 = V27,V3 = V26,V18 = V24,V27 >= 0,V26 >= 0,V25 >= 0,V = 0,V24 >= 0,V14 = V25]). input_output_vars(length(V,Out),[V],[Out]). input_output_vars(lt(V,V3,Out),[V,V3],[Out]). input_output_vars(head(V,Out),[V],[Out]). input_output_vars(tail(V,Out),[V],[Out]). input_output_vars(reverse(V,Out),[V],[Out]). input_output_vars(rev(V,V3,V14,V18,Out),[V,V3,V14,V18],[Out]). input_output_vars(if(V,V3,V14,V18,V23,Out),[V,V3,V14,V18,V23],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [head/2] 1. recursive : [length/2] 2. recursive : [lt/3] 3. non_recursive : [tail/2] 4. recursive : [if/6,rev/5] 5. non_recursive : [reverse/2] 6. non_recursive : [start/5] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into head/2 1. SCC is partially evaluated into length/2 2. SCC is partially evaluated into lt/3 3. SCC is partially evaluated into tail/2 4. SCC is partially evaluated into rev/5 5. SCC is completely evaluated into other SCCs 6. SCC is partially evaluated into start/5 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations head/2 * CE 11 is refined into CE [20] * CE 12 is refined into CE [21] ### Cost equations --> "Loop" of head/2 * CEs [20] --> Loop 14 * CEs [21] --> Loop 15 ### Ranking functions of CR head(V,Out) #### Partial ranking functions of CR head(V,Out) ### Specialization of cost equations length/2 * CE 16 is refined into CE [22] * CE 15 is refined into CE [23] ### Cost equations --> "Loop" of length/2 * CEs [23] --> Loop 16 * CEs [22] --> Loop 17 ### Ranking functions of CR length(V,Out) * RF of phase [17]: [V] #### Partial ranking functions of CR length(V,Out) * Partial RF of phase [17]: - RF of loop [17:1]: V ### Specialization of cost equations lt/3 * CE 19 is refined into CE [24] * CE 17 is refined into CE [25] * CE 18 is refined into CE [26] ### Cost equations --> "Loop" of lt/3 * CEs [25] --> Loop 18 * CEs [26] --> Loop 19 * CEs [24] --> Loop 20 ### Ranking functions of CR lt(V,V3,Out) * RF of phase [20]: [V,V3] #### Partial ranking functions of CR lt(V,V3,Out) * Partial RF of phase [20]: - RF of loop [20:1]: V V3 ### Specialization of cost equations tail/2 * CE 10 is refined into CE [27] * CE 9 is refined into CE [28] ### Cost equations --> "Loop" of tail/2 * CEs [27] --> Loop 21 * CEs [28] --> Loop 22 ### Ranking functions of CR tail(V,Out) #### Partial ranking functions of CR tail(V,Out) ### Specialization of cost equations rev/5 * CE 14 is refined into CE [29,30,31,32] * CE 13 is refined into CE [33,34] ### Cost equations --> "Loop" of rev/5 * CEs [34] --> Loop 23 * CEs [33] --> Loop 24 * CEs [32] --> Loop 25 * CEs [31] --> Loop 26 * CEs [30] --> Loop 27 * CEs [29] --> Loop 28 ### Ranking functions of CR rev(V,V3,V14,V18,Out) * RF of phase [25]: [-V+V18,V3] * RF of phase [26]: [-V+V18] #### Partial ranking functions of CR rev(V,V3,V14,V18,Out) * Partial RF of phase [25]: - RF of loop [25:1]: -V+V18 V3 * Partial RF of phase [26]: - RF of loop [26:1]: -V+V18 ### Specialization of cost equations start/5 * CE 2 is refined into CE [35,36,37,38,39,40,41] * CE 1 is refined into CE [42] * CE 3 is refined into CE [43,44] * CE 4 is refined into CE [45,46,47,48] * CE 5 is refined into CE [49,50] * CE 6 is refined into CE [51,52] * CE 7 is refined into CE [53,54,55,56] * CE 8 is refined into CE [57,58,59,60,61,62,63,64,65] ### Cost equations --> "Loop" of start/5 * CEs [63] --> Loop 29 * CEs [46,62] --> Loop 30 * CEs [38,40,41] --> Loop 31 * CEs [39] --> Loop 32 * CEs [35,37] --> Loop 33 * CEs [36,44,47,48,50,52,53,54,55,64,65] --> Loop 34 * CEs [42,43,45,49,51,56,57,58,59,60,61] --> Loop 35 ### Ranking functions of CR start(V,V3,V14,V18,V23) #### Partial ranking functions of CR start(V,V3,V14,V18,V23) Computing Bounds ===================================== #### Cost of chains of head(V,Out): * Chain [15]: 1 with precondition: [V=0,Out=0] * Chain [14]: 1 with precondition: [Out>=0,V>=Out+1] #### Cost of chains of length(V,Out): * Chain [[17],16]: 1*it(17)+1 Such that:it(17) =< V with precondition: [Out>=1,V>=Out] * Chain [16]: 1 with precondition: [V=0,Out=0] #### Cost of chains of lt(V,V3,Out): * Chain [[20],19]: 1*it(20)+1 Such that:it(20) =< V with precondition: [Out=1,V>=1,V3>=V+1] * Chain [[20],18]: 1*it(20)+1 Such that:it(20) =< V3 with precondition: [Out=0,V3>=1,V>=V3] * Chain [19]: 1 with precondition: [V=0,Out=1,V3>=1] * Chain [18]: 1 with precondition: [V3=0,Out=0,V>=0] #### Cost of chains of tail(V,Out): * Chain [22]: 1 with precondition: [V=0,Out=0] * Chain [21]: 1 with precondition: [Out>=0,V>=Out+1] #### Cost of chains of rev(V,V3,V14,V18,Out): * Chain [[26],23]: 6*it(26)+2*s(1)+2*s(7)+4 Such that:it(26) =< -V14+Out aux(5) =< V18 s(1) =< aux(5) s(7) =< it(26)*aux(5) with precondition: [V3=0,V>=1,V14>=0,Out>=V14+1,V14+V18>=Out+V] * Chain [[25],[26],23]: 12*it(25)+2*s(1)+4*s(7)+4 Such that:aux(9) =< -V+V18 aux(10) =< V18 it(25) =< aux(9) s(1) =< aux(10) s(7) =< it(25)*aux(10) with precondition: [V>=1,V3>=1,V14>=0,V18>=V+2,Out>=V14+2] * Chain [[25],23]: 6*it(25)+2*s(1)+2*s(13)+4 Such that:it(25) =< -V+V18 aux(11) =< V18 s(1) =< aux(11) s(13) =< it(25)*aux(11) with precondition: [V>=1,V3>=1,V14>=0,V18>=V+1,Out>=V14+1] * Chain [28,[26],23]: 6*it(26)+3*s(1)+2*s(7)+10 Such that:it(26) =< -V14+Out aux(12) =< V18 s(1) =< aux(12) s(7) =< it(26)*aux(12) with precondition: [V=0,V3=0,V14>=0,Out>=V14+2,V14+V18>=Out] * Chain [28,23]: 3*s(1)+10 Such that:aux(13) =< V18 s(1) =< aux(13) with precondition: [V=0,V3=0,Out=V14+1,V18>=1,Out>=1] * Chain [27,[26],23]: 9*it(26)+2*s(7)+10 Such that:aux(14) =< V18 it(26) =< aux(14) s(7) =< it(26)*aux(14) with precondition: [V=0,V3>=1,V14>=0,V18>=2,Out>=V14+2,V3+V14+V18>=Out+1] * Chain [27,[25],[26],23]: 15*it(25)+4*s(7)+10 Such that:aux(15) =< V18 it(25) =< aux(15) s(7) =< it(25)*aux(15) with precondition: [V=0,V3>=2,V14>=0,V18>=3,Out>=V14+3] * Chain [27,[25],23]: 9*it(25)+2*s(13)+10 Such that:aux(16) =< V18 it(25) =< aux(16) s(13) =< it(25)*aux(16) with precondition: [V=0,V3>=2,V14>=0,V18>=2,Out>=V14+2] * Chain [27,23]: 3*s(1)+10 Such that:aux(17) =< V18 s(1) =< aux(17) with precondition: [V=0,V14>=0,V18>=1,Out>=V14+1,V3+V14>=Out] * Chain [24]: 4 with precondition: [V18=0,V14=Out,V>=0,V3>=0,V14>=0] * Chain [23]: 2*s(1)+4 Such that:aux(1) =< V18 s(1) =< aux(1) with precondition: [V14=Out,V>=1,V3>=0,V14>=0,V18>=1] #### Cost of chains of start(V,V3,V14,V18,V23): * Chain [35]: 48*s(33)+10*s(37)+10 Such that:aux(22) =< V18 s(33) =< aux(22) s(37) =< s(33)*aux(22) with precondition: [V=0] * Chain [34]: 38*s(46)+1*s(47)+8*s(51)+6*s(58)+18*s(61)+6*s(63)+11 Such that:s(59) =< -V+V18 s(47) =< V3 aux(23) =< V aux(24) =< V18 s(46) =< aux(23) s(61) =< s(59) s(58) =< aux(24) s(63) =< s(61)*aux(24) s(51) =< s(46)*aux(23) with precondition: [V>=1] * Chain [33]: 6*s(64)+4*s(66)+2*s(67)+7 Such that:s(64) =< -V3+V23 aux(25) =< V23 s(66) =< aux(25) s(67) =< s(64)*aux(25) with precondition: [V=1,V14=0,V3>=0,V18>=0,V23>=1] * Chain [32]: 7 with precondition: [V=1,V23=0,V3>=0,V14>=1,V18>=0] * Chain [31]: 24*s(70)+8*s(72)+8*s(73)+7 Such that:aux(26) =< -V3+V23 aux(27) =< V23 s(70) =< aux(26) s(72) =< aux(27) s(73) =< s(70)*aux(27) with precondition: [V=1,V3>=0,V14>=1,V18>=0,V23>=1] * Chain [30]: 6*s(81)+2*s(83)+2*s(84)+4 Such that:s(81) =< -V+V18 s(82) =< V18 s(83) =< s(82) s(84) =< s(81)*s(82) with precondition: [V3=0,V>=0] * Chain [29]: 4 with precondition: [V18=0,V>=0,V3>=0,V14>=0] Closed-form bounds of start(V,V3,V14,V18,V23): ------------------------------------- * Chain [35] with precondition: [V=0] - Upper bound: nat(V18)*48+10+nat(V18)*10*nat(V18) - Complexity: n^2 * Chain [34] with precondition: [V>=1] - Upper bound: 38*V+11+8*V*V+nat(V3)+nat(V18)*6+nat(V18)*6*nat(-V+V18)+nat(-V+V18)*18 - Complexity: n^2 * Chain [33] with precondition: [V=1,V14=0,V3>=0,V18>=0,V23>=1] - Upper bound: 4*V23+7+2*V23*nat(-V3+V23)+nat(-V3+V23)*6 - Complexity: n^2 * Chain [32] with precondition: [V=1,V23=0,V3>=0,V14>=1,V18>=0] - Upper bound: 7 - Complexity: constant * Chain [31] with precondition: [V=1,V3>=0,V14>=1,V18>=0,V23>=1] - Upper bound: 8*V23+7+8*V23*nat(-V3+V23)+nat(-V3+V23)*24 - Complexity: n^2 * Chain [30] with precondition: [V3=0,V>=0] - Upper bound: nat(V18)*2+4+nat(V18)*2*nat(-V+V18)+nat(-V+V18)*6 - Complexity: n^2 * Chain [29] with precondition: [V18=0,V>=0,V3>=0,V14>=0] - Upper bound: 4 - Complexity: constant ### Maximum cost of start(V,V3,V14,V18,V23): max([nat(V18)*2+max([nat(V18)*2*nat(-V+V18)+nat(-V+V18)*6,nat(V18)*4+6+max([nat(V18)*10*nat(V18)+nat(V18)*42,38*V+1+8*V*V+nat(V3)+nat(V18)*6*nat(-V+V18)+nat(-V+V18)*18])]),nat(V23)*6*nat(-V3+V23)+nat(V23)*4+nat(-V3+V23)*18+(nat(V23)*2*nat(-V3+V23)+nat(V23)*4+nat(-V3+V23)*6)+3])+4 Asymptotic class: n^2 * Total analysis performed in 511 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: length(nil) -> 0 length(cons(x, l)) -> s(length(l)) lt(x, 0) -> false lt(0, s(y)) -> true lt(s(x), s(y)) -> lt(x, y) head(cons(x, l)) -> x head(nil) -> undefined tail(nil) -> nil tail(cons(x, l)) -> l reverse(l) -> rev(0, l, nil, l) rev(x, l, accu, orig) -> if(lt(x, length(orig)), x, l, accu, orig) if(true, x, l, accu, orig) -> rev(s(x), tail(l), cons(head(l), accu), orig) if(false, x, l, accu, orig) -> accu 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 lt(s(x), s(y)) ->^+ lt(x, y) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [x / s(x), y / s(y)]. 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: length(nil) -> 0 length(cons(x, l)) -> s(length(l)) lt(x, 0) -> false lt(0, s(y)) -> true lt(s(x), s(y)) -> lt(x, y) head(cons(x, l)) -> x head(nil) -> undefined tail(nil) -> nil tail(cons(x, l)) -> l reverse(l) -> rev(0, l, nil, l) rev(x, l, accu, orig) -> if(lt(x, length(orig)), x, l, accu, orig) if(true, x, l, accu, orig) -> rev(s(x), tail(l), cons(head(l), accu), orig) if(false, x, l, accu, orig) -> accu 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: length(nil) -> 0 length(cons(x, l)) -> s(length(l)) lt(x, 0) -> false lt(0, s(y)) -> true lt(s(x), s(y)) -> lt(x, y) head(cons(x, l)) -> x head(nil) -> undefined tail(nil) -> nil tail(cons(x, l)) -> l reverse(l) -> rev(0, l, nil, l) rev(x, l, accu, orig) -> if(lt(x, length(orig)), x, l, accu, orig) if(true, x, l, accu, orig) -> rev(s(x), tail(l), cons(head(l), accu), orig) if(false, x, l, accu, orig) -> accu S is empty. Rewrite Strategy: INNERMOST