1130.85/291.50 WORST_CASE(Omega(n^1), O(n^2)) 1130.85/291.51 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 1130.85/291.51 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 1130.85/291.51 1130.85/291.51 1130.85/291.51 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1130.85/291.51 1130.85/291.51 (0) CpxTRS 1130.85/291.51 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 1130.85/291.51 (2) CpxWeightedTrs 1130.85/291.51 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 1130.85/291.51 (4) CpxTypedWeightedTrs 1130.85/291.51 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 1130.85/291.51 (6) CpxTypedWeightedCompleteTrs 1130.85/291.51 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 1130.85/291.51 (8) CpxRNTS 1130.85/291.51 (9) CompleteCoflocoProof [FINISHED, 370 ms] 1130.85/291.51 (10) BOUNDS(1, n^2) 1130.85/291.51 (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] 1130.85/291.51 (12) CpxTRS 1130.85/291.51 (13) SlicingProof [LOWER BOUND(ID), 0 ms] 1130.85/291.51 (14) CpxTRS 1130.85/291.51 (15) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 1130.85/291.51 (16) typed CpxTrs 1130.85/291.51 (17) OrderProof [LOWER BOUND(ID), 0 ms] 1130.85/291.51 (18) typed CpxTrs 1130.85/291.51 (19) RewriteLemmaProof [LOWER BOUND(ID), 280 ms] 1130.85/291.51 (20) BEST 1130.85/291.51 (21) proven lower bound 1130.85/291.51 (22) LowerBoundPropagationProof [FINISHED, 0 ms] 1130.85/291.51 (23) BOUNDS(n^1, INF) 1130.85/291.51 (24) typed CpxTrs 1130.85/291.51 (25) RewriteLemmaProof [LOWER BOUND(ID), 48 ms] 1130.85/291.51 (26) typed CpxTrs 1130.85/291.51 1130.85/291.51 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (0) 1130.85/291.51 Obligation: 1130.85/291.51 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1130.85/291.51 1130.85/291.51 1130.85/291.51 The TRS R consists of the following rules: 1130.85/291.51 1130.85/291.51 nthtail(n, l) -> cond(ge(n, length(l)), n, l) 1130.85/291.51 cond(true, n, l) -> l 1130.85/291.51 cond(false, n, l) -> tail(nthtail(s(n), l)) 1130.85/291.51 tail(nil) -> nil 1130.85/291.51 tail(cons(x, l)) -> l 1130.85/291.51 length(nil) -> 0 1130.85/291.51 length(cons(x, l)) -> s(length(l)) 1130.85/291.51 ge(u, 0) -> true 1130.85/291.51 ge(0, s(v)) -> false 1130.85/291.51 ge(s(u), s(v)) -> ge(u, v) 1130.85/291.51 1130.85/291.51 S is empty. 1130.85/291.51 Rewrite Strategy: INNERMOST 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 1130.85/291.51 Transformed relative TRS to weighted TRS 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (2) 1130.85/291.51 Obligation: 1130.85/291.51 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). 1130.85/291.51 1130.85/291.51 1130.85/291.51 The TRS R consists of the following rules: 1130.85/291.51 1130.85/291.51 nthtail(n, l) -> cond(ge(n, length(l)), n, l) [1] 1130.85/291.51 cond(true, n, l) -> l [1] 1130.85/291.51 cond(false, n, l) -> tail(nthtail(s(n), l)) [1] 1130.85/291.51 tail(nil) -> nil [1] 1130.85/291.51 tail(cons(x, l)) -> l [1] 1130.85/291.51 length(nil) -> 0 [1] 1130.85/291.51 length(cons(x, l)) -> s(length(l)) [1] 1130.85/291.51 ge(u, 0) -> true [1] 1130.85/291.51 ge(0, s(v)) -> false [1] 1130.85/291.51 ge(s(u), s(v)) -> ge(u, v) [1] 1130.85/291.51 1130.85/291.51 Rewrite Strategy: INNERMOST 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 1130.85/291.51 Infered types. 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (4) 1130.85/291.51 Obligation: 1130.85/291.51 Runtime Complexity Weighted TRS with Types. 1130.85/291.51 The TRS R consists of the following rules: 1130.85/291.51 1130.85/291.51 nthtail(n, l) -> cond(ge(n, length(l)), n, l) [1] 1130.85/291.51 cond(true, n, l) -> l [1] 1130.85/291.51 cond(false, n, l) -> tail(nthtail(s(n), l)) [1] 1130.85/291.51 tail(nil) -> nil [1] 1130.85/291.51 tail(cons(x, l)) -> l [1] 1130.85/291.51 length(nil) -> 0 [1] 1130.85/291.51 length(cons(x, l)) -> s(length(l)) [1] 1130.85/291.51 ge(u, 0) -> true [1] 1130.85/291.51 ge(0, s(v)) -> false [1] 1130.85/291.51 ge(s(u), s(v)) -> ge(u, v) [1] 1130.85/291.51 1130.85/291.51 The TRS has the following type information: 1130.85/291.51 nthtail :: s:0 -> nil:cons -> nil:cons 1130.85/291.51 cond :: true:false -> s:0 -> nil:cons -> nil:cons 1130.85/291.51 ge :: s:0 -> s:0 -> true:false 1130.85/291.51 length :: nil:cons -> s:0 1130.85/291.51 true :: true:false 1130.85/291.51 false :: true:false 1130.85/291.51 tail :: nil:cons -> nil:cons 1130.85/291.51 s :: s:0 -> s:0 1130.85/291.51 nil :: nil:cons 1130.85/291.51 cons :: a -> nil:cons -> nil:cons 1130.85/291.51 0 :: s:0 1130.85/291.51 1130.85/291.51 Rewrite Strategy: INNERMOST 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (5) CompletionProof (UPPER BOUND(ID)) 1130.85/291.51 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 1130.85/291.51 none 1130.85/291.51 1130.85/291.51 And the following fresh constants: const 1130.85/291.51 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (6) 1130.85/291.51 Obligation: 1130.85/291.51 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 1130.85/291.51 1130.85/291.51 Runtime Complexity Weighted TRS with Types. 1130.85/291.51 The TRS R consists of the following rules: 1130.85/291.51 1130.85/291.51 nthtail(n, l) -> cond(ge(n, length(l)), n, l) [1] 1130.85/291.51 cond(true, n, l) -> l [1] 1130.85/291.51 cond(false, n, l) -> tail(nthtail(s(n), l)) [1] 1130.85/291.51 tail(nil) -> nil [1] 1130.85/291.51 tail(cons(x, l)) -> l [1] 1130.85/291.51 length(nil) -> 0 [1] 1130.85/291.51 length(cons(x, l)) -> s(length(l)) [1] 1130.85/291.51 ge(u, 0) -> true [1] 1130.85/291.51 ge(0, s(v)) -> false [1] 1130.85/291.51 ge(s(u), s(v)) -> ge(u, v) [1] 1130.85/291.51 1130.85/291.51 The TRS has the following type information: 1130.85/291.51 nthtail :: s:0 -> nil:cons -> nil:cons 1130.85/291.51 cond :: true:false -> s:0 -> nil:cons -> nil:cons 1130.85/291.51 ge :: s:0 -> s:0 -> true:false 1130.85/291.51 length :: nil:cons -> s:0 1130.85/291.51 true :: true:false 1130.85/291.51 false :: true:false 1130.85/291.51 tail :: nil:cons -> nil:cons 1130.85/291.51 s :: s:0 -> s:0 1130.85/291.51 nil :: nil:cons 1130.85/291.51 cons :: a -> nil:cons -> nil:cons 1130.85/291.51 0 :: s:0 1130.85/291.51 const :: a 1130.85/291.51 1130.85/291.51 Rewrite Strategy: INNERMOST 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 1130.85/291.51 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 1130.85/291.51 The constant constructors are abstracted as follows: 1130.85/291.51 1130.85/291.51 true => 1 1130.85/291.51 false => 0 1130.85/291.51 nil => 0 1130.85/291.51 0 => 0 1130.85/291.51 const => 0 1130.85/291.51 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (8) 1130.85/291.51 Obligation: 1130.85/291.51 Complexity RNTS consisting of the following rules: 1130.85/291.51 1130.85/291.51 cond(z, z', z'') -{ 1 }-> l :|: n >= 0, z = 1, z' = n, l >= 0, z'' = l 1130.85/291.51 cond(z, z', z'') -{ 1 }-> tail(nthtail(1 + n, l)) :|: n >= 0, z' = n, l >= 0, z = 0, z'' = l 1130.85/291.51 ge(z, z') -{ 1 }-> ge(u, v) :|: v >= 0, z' = 1 + v, z = 1 + u, u >= 0 1130.85/291.51 ge(z, z') -{ 1 }-> 1 :|: z = u, z' = 0, u >= 0 1130.85/291.51 ge(z, z') -{ 1 }-> 0 :|: v >= 0, z' = 1 + v, z = 0 1130.85/291.51 length(z) -{ 1 }-> 0 :|: z = 0 1130.85/291.51 length(z) -{ 1 }-> 1 + length(l) :|: x >= 0, l >= 0, z = 1 + x + l 1130.85/291.51 nthtail(z, z') -{ 1 }-> cond(ge(n, length(l)), n, l) :|: z' = l, n >= 0, z = n, l >= 0 1130.85/291.51 tail(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l 1130.85/291.51 tail(z) -{ 1 }-> 0 :|: z = 0 1130.85/291.51 1130.85/291.51 Only complete derivations are relevant for the runtime complexity. 1130.85/291.51 1130.85/291.51 ---------------------------------------- 1130.85/291.51 1130.85/291.51 (9) CompleteCoflocoProof (FINISHED) 1130.85/291.51 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 1130.85/291.51 1130.85/291.51 eq(start(V1, V, V4),0,[nthtail(V1, V, Out)],[V1 >= 0,V >= 0]). 1130.85/291.51 eq(start(V1, V, V4),0,[cond(V1, V, V4, Out)],[V1 >= 0,V >= 0,V4 >= 0]). 1130.85/291.51 eq(start(V1, V, V4),0,[tail(V1, Out)],[V1 >= 0]). 1130.85/291.51 eq(start(V1, V, V4),0,[length(V1, Out)],[V1 >= 0]). 1130.85/291.51 eq(start(V1, V, V4),0,[ge(V1, V, Out)],[V1 >= 0,V >= 0]). 1130.85/291.51 eq(nthtail(V1, V, Out),1,[length(V2, Ret01),ge(V3, Ret01, Ret0),cond(Ret0, V3, V2, Ret)],[Out = Ret,V = V2,V3 >= 0,V1 = V3,V2 >= 0]). 1130.85/291.51 eq(cond(V1, V, V4, Out),1,[],[Out = V6,V5 >= 0,V1 = 1,V = V5,V6 >= 0,V4 = V6]). 1130.85/291.51 eq(cond(V1, V, V4, Out),1,[nthtail(1 + V7, V8, Ret02),tail(Ret02, Ret1)],[Out = Ret1,V7 >= 0,V = V7,V8 >= 0,V1 = 0,V4 = V8]). 1130.85/291.51 eq(tail(V1, Out),1,[],[Out = 0,V1 = 0]). 1130.85/291.51 eq(tail(V1, Out),1,[],[Out = V9,V10 >= 0,V9 >= 0,V1 = 1 + V10 + V9]). 1130.85/291.51 eq(length(V1, Out),1,[],[Out = 0,V1 = 0]). 1130.85/291.51 eq(length(V1, Out),1,[length(V12, Ret11)],[Out = 1 + Ret11,V11 >= 0,V12 >= 0,V1 = 1 + V11 + V12]). 1130.85/291.51 eq(ge(V1, V, Out),1,[],[Out = 1,V1 = V13,V = 0,V13 >= 0]). 1130.85/291.51 eq(ge(V1, V, Out),1,[],[Out = 0,V14 >= 0,V = 1 + V14,V1 = 0]). 1130.85/291.51 eq(ge(V1, V, Out),1,[ge(V16, V15, Ret2)],[Out = Ret2,V15 >= 0,V = 1 + V15,V1 = 1 + V16,V16 >= 0]). 1130.85/291.51 input_output_vars(nthtail(V1,V,Out),[V1,V],[Out]). 1130.85/291.51 input_output_vars(cond(V1,V,V4,Out),[V1,V,V4],[Out]). 1130.85/291.51 input_output_vars(tail(V1,Out),[V1],[Out]). 1130.85/291.51 input_output_vars(length(V1,Out),[V1],[Out]). 1130.85/291.51 input_output_vars(ge(V1,V,Out),[V1,V],[Out]). 1130.85/291.51 1130.85/291.51 1130.85/291.51 CoFloCo proof output: 1130.85/291.51 Preprocessing Cost Relations 1130.85/291.51 ===================================== 1130.85/291.51 1130.85/291.51 #### Computed strongly connected components 1130.85/291.51 0. recursive : [ge/3] 1130.85/291.51 1. recursive : [length/2] 1130.85/291.51 2. non_recursive : [tail/2] 1130.85/291.51 3. recursive [non_tail] : [cond/4,nthtail/3] 1130.85/291.51 4. non_recursive : [start/3] 1130.85/291.51 1130.85/291.51 #### Obtained direct recursion through partial evaluation 1130.85/291.51 0. SCC is partially evaluated into ge/3 1130.85/291.51 1. SCC is partially evaluated into length/2 1130.85/291.51 2. SCC is partially evaluated into tail/2 1130.85/291.51 3. SCC is partially evaluated into nthtail/3 1130.85/291.51 4. SCC is partially evaluated into start/3 1130.85/291.51 1130.85/291.51 Control-Flow Refinement of Cost Relations 1130.85/291.51 ===================================== 1130.85/291.51 1130.85/291.51 ### Specialization of cost equations ge/3 1130.85/291.51 * CE 15 is refined into CE [16] 1130.85/291.51 * CE 13 is refined into CE [17] 1130.85/291.51 * CE 14 is refined into CE [18] 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Cost equations --> "Loop" of ge/3 1130.85/291.51 * CEs [17] --> Loop 12 1130.85/291.51 * CEs [18] --> Loop 13 1130.85/291.51 * CEs [16] --> Loop 14 1130.85/291.51 1130.85/291.51 ### Ranking functions of CR ge(V1,V,Out) 1130.85/291.51 * RF of phase [14]: [V,V1] 1130.85/291.51 1130.85/291.51 #### Partial ranking functions of CR ge(V1,V,Out) 1130.85/291.51 * Partial RF of phase [14]: 1130.85/291.51 - RF of loop [14:1]: 1130.85/291.51 V 1130.85/291.51 V1 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Specialization of cost equations length/2 1130.85/291.51 * CE 12 is refined into CE [19] 1130.85/291.51 * CE 11 is refined into CE [20] 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Cost equations --> "Loop" of length/2 1130.85/291.51 * CEs [20] --> Loop 15 1130.85/291.51 * CEs [19] --> Loop 16 1130.85/291.51 1130.85/291.51 ### Ranking functions of CR length(V1,Out) 1130.85/291.51 * RF of phase [16]: [V1] 1130.85/291.51 1130.85/291.51 #### Partial ranking functions of CR length(V1,Out) 1130.85/291.51 * Partial RF of phase [16]: 1130.85/291.51 - RF of loop [16:1]: 1130.85/291.51 V1 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Specialization of cost equations tail/2 1130.85/291.51 * CE 10 is refined into CE [21] 1130.85/291.51 * CE 9 is refined into CE [22] 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Cost equations --> "Loop" of tail/2 1130.85/291.51 * CEs [21] --> Loop 17 1130.85/291.51 * CEs [22] --> Loop 18 1130.85/291.51 1130.85/291.51 ### Ranking functions of CR tail(V1,Out) 1130.85/291.51 1130.85/291.51 #### Partial ranking functions of CR tail(V1,Out) 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Specialization of cost equations nthtail/3 1130.85/291.51 * CE 8 is refined into CE [23,24] 1130.85/291.51 * CE 7 is refined into CE [25,26,27,28] 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Cost equations --> "Loop" of nthtail/3 1130.85/291.51 * CEs [28] --> Loop 19 1130.85/291.51 * CEs [27] --> Loop 20 1130.85/291.51 * CEs [26] --> Loop 21 1130.85/291.51 * CEs [25] --> Loop 22 1130.85/291.51 * CEs [24] --> Loop 23 1130.85/291.51 * CEs [23] --> Loop 24 1130.85/291.51 1130.85/291.51 ### Ranking functions of CR nthtail(V1,V,Out) 1130.85/291.51 * RF of phase [19]: [-V1+V] 1130.85/291.51 * RF of phase [20]: [-V1+V] 1130.85/291.51 1130.85/291.51 #### Partial ranking functions of CR nthtail(V1,V,Out) 1130.85/291.51 * Partial RF of phase [19]: 1130.85/291.51 - RF of loop [19:1]: 1130.85/291.51 -V1+V 1130.85/291.51 * Partial RF of phase [20]: 1130.85/291.51 - RF of loop [20:1]: 1130.85/291.51 -V1+V 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Specialization of cost equations start/3 1130.85/291.51 * CE 2 is refined into CE [29] 1130.85/291.51 * CE 1 is refined into CE [30,31,32,33] 1130.85/291.51 * CE 3 is refined into CE [34,35,36,37] 1130.85/291.51 * CE 4 is refined into CE [38,39] 1130.85/291.51 * CE 5 is refined into CE [40,41] 1130.85/291.51 * CE 6 is refined into CE [42,43,44,45] 1130.85/291.51 1130.85/291.51 1130.85/291.51 ### Cost equations --> "Loop" of start/3 1130.85/291.51 * CEs [35,43] --> Loop 25 1130.85/291.51 * CEs [29,36,37,39,41,44,45] --> Loop 26 1130.85/291.51 * CEs [30,31,32,33,34,38,40,42] --> Loop 27 1130.85/291.51 1130.85/291.51 ### Ranking functions of CR start(V1,V,V4) 1130.85/291.51 1130.85/291.51 #### Partial ranking functions of CR start(V1,V,V4) 1130.85/291.51 1130.85/291.51 1130.85/291.51 Computing Bounds 1130.85/291.51 ===================================== 1130.85/291.52 1130.85/291.52 #### Cost of chains of ge(V1,V,Out): 1130.85/291.52 * Chain [[14],13]: 1*it(14)+1 1130.85/291.52 Such that:it(14) =< V1 1130.85/291.52 1130.85/291.52 with precondition: [Out=0,V1>=1,V>=V1+1] 1130.85/291.52 1130.85/291.52 * Chain [[14],12]: 1*it(14)+1 1130.85/291.52 Such that:it(14) =< V 1130.85/291.52 1130.85/291.52 with precondition: [Out=1,V>=1,V1>=V] 1130.85/291.52 1130.85/291.52 * Chain [13]: 1 1130.85/291.52 with precondition: [V1=0,Out=0,V>=1] 1130.85/291.52 1130.85/291.52 * Chain [12]: 1 1130.85/291.52 with precondition: [V=0,Out=1,V1>=0] 1130.85/291.52 1130.85/291.52 1130.85/291.52 #### Cost of chains of length(V1,Out): 1130.85/291.52 * Chain [[16],15]: 1*it(16)+1 1130.85/291.52 Such that:it(16) =< V1 1130.85/291.52 1130.85/291.52 with precondition: [Out>=1,V1>=Out] 1130.85/291.52 1130.85/291.52 * Chain [15]: 1 1130.85/291.52 with precondition: [V1=0,Out=0] 1130.85/291.52 1130.85/291.52 1130.85/291.52 #### Cost of chains of tail(V1,Out): 1130.85/291.52 * Chain [18]: 1 1130.85/291.52 with precondition: [V1=0,Out=0] 1130.85/291.52 1130.85/291.52 * Chain [17]: 1 1130.85/291.52 with precondition: [Out>=0,V1>=Out+1] 1130.85/291.52 1130.85/291.52 1130.85/291.52 #### Cost of chains of nthtail(V1,V,Out): 1130.85/291.52 * Chain [[20],[19],23]: 10*it(19)+2*s(1)+4*s(7)+4 1130.85/291.52 Such that:aux(9) =< -V1+V 1130.85/291.52 aux(10) =< V 1130.85/291.52 it(19) =< aux(9) 1130.85/291.52 s(1) =< aux(10) 1130.85/291.52 s(7) =< it(19)*aux(10) 1130.85/291.52 1130.85/291.52 with precondition: [Out=0,V1>=1,V>=V1+2] 1130.85/291.52 1130.85/291.52 * Chain [[19],23]: 5*it(19)+2*s(1)+2*s(7)+4 1130.85/291.52 Such that:it(19) =< -V1+V 1130.85/291.52 aux(5) =< V 1130.85/291.52 s(1) =< aux(5) 1130.85/291.52 s(7) =< it(19)*aux(5) 1130.85/291.52 1130.85/291.52 with precondition: [V1>=1,Out>=0,V>=V1+1,V>=Out+1] 1130.85/291.52 1130.85/291.52 * Chain [24]: 4 1130.85/291.52 with precondition: [V=0,Out=0,V1>=0] 1130.85/291.52 1130.85/291.52 * Chain [23]: 2*s(1)+4 1130.85/291.52 Such that:aux(1) =< V 1130.85/291.52 s(1) =< aux(1) 1130.85/291.52 1130.85/291.52 with precondition: [V=Out,V1>=1,V>=1] 1130.85/291.52 1130.85/291.52 * Chain [22,[20],[19],23]: 13*it(19)+4*s(7)+9 1130.85/291.52 Such that:aux(11) =< V 1130.85/291.52 it(19) =< aux(11) 1130.85/291.52 s(7) =< it(19)*aux(11) 1130.85/291.52 1130.85/291.52 with precondition: [V1=0,Out=0,V>=3] 1130.85/291.52 1130.85/291.52 * Chain [22,[19],23]: 8*it(19)+2*s(7)+9 1130.85/291.52 Such that:aux(12) =< V 1130.85/291.52 it(19) =< aux(12) 1130.85/291.52 s(7) =< it(19)*aux(12) 1130.85/291.52 1130.85/291.52 with precondition: [V1=0,Out=0,V>=2] 1130.85/291.52 1130.85/291.52 * Chain [21,[19],23]: 8*it(19)+2*s(7)+9 1130.85/291.52 Such that:aux(13) =< V 1130.85/291.52 it(19) =< aux(13) 1130.85/291.52 s(7) =< it(19)*aux(13) 1130.85/291.52 1130.85/291.52 with precondition: [V1=0,Out>=0,V>=Out+2] 1130.85/291.52 1130.85/291.52 * Chain [21,23]: 3*s(1)+9 1130.85/291.52 Such that:aux(14) =< V 1130.85/291.52 s(1) =< aux(14) 1130.85/291.52 1130.85/291.52 with precondition: [V1=0,Out>=0,V>=Out+1] 1130.85/291.52 1130.85/291.52 1130.85/291.52 #### Cost of chains of start(V1,V,V4): 1130.85/291.52 * Chain [27]: 30*s(39)+10*s(40)+12*s(41)+32*s(50)+8*s(51)+9 1130.85/291.52 Such that:s(49) =< V 1130.85/291.52 aux(18) =< -V+V4 1130.85/291.52 aux(19) =< V4 1130.85/291.52 s(39) =< aux(18) 1130.85/291.52 s(40) =< aux(19) 1130.85/291.52 s(41) =< s(39)*aux(19) 1130.85/291.52 s(50) =< s(49) 1130.85/291.52 s(51) =< s(50)*s(49) 1130.85/291.52 1130.85/291.52 with precondition: [V1=0] 1130.85/291.52 1130.85/291.52 * Chain [26]: 15*s(54)+7*s(55)+6*s(56)+2*s(59)+4 1130.85/291.52 Such that:s(52) =< -V1+V 1130.85/291.52 aux(20) =< V1 1130.85/291.52 aux(21) =< V 1130.85/291.52 s(59) =< aux(20) 1130.85/291.52 s(55) =< aux(21) 1130.85/291.52 s(54) =< s(52) 1130.85/291.52 s(56) =< s(54)*aux(21) 1130.85/291.52 1130.85/291.52 with precondition: [V1>=1] 1130.85/291.52 1130.85/291.52 * Chain [25]: 4 1130.85/291.52 with precondition: [V=0,V1>=0] 1130.85/291.52 1130.85/291.52 1130.85/291.52 Closed-form bounds of start(V1,V,V4): 1130.85/291.52 ------------------------------------- 1130.85/291.52 * Chain [27] with precondition: [V1=0] 1130.85/291.52 - Upper bound: nat(V)*32+9+nat(V)*8*nat(V)+nat(V4)*10+nat(V4)*12*nat(-V+V4)+nat(-V+V4)*30 1130.85/291.52 - Complexity: n^2 1130.85/291.52 * Chain [26] with precondition: [V1>=1] 1130.85/291.52 - Upper bound: 2*V1+4+nat(V)*7+nat(V)*6*nat(-V1+V)+nat(-V1+V)*15 1130.85/291.52 - Complexity: n^2 1130.85/291.52 * Chain [25] with precondition: [V=0,V1>=0] 1130.85/291.52 - Upper bound: 4 1130.85/291.52 - Complexity: constant 1130.85/291.52 1130.85/291.52 ### Maximum cost of start(V1,V,V4): nat(V)*7+max([nat(V)*6*nat(-V1+V)+2*V1+nat(-V1+V)*15,nat(V)*25+5+nat(V)*8*nat(V)+nat(V4)*10+nat(V4)*12*nat(-V+V4)+nat(-V+V4)*30])+4 1130.85/291.52 Asymptotic class: n^2 1130.85/291.52 * Total analysis performed in 292 ms. 1130.85/291.52 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (10) 1130.85/291.52 BOUNDS(1, n^2) 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (11) RenamingProof (BOTH BOUNDS(ID, ID)) 1130.85/291.52 Renamed function symbols to avoid clashes with predefined symbol. 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (12) 1130.85/291.52 Obligation: 1130.85/291.52 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 1130.85/291.52 1130.85/291.52 1130.85/291.52 The TRS R consists of the following rules: 1130.85/291.52 1130.85/291.52 nthtail(n, l) -> cond(ge(n, length(l)), n, l) 1130.85/291.52 cond(true, n, l) -> l 1130.85/291.52 cond(false, n, l) -> tail(nthtail(s(n), l)) 1130.85/291.52 tail(nil) -> nil 1130.85/291.52 tail(cons(x, l)) -> l 1130.85/291.52 length(nil) -> 0' 1130.85/291.52 length(cons(x, l)) -> s(length(l)) 1130.85/291.52 ge(u, 0') -> true 1130.85/291.52 ge(0', s(v)) -> false 1130.85/291.52 ge(s(u), s(v)) -> ge(u, v) 1130.85/291.52 1130.85/291.52 S is empty. 1130.85/291.52 Rewrite Strategy: INNERMOST 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (13) SlicingProof (LOWER BOUND(ID)) 1130.85/291.52 Sliced the following arguments: 1130.85/291.52 cons/0 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (14) 1130.85/291.52 Obligation: 1130.85/291.52 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 1130.85/291.52 1130.85/291.52 1130.85/291.52 The TRS R consists of the following rules: 1130.85/291.52 1130.85/291.52 nthtail(n, l) -> cond(ge(n, length(l)), n, l) 1130.85/291.52 cond(true, n, l) -> l 1130.85/291.52 cond(false, n, l) -> tail(nthtail(s(n), l)) 1130.85/291.52 tail(nil) -> nil 1130.85/291.52 tail(cons(l)) -> l 1130.85/291.52 length(nil) -> 0' 1130.85/291.52 length(cons(l)) -> s(length(l)) 1130.85/291.52 ge(u, 0') -> true 1130.85/291.52 ge(0', s(v)) -> false 1130.85/291.52 ge(s(u), s(v)) -> ge(u, v) 1130.85/291.52 1130.85/291.52 S is empty. 1130.85/291.52 Rewrite Strategy: INNERMOST 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (15) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 1130.85/291.52 Infered types. 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (16) 1130.85/291.52 Obligation: 1130.85/291.52 Innermost TRS: 1130.85/291.52 Rules: 1130.85/291.52 nthtail(n, l) -> cond(ge(n, length(l)), n, l) 1130.85/291.52 cond(true, n, l) -> l 1130.85/291.52 cond(false, n, l) -> tail(nthtail(s(n), l)) 1130.85/291.52 tail(nil) -> nil 1130.85/291.52 tail(cons(l)) -> l 1130.85/291.52 length(nil) -> 0' 1130.85/291.52 length(cons(l)) -> s(length(l)) 1130.85/291.52 ge(u, 0') -> true 1130.85/291.52 ge(0', s(v)) -> false 1130.85/291.52 ge(s(u), s(v)) -> ge(u, v) 1130.85/291.52 1130.85/291.52 Types: 1130.85/291.52 nthtail :: s:0' -> nil:cons -> nil:cons 1130.85/291.52 cond :: true:false -> s:0' -> nil:cons -> nil:cons 1130.85/291.52 ge :: s:0' -> s:0' -> true:false 1130.85/291.52 length :: nil:cons -> s:0' 1130.85/291.52 true :: true:false 1130.85/291.52 false :: true:false 1130.85/291.52 tail :: nil:cons -> nil:cons 1130.85/291.52 s :: s:0' -> s:0' 1130.85/291.52 nil :: nil:cons 1130.85/291.52 cons :: nil:cons -> nil:cons 1130.85/291.52 0' :: s:0' 1130.85/291.52 hole_nil:cons1_0 :: nil:cons 1130.85/291.52 hole_s:0'2_0 :: s:0' 1130.85/291.52 hole_true:false3_0 :: true:false 1130.85/291.52 gen_nil:cons4_0 :: Nat -> nil:cons 1130.85/291.52 gen_s:0'5_0 :: Nat -> s:0' 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (17) OrderProof (LOWER BOUND(ID)) 1130.85/291.52 Heuristically decided to analyse the following defined symbols: 1130.85/291.52 nthtail, ge, length 1130.85/291.52 1130.85/291.52 They will be analysed ascendingly in the following order: 1130.85/291.52 ge < nthtail 1130.85/291.52 length < nthtail 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (18) 1130.85/291.52 Obligation: 1130.85/291.52 Innermost TRS: 1130.85/291.52 Rules: 1130.85/291.52 nthtail(n, l) -> cond(ge(n, length(l)), n, l) 1130.85/291.52 cond(true, n, l) -> l 1130.85/291.52 cond(false, n, l) -> tail(nthtail(s(n), l)) 1130.85/291.52 tail(nil) -> nil 1130.85/291.52 tail(cons(l)) -> l 1130.85/291.52 length(nil) -> 0' 1130.85/291.52 length(cons(l)) -> s(length(l)) 1130.85/291.52 ge(u, 0') -> true 1130.85/291.52 ge(0', s(v)) -> false 1130.85/291.52 ge(s(u), s(v)) -> ge(u, v) 1130.85/291.52 1130.85/291.52 Types: 1130.85/291.52 nthtail :: s:0' -> nil:cons -> nil:cons 1130.85/291.52 cond :: true:false -> s:0' -> nil:cons -> nil:cons 1130.85/291.52 ge :: s:0' -> s:0' -> true:false 1130.85/291.52 length :: nil:cons -> s:0' 1130.85/291.52 true :: true:false 1130.85/291.52 false :: true:false 1130.85/291.52 tail :: nil:cons -> nil:cons 1130.85/291.52 s :: s:0' -> s:0' 1130.85/291.52 nil :: nil:cons 1130.85/291.52 cons :: nil:cons -> nil:cons 1130.85/291.52 0' :: s:0' 1130.85/291.52 hole_nil:cons1_0 :: nil:cons 1130.85/291.52 hole_s:0'2_0 :: s:0' 1130.85/291.52 hole_true:false3_0 :: true:false 1130.85/291.52 gen_nil:cons4_0 :: Nat -> nil:cons 1130.85/291.52 gen_s:0'5_0 :: Nat -> s:0' 1130.85/291.52 1130.85/291.52 1130.85/291.52 Generator Equations: 1130.85/291.52 gen_nil:cons4_0(0) <=> nil 1130.85/291.52 gen_nil:cons4_0(+(x, 1)) <=> cons(gen_nil:cons4_0(x)) 1130.85/291.52 gen_s:0'5_0(0) <=> 0' 1130.85/291.52 gen_s:0'5_0(+(x, 1)) <=> s(gen_s:0'5_0(x)) 1130.85/291.52 1130.85/291.52 1130.85/291.52 The following defined symbols remain to be analysed: 1130.85/291.52 ge, nthtail, length 1130.85/291.52 1130.85/291.52 They will be analysed ascendingly in the following order: 1130.85/291.52 ge < nthtail 1130.85/291.52 length < nthtail 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (19) RewriteLemmaProof (LOWER BOUND(ID)) 1130.85/291.52 Proved the following rewrite lemma: 1130.85/291.52 ge(gen_s:0'5_0(n7_0), gen_s:0'5_0(n7_0)) -> true, rt in Omega(1 + n7_0) 1130.85/291.52 1130.85/291.52 Induction Base: 1130.85/291.52 ge(gen_s:0'5_0(0), gen_s:0'5_0(0)) ->_R^Omega(1) 1130.85/291.52 true 1130.85/291.52 1130.85/291.52 Induction Step: 1130.85/291.52 ge(gen_s:0'5_0(+(n7_0, 1)), gen_s:0'5_0(+(n7_0, 1))) ->_R^Omega(1) 1130.85/291.52 ge(gen_s:0'5_0(n7_0), gen_s:0'5_0(n7_0)) ->_IH 1130.85/291.52 true 1130.85/291.52 1130.85/291.52 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (20) 1130.85/291.52 Complex Obligation (BEST) 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (21) 1130.85/291.52 Obligation: 1130.85/291.52 Proved the lower bound n^1 for the following obligation: 1130.85/291.52 1130.85/291.52 Innermost TRS: 1130.85/291.52 Rules: 1130.85/291.52 nthtail(n, l) -> cond(ge(n, length(l)), n, l) 1130.85/291.52 cond(true, n, l) -> l 1130.85/291.52 cond(false, n, l) -> tail(nthtail(s(n), l)) 1130.85/291.52 tail(nil) -> nil 1130.85/291.52 tail(cons(l)) -> l 1130.85/291.52 length(nil) -> 0' 1130.85/291.52 length(cons(l)) -> s(length(l)) 1130.85/291.52 ge(u, 0') -> true 1130.85/291.52 ge(0', s(v)) -> false 1130.85/291.52 ge(s(u), s(v)) -> ge(u, v) 1130.85/291.52 1130.85/291.52 Types: 1130.85/291.52 nthtail :: s:0' -> nil:cons -> nil:cons 1130.85/291.52 cond :: true:false -> s:0' -> nil:cons -> nil:cons 1130.85/291.52 ge :: s:0' -> s:0' -> true:false 1130.85/291.52 length :: nil:cons -> s:0' 1130.85/291.52 true :: true:false 1130.85/291.52 false :: true:false 1130.85/291.52 tail :: nil:cons -> nil:cons 1130.85/291.52 s :: s:0' -> s:0' 1130.85/291.52 nil :: nil:cons 1130.85/291.52 cons :: nil:cons -> nil:cons 1130.85/291.52 0' :: s:0' 1130.85/291.52 hole_nil:cons1_0 :: nil:cons 1130.85/291.52 hole_s:0'2_0 :: s:0' 1130.85/291.52 hole_true:false3_0 :: true:false 1130.85/291.52 gen_nil:cons4_0 :: Nat -> nil:cons 1130.85/291.52 gen_s:0'5_0 :: Nat -> s:0' 1130.85/291.52 1130.85/291.52 1130.85/291.52 Generator Equations: 1130.85/291.52 gen_nil:cons4_0(0) <=> nil 1130.85/291.52 gen_nil:cons4_0(+(x, 1)) <=> cons(gen_nil:cons4_0(x)) 1130.85/291.52 gen_s:0'5_0(0) <=> 0' 1130.85/291.52 gen_s:0'5_0(+(x, 1)) <=> s(gen_s:0'5_0(x)) 1130.85/291.52 1130.85/291.52 1130.85/291.52 The following defined symbols remain to be analysed: 1130.85/291.52 ge, nthtail, length 1130.85/291.52 1130.85/291.52 They will be analysed ascendingly in the following order: 1130.85/291.52 ge < nthtail 1130.85/291.52 length < nthtail 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (22) LowerBoundPropagationProof (FINISHED) 1130.85/291.52 Propagated lower bound. 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (23) 1130.85/291.52 BOUNDS(n^1, INF) 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (24) 1130.85/291.52 Obligation: 1130.85/291.52 Innermost TRS: 1130.85/291.52 Rules: 1130.85/291.52 nthtail(n, l) -> cond(ge(n, length(l)), n, l) 1130.85/291.52 cond(true, n, l) -> l 1130.85/291.52 cond(false, n, l) -> tail(nthtail(s(n), l)) 1130.85/291.52 tail(nil) -> nil 1130.85/291.52 tail(cons(l)) -> l 1130.85/291.52 length(nil) -> 0' 1130.85/291.52 length(cons(l)) -> s(length(l)) 1130.85/291.52 ge(u, 0') -> true 1130.85/291.52 ge(0', s(v)) -> false 1130.85/291.52 ge(s(u), s(v)) -> ge(u, v) 1130.85/291.52 1130.85/291.52 Types: 1130.85/291.52 nthtail :: s:0' -> nil:cons -> nil:cons 1130.85/291.52 cond :: true:false -> s:0' -> nil:cons -> nil:cons 1130.85/291.52 ge :: s:0' -> s:0' -> true:false 1130.85/291.52 length :: nil:cons -> s:0' 1130.85/291.52 true :: true:false 1130.85/291.52 false :: true:false 1130.85/291.52 tail :: nil:cons -> nil:cons 1130.85/291.52 s :: s:0' -> s:0' 1130.85/291.52 nil :: nil:cons 1130.85/291.52 cons :: nil:cons -> nil:cons 1130.85/291.52 0' :: s:0' 1130.85/291.52 hole_nil:cons1_0 :: nil:cons 1130.85/291.52 hole_s:0'2_0 :: s:0' 1130.85/291.52 hole_true:false3_0 :: true:false 1130.85/291.52 gen_nil:cons4_0 :: Nat -> nil:cons 1130.85/291.52 gen_s:0'5_0 :: Nat -> s:0' 1130.85/291.52 1130.85/291.52 1130.85/291.52 Lemmas: 1130.85/291.52 ge(gen_s:0'5_0(n7_0), gen_s:0'5_0(n7_0)) -> true, rt in Omega(1 + n7_0) 1130.85/291.52 1130.85/291.52 1130.85/291.52 Generator Equations: 1130.85/291.52 gen_nil:cons4_0(0) <=> nil 1130.85/291.52 gen_nil:cons4_0(+(x, 1)) <=> cons(gen_nil:cons4_0(x)) 1130.85/291.52 gen_s:0'5_0(0) <=> 0' 1130.85/291.52 gen_s:0'5_0(+(x, 1)) <=> s(gen_s:0'5_0(x)) 1130.85/291.52 1130.85/291.52 1130.85/291.52 The following defined symbols remain to be analysed: 1130.85/291.52 length, nthtail 1130.85/291.52 1130.85/291.52 They will be analysed ascendingly in the following order: 1130.85/291.52 length < nthtail 1130.85/291.52 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (25) RewriteLemmaProof (LOWER BOUND(ID)) 1130.85/291.52 Proved the following rewrite lemma: 1130.85/291.52 length(gen_nil:cons4_0(n269_0)) -> gen_s:0'5_0(n269_0), rt in Omega(1 + n269_0) 1130.85/291.52 1130.85/291.52 Induction Base: 1130.85/291.52 length(gen_nil:cons4_0(0)) ->_R^Omega(1) 1130.85/291.52 0' 1130.85/291.52 1130.85/291.52 Induction Step: 1130.85/291.52 length(gen_nil:cons4_0(+(n269_0, 1))) ->_R^Omega(1) 1130.85/291.52 s(length(gen_nil:cons4_0(n269_0))) ->_IH 1130.85/291.52 s(gen_s:0'5_0(c270_0)) 1130.85/291.52 1130.85/291.52 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). 1130.85/291.52 ---------------------------------------- 1130.85/291.52 1130.85/291.52 (26) 1130.85/291.52 Obligation: 1130.85/291.52 Innermost TRS: 1130.85/291.52 Rules: 1130.85/291.52 nthtail(n, l) -> cond(ge(n, length(l)), n, l) 1130.85/291.52 cond(true, n, l) -> l 1130.85/291.52 cond(false, n, l) -> tail(nthtail(s(n), l)) 1130.85/291.52 tail(nil) -> nil 1130.85/291.52 tail(cons(l)) -> l 1130.85/291.52 length(nil) -> 0' 1130.85/291.52 length(cons(l)) -> s(length(l)) 1130.85/291.52 ge(u, 0') -> true 1130.85/291.52 ge(0', s(v)) -> false 1130.85/291.52 ge(s(u), s(v)) -> ge(u, v) 1130.85/291.52 1130.85/291.52 Types: 1130.85/291.52 nthtail :: s:0' -> nil:cons -> nil:cons 1130.85/291.52 cond :: true:false -> s:0' -> nil:cons -> nil:cons 1130.85/291.52 ge :: s:0' -> s:0' -> true:false 1130.85/291.52 length :: nil:cons -> s:0' 1130.85/291.52 true :: true:false 1130.85/291.52 false :: true:false 1130.85/291.52 tail :: nil:cons -> nil:cons 1130.85/291.52 s :: s:0' -> s:0' 1130.85/291.52 nil :: nil:cons 1130.85/291.52 cons :: nil:cons -> nil:cons 1130.85/291.52 0' :: s:0' 1130.85/291.52 hole_nil:cons1_0 :: nil:cons 1130.85/291.52 hole_s:0'2_0 :: s:0' 1130.85/291.52 hole_true:false3_0 :: true:false 1130.85/291.52 gen_nil:cons4_0 :: Nat -> nil:cons 1130.85/291.52 gen_s:0'5_0 :: Nat -> s:0' 1130.85/291.52 1130.85/291.52 1130.85/291.52 Lemmas: 1130.85/291.52 ge(gen_s:0'5_0(n7_0), gen_s:0'5_0(n7_0)) -> true, rt in Omega(1 + n7_0) 1130.85/291.52 length(gen_nil:cons4_0(n269_0)) -> gen_s:0'5_0(n269_0), rt in Omega(1 + n269_0) 1130.85/291.52 1130.85/291.52 1130.85/291.52 Generator Equations: 1130.85/291.52 gen_nil:cons4_0(0) <=> nil 1130.85/291.52 gen_nil:cons4_0(+(x, 1)) <=> cons(gen_nil:cons4_0(x)) 1130.85/291.52 gen_s:0'5_0(0) <=> 0' 1130.85/291.52 gen_s:0'5_0(+(x, 1)) <=> s(gen_s:0'5_0(x)) 1130.85/291.52 1130.85/291.52 1130.85/291.52 The following defined symbols remain to be analysed: 1130.85/291.52 nthtail 1131.04/291.59 EOF