1110.88/291.48 WORST_CASE(Omega(n^1), O(n^2)) 1110.88/291.50 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 1110.88/291.50 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 1110.88/291.50 1110.88/291.50 1110.88/291.50 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1110.88/291.50 1110.88/291.50 (0) CpxTRS 1110.88/291.50 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 1110.88/291.50 (2) CpxWeightedTrs 1110.88/291.50 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 1110.88/291.50 (4) CpxTypedWeightedTrs 1110.88/291.50 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 1110.88/291.50 (6) CpxTypedWeightedCompleteTrs 1110.88/291.50 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 1110.88/291.50 (8) CpxRNTS 1110.88/291.50 (9) CompleteCoflocoProof [FINISHED, 414 ms] 1110.88/291.50 (10) BOUNDS(1, n^2) 1110.88/291.50 (11) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] 1110.88/291.50 (12) TRS for Loop Detection 1110.88/291.50 (13) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] 1110.88/291.50 (14) BEST 1110.88/291.50 (15) proven lower bound 1110.88/291.50 (16) LowerBoundPropagationProof [FINISHED, 0 ms] 1110.88/291.50 (17) BOUNDS(n^1, INF) 1110.88/291.50 (18) TRS for Loop Detection 1110.88/291.50 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (0) 1110.88/291.50 Obligation: 1110.88/291.50 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1110.88/291.50 1110.88/291.50 1110.88/291.50 The TRS R consists of the following rules: 1110.88/291.50 1110.88/291.50 gt(0, y) -> false 1110.88/291.50 gt(s(x), 0) -> true 1110.88/291.50 gt(s(x), s(y)) -> gt(x, y) 1110.88/291.50 plus(0, y) -> y 1110.88/291.50 plus(s(x), y) -> s(plus(x, y)) 1110.88/291.50 double(0) -> 0 1110.88/291.50 double(s(x)) -> s(s(double(x))) 1110.88/291.50 average(x, y) -> aver(plus(x, y), 0) 1110.88/291.50 aver(sum, z) -> if(gt(sum, double(z)), sum, z) 1110.88/291.50 if(true, sum, z) -> aver(sum, s(z)) 1110.88/291.50 if(false, sum, z) -> z 1110.88/291.50 1110.88/291.50 S is empty. 1110.88/291.50 Rewrite Strategy: INNERMOST 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 1110.88/291.50 Transformed relative TRS to weighted TRS 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (2) 1110.88/291.50 Obligation: 1110.88/291.50 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). 1110.88/291.50 1110.88/291.50 1110.88/291.50 The TRS R consists of the following rules: 1110.88/291.50 1110.88/291.50 gt(0, y) -> false [1] 1110.88/291.50 gt(s(x), 0) -> true [1] 1110.88/291.50 gt(s(x), s(y)) -> gt(x, y) [1] 1110.88/291.50 plus(0, y) -> y [1] 1110.88/291.50 plus(s(x), y) -> s(plus(x, y)) [1] 1110.88/291.50 double(0) -> 0 [1] 1110.88/291.50 double(s(x)) -> s(s(double(x))) [1] 1110.88/291.50 average(x, y) -> aver(plus(x, y), 0) [1] 1110.88/291.50 aver(sum, z) -> if(gt(sum, double(z)), sum, z) [1] 1110.88/291.50 if(true, sum, z) -> aver(sum, s(z)) [1] 1110.88/291.50 if(false, sum, z) -> z [1] 1110.88/291.50 1110.88/291.50 Rewrite Strategy: INNERMOST 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 1110.88/291.50 Infered types. 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (4) 1110.88/291.50 Obligation: 1110.88/291.50 Runtime Complexity Weighted TRS with Types. 1110.88/291.50 The TRS R consists of the following rules: 1110.88/291.50 1110.88/291.50 gt(0, y) -> false [1] 1110.88/291.50 gt(s(x), 0) -> true [1] 1110.88/291.50 gt(s(x), s(y)) -> gt(x, y) [1] 1110.88/291.50 plus(0, y) -> y [1] 1110.88/291.50 plus(s(x), y) -> s(plus(x, y)) [1] 1110.88/291.50 double(0) -> 0 [1] 1110.88/291.50 double(s(x)) -> s(s(double(x))) [1] 1110.88/291.50 average(x, y) -> aver(plus(x, y), 0) [1] 1110.88/291.50 aver(sum, z) -> if(gt(sum, double(z)), sum, z) [1] 1110.88/291.50 if(true, sum, z) -> aver(sum, s(z)) [1] 1110.88/291.50 if(false, sum, z) -> z [1] 1110.88/291.50 1110.88/291.50 The TRS has the following type information: 1110.88/291.50 gt :: 0:s -> 0:s -> false:true 1110.88/291.50 0 :: 0:s 1110.88/291.50 false :: false:true 1110.88/291.50 s :: 0:s -> 0:s 1110.88/291.50 true :: false:true 1110.88/291.50 plus :: 0:s -> 0:s -> 0:s 1110.88/291.50 double :: 0:s -> 0:s 1110.88/291.50 average :: 0:s -> 0:s -> 0:s 1110.88/291.50 aver :: 0:s -> 0:s -> 0:s 1110.88/291.50 if :: false:true -> 0:s -> 0:s -> 0:s 1110.88/291.50 1110.88/291.50 Rewrite Strategy: INNERMOST 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (5) CompletionProof (UPPER BOUND(ID)) 1110.88/291.50 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 1110.88/291.50 none 1110.88/291.50 1110.88/291.50 And the following fresh constants: none 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (6) 1110.88/291.50 Obligation: 1110.88/291.50 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 1110.88/291.50 1110.88/291.50 Runtime Complexity Weighted TRS with Types. 1110.88/291.50 The TRS R consists of the following rules: 1110.88/291.50 1110.88/291.50 gt(0, y) -> false [1] 1110.88/291.50 gt(s(x), 0) -> true [1] 1110.88/291.50 gt(s(x), s(y)) -> gt(x, y) [1] 1110.88/291.50 plus(0, y) -> y [1] 1110.88/291.50 plus(s(x), y) -> s(plus(x, y)) [1] 1110.88/291.50 double(0) -> 0 [1] 1110.88/291.50 double(s(x)) -> s(s(double(x))) [1] 1110.88/291.50 average(x, y) -> aver(plus(x, y), 0) [1] 1110.88/291.50 aver(sum, z) -> if(gt(sum, double(z)), sum, z) [1] 1110.88/291.50 if(true, sum, z) -> aver(sum, s(z)) [1] 1110.88/291.50 if(false, sum, z) -> z [1] 1110.88/291.50 1110.88/291.50 The TRS has the following type information: 1110.88/291.50 gt :: 0:s -> 0:s -> false:true 1110.88/291.50 0 :: 0:s 1110.88/291.50 false :: false:true 1110.88/291.50 s :: 0:s -> 0:s 1110.88/291.50 true :: false:true 1110.88/291.50 plus :: 0:s -> 0:s -> 0:s 1110.88/291.50 double :: 0:s -> 0:s 1110.88/291.50 average :: 0:s -> 0:s -> 0:s 1110.88/291.50 aver :: 0:s -> 0:s -> 0:s 1110.88/291.50 if :: false:true -> 0:s -> 0:s -> 0:s 1110.88/291.50 1110.88/291.50 Rewrite Strategy: INNERMOST 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 1110.88/291.50 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 1110.88/291.50 The constant constructors are abstracted as follows: 1110.88/291.50 1110.88/291.50 0 => 0 1110.88/291.50 false => 0 1110.88/291.50 true => 1 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (8) 1110.88/291.50 Obligation: 1110.88/291.50 Complexity RNTS consisting of the following rules: 1110.88/291.50 1110.88/291.50 aver(z', z'') -{ 1 }-> if(gt(sum, double(z)), sum, z) :|: z'' = z, z >= 0, sum >= 0, z' = sum 1110.88/291.50 average(z', z'') -{ 1 }-> aver(plus(x, y), 0) :|: z' = x, z'' = y, x >= 0, y >= 0 1110.88/291.50 double(z') -{ 1 }-> 0 :|: z' = 0 1110.88/291.50 double(z') -{ 1 }-> 1 + (1 + double(x)) :|: z' = 1 + x, x >= 0 1110.88/291.50 gt(z', z'') -{ 1 }-> gt(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y 1110.88/291.50 gt(z', z'') -{ 1 }-> 1 :|: z'' = 0, z' = 1 + x, x >= 0 1110.88/291.50 gt(z', z'') -{ 1 }-> 0 :|: z'' = y, y >= 0, z' = 0 1110.88/291.50 if(z', z'', z1) -{ 1 }-> z :|: z1 = z, z >= 0, sum >= 0, z'' = sum, z' = 0 1110.88/291.50 if(z', z'', z1) -{ 1 }-> aver(sum, 1 + z) :|: z1 = z, z >= 0, z' = 1, sum >= 0, z'' = sum 1110.88/291.50 plus(z', z'') -{ 1 }-> y :|: z'' = y, y >= 0, z' = 0 1110.88/291.50 plus(z', z'') -{ 1 }-> 1 + plus(x, y) :|: z' = 1 + x, z'' = y, x >= 0, y >= 0 1110.88/291.50 1110.88/291.50 Only complete derivations are relevant for the runtime complexity. 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (9) CompleteCoflocoProof (FINISHED) 1110.88/291.50 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 1110.88/291.50 1110.88/291.50 eq(start(V, V1, V16),0,[gt(V, V1, Out)],[V >= 0,V1 >= 0]). 1110.88/291.50 eq(start(V, V1, V16),0,[plus(V, V1, Out)],[V >= 0,V1 >= 0]). 1110.88/291.50 eq(start(V, V1, V16),0,[double(V, Out)],[V >= 0]). 1110.88/291.50 eq(start(V, V1, V16),0,[average(V, V1, Out)],[V >= 0,V1 >= 0]). 1110.88/291.50 eq(start(V, V1, V16),0,[aver(V, V1, Out)],[V >= 0,V1 >= 0]). 1110.88/291.50 eq(start(V, V1, V16),0,[if(V, V1, V16, Out)],[V >= 0,V1 >= 0,V16 >= 0]). 1110.88/291.50 eq(gt(V, V1, Out),1,[],[Out = 0,V1 = V2,V2 >= 0,V = 0]). 1110.88/291.50 eq(gt(V, V1, Out),1,[],[Out = 1,V1 = 0,V = 1 + V3,V3 >= 0]). 1110.88/291.50 eq(gt(V, V1, Out),1,[gt(V4, V5, Ret)],[Out = Ret,V = 1 + V4,V4 >= 0,V5 >= 0,V1 = 1 + V5]). 1110.88/291.50 eq(plus(V, V1, Out),1,[],[Out = V6,V1 = V6,V6 >= 0,V = 0]). 1110.88/291.50 eq(plus(V, V1, Out),1,[plus(V7, V8, Ret1)],[Out = 1 + Ret1,V = 1 + V7,V1 = V8,V7 >= 0,V8 >= 0]). 1110.88/291.50 eq(double(V, Out),1,[],[Out = 0,V = 0]). 1110.88/291.50 eq(double(V, Out),1,[double(V9, Ret11)],[Out = 2 + Ret11,V = 1 + V9,V9 >= 0]). 1110.88/291.50 eq(average(V, V1, Out),1,[plus(V11, V10, Ret0),aver(Ret0, 0, Ret2)],[Out = Ret2,V = V11,V1 = V10,V11 >= 0,V10 >= 0]). 1110.88/291.50 eq(aver(V, V1, Out),1,[double(V13, Ret01),gt(V12, Ret01, Ret02),if(Ret02, V12, V13, Ret3)],[Out = Ret3,V1 = V13,V13 >= 0,V12 >= 0,V = V12]). 1110.88/291.50 eq(if(V, V1, V16, Out),1,[aver(V14, 1 + V15, Ret4)],[Out = Ret4,V16 = V15,V15 >= 0,V = 1,V14 >= 0,V1 = V14]). 1110.88/291.50 eq(if(V, V1, V16, Out),1,[],[Out = V17,V16 = V17,V17 >= 0,V18 >= 0,V1 = V18,V = 0]). 1110.88/291.50 input_output_vars(gt(V,V1,Out),[V,V1],[Out]). 1110.88/291.50 input_output_vars(plus(V,V1,Out),[V,V1],[Out]). 1110.88/291.50 input_output_vars(double(V,Out),[V],[Out]). 1110.88/291.50 input_output_vars(average(V,V1,Out),[V,V1],[Out]). 1110.88/291.50 input_output_vars(aver(V,V1,Out),[V,V1],[Out]). 1110.88/291.50 input_output_vars(if(V,V1,V16,Out),[V,V1,V16],[Out]). 1110.88/291.50 1110.88/291.50 1110.88/291.50 CoFloCo proof output: 1110.88/291.50 Preprocessing Cost Relations 1110.88/291.50 ===================================== 1110.88/291.50 1110.88/291.50 #### Computed strongly connected components 1110.88/291.50 0. recursive : [double/2] 1110.88/291.50 1. recursive : [gt/3] 1110.88/291.50 2. recursive : [aver/3,if/4] 1110.88/291.50 3. recursive : [plus/3] 1110.88/291.50 4. non_recursive : [average/3] 1110.88/291.50 5. non_recursive : [start/3] 1110.88/291.50 1110.88/291.50 #### Obtained direct recursion through partial evaluation 1110.88/291.50 0. SCC is partially evaluated into double/2 1110.88/291.50 1. SCC is partially evaluated into gt/3 1110.88/291.50 2. SCC is partially evaluated into aver/3 1110.88/291.50 3. SCC is partially evaluated into plus/3 1110.88/291.50 4. SCC is partially evaluated into average/3 1110.88/291.50 5. SCC is partially evaluated into start/3 1110.88/291.50 1110.88/291.50 Control-Flow Refinement of Cost Relations 1110.88/291.50 ===================================== 1110.88/291.50 1110.88/291.50 ### Specialization of cost equations double/2 1110.88/291.50 * CE 16 is refined into CE [18] 1110.88/291.50 * CE 15 is refined into CE [19] 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Cost equations --> "Loop" of double/2 1110.88/291.50 * CEs [19] --> Loop 13 1110.88/291.50 * CEs [18] --> Loop 14 1110.88/291.50 1110.88/291.50 ### Ranking functions of CR double(V,Out) 1110.88/291.50 * RF of phase [14]: [V] 1110.88/291.50 1110.88/291.50 #### Partial ranking functions of CR double(V,Out) 1110.88/291.50 * Partial RF of phase [14]: 1110.88/291.50 - RF of loop [14:1]: 1110.88/291.50 V 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Specialization of cost equations gt/3 1110.88/291.50 * CE 12 is refined into CE [20] 1110.88/291.50 * CE 11 is refined into CE [21] 1110.88/291.50 * CE 10 is refined into CE [22] 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Cost equations --> "Loop" of gt/3 1110.88/291.50 * CEs [21] --> Loop 15 1110.88/291.50 * CEs [22] --> Loop 16 1110.88/291.50 * CEs [20] --> Loop 17 1110.88/291.50 1110.88/291.50 ### Ranking functions of CR gt(V,V1,Out) 1110.88/291.50 * RF of phase [17]: [V,V1] 1110.88/291.50 1110.88/291.50 #### Partial ranking functions of CR gt(V,V1,Out) 1110.88/291.50 * Partial RF of phase [17]: 1110.88/291.50 - RF of loop [17:1]: 1110.88/291.50 V 1110.88/291.50 V1 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Specialization of cost equations aver/3 1110.88/291.50 * CE 9 is refined into CE [23,24] 1110.88/291.50 * CE 8 is refined into CE [25,26,27] 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Cost equations --> "Loop" of aver/3 1110.88/291.50 * CEs [27] --> Loop 18 1110.88/291.50 * CEs [26] --> Loop 19 1110.88/291.50 * CEs [25] --> Loop 20 1110.88/291.50 * CEs [24] --> Loop 21 1110.88/291.50 * CEs [23] --> Loop 22 1110.88/291.50 1110.88/291.50 ### Ranking functions of CR aver(V,V1,Out) 1110.88/291.50 * RF of phase [21]: [V/2-V1] 1110.88/291.50 1110.88/291.50 #### Partial ranking functions of CR aver(V,V1,Out) 1110.88/291.50 * Partial RF of phase [21]: 1110.88/291.50 - RF of loop [21:1]: 1110.88/291.50 V/2-V1 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Specialization of cost equations plus/3 1110.88/291.50 * CE 14 is refined into CE [28] 1110.88/291.50 * CE 13 is refined into CE [29] 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Cost equations --> "Loop" of plus/3 1110.88/291.50 * CEs [29] --> Loop 23 1110.88/291.50 * CEs [28] --> Loop 24 1110.88/291.50 1110.88/291.50 ### Ranking functions of CR plus(V,V1,Out) 1110.88/291.50 * RF of phase [24]: [V] 1110.88/291.50 1110.88/291.50 #### Partial ranking functions of CR plus(V,V1,Out) 1110.88/291.50 * Partial RF of phase [24]: 1110.88/291.50 - RF of loop [24:1]: 1110.88/291.50 V 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Specialization of cost equations average/3 1110.88/291.50 * CE 17 is refined into CE [30,31,32,33,34] 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Cost equations --> "Loop" of average/3 1110.88/291.50 * CEs [34] --> Loop 25 1110.88/291.50 * CEs [33] --> Loop 26 1110.88/291.50 * CEs [32] --> Loop 27 1110.88/291.50 * CEs [31] --> Loop 28 1110.88/291.50 * CEs [30] --> Loop 29 1110.88/291.50 1110.88/291.50 ### Ranking functions of CR average(V,V1,Out) 1110.88/291.50 1110.88/291.50 #### Partial ranking functions of CR average(V,V1,Out) 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Specialization of cost equations start/3 1110.88/291.50 * CE 2 is refined into CE [35,36,37] 1110.88/291.50 * CE 1 is refined into CE [38] 1110.88/291.50 * CE 3 is refined into CE [39,40,41,42] 1110.88/291.50 * CE 4 is refined into CE [43,44] 1110.88/291.50 * CE 5 is refined into CE [45,46] 1110.88/291.50 * CE 6 is refined into CE [47,48,49,50,51] 1110.88/291.50 * CE 7 is refined into CE [52,53,54,55,56,57] 1110.88/291.50 1110.88/291.50 1110.88/291.50 ### Cost equations --> "Loop" of start/3 1110.88/291.50 * CEs [37] --> Loop 30 1110.88/291.50 * CEs [36] --> Loop 31 1110.88/291.50 * CEs [35,40,41,42,44,46,50,51,54,55,56,57] --> Loop 32 1110.88/291.50 * CEs [38,39,43,45,47,48,49,52,53] --> Loop 33 1110.88/291.50 1110.88/291.50 ### Ranking functions of CR start(V,V1,V16) 1110.88/291.50 1110.88/291.50 #### Partial ranking functions of CR start(V,V1,V16) 1110.88/291.50 1110.88/291.50 1110.88/291.50 Computing Bounds 1110.88/291.50 ===================================== 1110.88/291.50 1110.88/291.50 #### Cost of chains of double(V,Out): 1110.88/291.50 * Chain [[14],13]: 1*it(14)+1 1110.88/291.50 Such that:it(14) =< Out/2 1110.88/291.50 1110.88/291.50 with precondition: [2*V=Out,V>=1] 1110.88/291.50 1110.88/291.50 * Chain [13]: 1 1110.88/291.50 with precondition: [V=0,Out=0] 1110.88/291.50 1110.88/291.50 1110.88/291.50 #### Cost of chains of gt(V,V1,Out): 1110.88/291.50 * Chain [[17],16]: 1*it(17)+1 1110.88/291.50 Such that:it(17) =< V 1110.88/291.50 1110.88/291.50 with precondition: [Out=0,V>=1,V1>=V] 1110.88/291.50 1110.88/291.50 * Chain [[17],15]: 1*it(17)+1 1110.88/291.50 Such that:it(17) =< V1 1110.88/291.50 1110.88/291.50 with precondition: [Out=1,V1>=1,V>=V1+1] 1110.88/291.50 1110.88/291.50 * Chain [16]: 1 1110.88/291.50 with precondition: [V=0,Out=0,V1>=0] 1110.88/291.50 1110.88/291.50 * Chain [15]: 1 1110.88/291.50 with precondition: [V1=0,Out=1,V>=1] 1110.88/291.50 1110.88/291.50 1110.88/291.50 #### Cost of chains of aver(V,V1,Out): 1110.88/291.50 * Chain [[21],18]: 4*it(21)+1*s(1)+1*s(2)+1*s(7)+1*s(8)+4 1110.88/291.50 Such that:s(2) =< V 1110.88/291.50 aux(1) =< V/2+1/2 1110.88/291.50 it(21) =< V/2-V1 1110.88/291.50 s(1) =< Out 1110.88/291.50 aux(2) =< it(21)*aux(1) 1110.88/291.50 s(7) =< it(21)*aux(1) 1110.88/291.50 s(8) =< aux(2)*2 1110.88/291.50 1110.88/291.50 with precondition: [V1>=1,V+1>=2*Out,2*Out>=V,Out>=V1+1] 1110.88/291.50 1110.88/291.50 * Chain [22,[21],18]: 4*it(21)+1*s(1)+1*s(2)+1*s(7)+1*s(8)+8 1110.88/291.50 Such that:s(2) =< V 1110.88/291.50 it(21) =< V/2 1110.88/291.50 aux(1) =< V/2+1/2 1110.88/291.50 s(1) =< Out 1110.88/291.50 aux(2) =< it(21)*aux(1) 1110.88/291.50 s(7) =< it(21)*aux(1) 1110.88/291.50 s(8) =< aux(2)*2 1110.88/291.50 1110.88/291.50 with precondition: [V1=0,Out>=2,V+1>=2*Out,2*Out>=V] 1110.88/291.50 1110.88/291.50 * Chain [22,18]: 1*s(1)+1*s(2)+8 1110.88/291.50 Such that:s(1) =< 1 1110.88/291.50 s(2) =< V 1110.88/291.50 1110.88/291.50 with precondition: [V1=0,Out=1,2>=V,V>=1] 1110.88/291.50 1110.88/291.50 * Chain [20]: 4 1110.88/291.50 with precondition: [V=0,V1=0,Out=0] 1110.88/291.50 1110.88/291.50 * Chain [19]: 1*s(9)+4 1110.88/291.50 Such that:s(9) =< V1 1110.88/291.50 1110.88/291.50 with precondition: [V=0,V1=Out,V1>=1] 1110.88/291.50 1110.88/291.50 * Chain [18]: 1*s(1)+1*s(2)+4 1110.88/291.50 Such that:s(2) =< V 1110.88/291.50 s(1) =< V1 1110.88/291.50 1110.88/291.50 with precondition: [V1=Out,V>=1,V1>=1,2*V1>=V] 1110.88/291.50 1110.88/291.50 1110.88/291.50 #### Cost of chains of plus(V,V1,Out): 1110.88/291.50 * Chain [[24],23]: 1*it(24)+1 1110.88/291.50 Such that:it(24) =< -V1+Out 1110.88/291.50 1110.88/291.50 with precondition: [V+V1=Out,V>=1,V1>=0] 1110.88/291.50 1110.88/291.50 * Chain [23]: 1 1110.88/291.50 with precondition: [V=0,V1=Out,V1>=0] 1110.88/291.50 1110.88/291.50 1110.88/291.50 #### Cost of chains of average(V,V1,Out): 1110.88/291.50 * Chain [29]: 6 1110.88/291.50 with precondition: [V=0,V1=0,Out=0] 1110.88/291.50 1110.88/291.50 * Chain [28]: 1*s(10)+1*s(11)+10 1110.88/291.50 Such that:s(10) =< 1 1110.88/291.50 s(11) =< V1 1110.88/291.50 1110.88/291.50 with precondition: [V=0,Out=1,2>=V1,V1>=1] 1110.88/291.50 1110.88/291.50 * Chain [27]: 1*s(12)+4*s(13)+1*s(15)+1*s(17)+1*s(18)+10 1110.88/291.50 Such that:s(12) =< V1 1110.88/291.50 s(13) =< V1/2 1110.88/291.50 aux(3) =< V1/2+1/2 1110.88/291.50 s(15) =< aux(3) 1110.88/291.50 s(16) =< s(13)*aux(3) 1110.88/291.50 s(17) =< s(13)*aux(3) 1110.88/291.50 s(18) =< s(16)*2 1110.88/291.50 1110.88/291.50 with precondition: [V=0,Out>=2,V1+1>=2*Out,2*Out>=V1] 1110.88/291.50 1110.88/291.50 * Chain [26]: 1*s(19)+1*s(20)+1*s(21)+10 1110.88/291.50 Such that:s(20) =< 1 1110.88/291.50 s(19) =< V 1110.88/291.50 s(21) =< V+V1 1110.88/291.50 1110.88/291.50 with precondition: [Out=1,V>=1,V1>=0,2>=V+V1] 1110.88/291.50 1110.88/291.50 * Chain [25]: 1*s(22)+1*s(23)+4*s(24)+1*s(26)+1*s(28)+1*s(29)+10 1110.88/291.50 Such that:s(22) =< V 1110.88/291.50 s(23) =< V+V1 1110.88/291.50 s(24) =< V/2+V1/2 1110.88/291.50 aux(4) =< V/2+V1/2+1/2 1110.88/291.50 s(26) =< aux(4) 1110.88/291.50 s(27) =< s(24)*aux(4) 1110.88/291.50 s(28) =< s(24)*aux(4) 1110.88/291.50 s(29) =< s(27)*2 1110.88/291.50 1110.88/291.50 with precondition: [V>=1,V1>=0,Out>=2,V+V1+1>=2*Out,2*Out>=V+V1] 1110.88/291.50 1110.88/291.50 1110.88/291.50 #### Cost of chains of start(V,V1,V16): 1110.88/291.50 * Chain [33]: 1*s(30)+3*s(31)+4*s(33)+1*s(35)+1*s(37)+1*s(38)+10 1110.88/291.50 Such that:s(30) =< 1 1110.88/291.50 s(33) =< V1/2 1110.88/291.50 s(34) =< V1/2+1/2 1110.88/291.50 aux(5) =< V1 1110.88/291.50 s(31) =< aux(5) 1110.88/291.50 s(35) =< s(34) 1110.88/291.50 s(36) =< s(33)*s(34) 1110.88/291.50 s(37) =< s(33)*s(34) 1110.88/291.50 s(38) =< s(36)*2 1110.88/291.50 1110.88/291.50 with precondition: [V=0] 1110.88/291.50 1110.88/291.50 * Chain [32]: 1*s(40)+9*s(41)+2*s(42)+2*s(45)+2*s(47)+4*s(50)+1*s(52)+1*s(54)+1*s(55)+4*s(59)+2*s(61)+1*s(63)+1*s(64)+4*s(69)+1*s(72)+1*s(73)+10 1110.88/291.50 Such that:s(59) =< V/2 1110.88/291.50 s(69) =< V/2-V1 1110.88/291.50 s(50) =< V/2+V1/2 1110.88/291.50 s(51) =< V/2+V1/2+1/2 1110.88/291.50 s(40) =< V16+1 1110.88/291.50 aux(8) =< 1 1110.88/291.50 aux(9) =< V 1110.88/291.50 aux(10) =< V+V1 1110.88/291.50 aux(11) =< V/2+1/2 1110.88/291.50 aux(12) =< V1 1110.88/291.50 s(45) =< aux(8) 1110.88/291.50 s(41) =< aux(9) 1110.88/291.50 s(47) =< aux(10) 1110.88/291.50 s(42) =< aux(12) 1110.88/291.50 s(52) =< s(51) 1110.88/291.50 s(53) =< s(50)*s(51) 1110.88/291.50 s(54) =< s(50)*s(51) 1110.88/291.50 s(55) =< s(53)*2 1110.88/291.50 s(61) =< aux(11) 1110.88/291.50 s(62) =< s(59)*aux(11) 1110.88/291.50 s(63) =< s(59)*aux(11) 1110.88/291.50 s(64) =< s(62)*2 1110.88/291.50 s(71) =< s(69)*aux(11) 1110.88/291.50 s(72) =< s(69)*aux(11) 1110.88/291.50 s(73) =< s(71)*2 1110.88/291.50 1110.88/291.50 with precondition: [V>=1] 1110.88/291.50 1110.88/291.50 * Chain [31]: 1*s(74)+1*s(75)+5 1110.88/291.50 Such that:s(74) =< V1 1110.88/291.50 s(75) =< V16+1 1110.88/291.50 1110.88/291.50 with precondition: [V=1,V1>=1,V16>=0,2*V16+2>=V1] 1110.88/291.50 1110.88/291.50 * Chain [30]: 1*s(76)+4*s(78)+1*s(79)+1*s(81)+1*s(82)+5 1110.88/291.50 Such that:s(76) =< V1 1110.88/291.50 s(78) =< V1/2-V16 1110.88/291.50 aux(13) =< V1/2+1/2 1110.88/291.50 s(79) =< aux(13) 1110.88/291.50 s(80) =< s(78)*aux(13) 1110.88/291.50 s(81) =< s(78)*aux(13) 1110.88/291.50 s(82) =< s(80)*2 1110.88/291.50 1110.88/291.50 with precondition: [V=1,V16>=0,V1>=2*V16+3] 1110.88/291.50 1110.88/291.50 1110.88/291.50 Closed-form bounds of start(V,V1,V16): 1110.88/291.50 ------------------------------------- 1110.88/291.50 * Chain [33] with precondition: [V=0] 1110.88/291.50 - Upper bound: nat(V1)*3+11+nat(V1/2+1/2)+nat(V1/2+1/2)*3*nat(V1/2)+nat(V1/2)*4 1110.88/291.50 - Complexity: n^2 1110.88/291.50 * Chain [32] with precondition: [V>=1] 1110.88/291.50 - Upper bound: 9*V+12+nat(V1)*2+nat(V+V1)*2+nat(V16+1)+nat(V/2+V1/2+1/2)+nat(V/2+V1/2+1/2)*3*nat(V/2+V1/2)+nat(V/2+V1/2)*4+(V+1)+(3/2*V+3/2)*nat(V/2-V1)+V/2*(3/2*V+3/2)+nat(V/2-V1)*4+2*V 1110.88/291.50 - Complexity: n^2 1110.88/291.50 * Chain [31] with precondition: [V=1,V1>=1,V16>=0,2*V16+2>=V1] 1110.88/291.50 - Upper bound: V1+V16+6 1110.88/291.50 - Complexity: n 1110.88/291.50 * Chain [30] with precondition: [V=1,V16>=0,V1>=2*V16+3] 1110.88/291.50 - Upper bound: 2*V1-4*V16+(3/2*V1+11/2+(V1/2-V16)*(3/2*V1+3/2)) 1110.88/291.50 - Complexity: n^2 1110.88/291.50 1110.88/291.50 ### Maximum cost of start(V,V1,V16): nat(V1)+5+max([max([nat(V16+1),nat(V1/2+1/2)*3*nat(V1/2-V16)+nat(V1/2+1/2)+nat(V1/2-V16)*4]),nat(V1)+6+max([nat(V1/2+1/2)+nat(V1)+nat(V1/2+1/2)*3*nat(V1/2)+nat(V1/2)*4,9*V+1+nat(V+V1)*2+nat(V16+1)+nat(V/2+V1/2+1/2)+nat(V/2+V1/2+1/2)*3*nat(V/2+V1/2)+nat(V/2+V1/2)*4+(V+1)+(3/2*V+3/2)*nat(V/2-V1)+V/2*(3/2*V+3/2)+nat(V/2-V1)*4+2*V])]) 1110.88/291.50 Asymptotic class: n^2 1110.88/291.50 * Total analysis performed in 330 ms. 1110.88/291.50 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (10) 1110.88/291.50 BOUNDS(1, n^2) 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (11) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) 1110.88/291.50 Transformed a relative TRS into a decreasing-loop problem. 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (12) 1110.88/291.50 Obligation: 1110.88/291.50 Analyzing the following TRS for decreasing loops: 1110.88/291.50 1110.88/291.50 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1110.88/291.50 1110.88/291.50 1110.88/291.50 The TRS R consists of the following rules: 1110.88/291.50 1110.88/291.50 gt(0, y) -> false 1110.88/291.50 gt(s(x), 0) -> true 1110.88/291.50 gt(s(x), s(y)) -> gt(x, y) 1110.88/291.50 plus(0, y) -> y 1110.88/291.50 plus(s(x), y) -> s(plus(x, y)) 1110.88/291.50 double(0) -> 0 1110.88/291.50 double(s(x)) -> s(s(double(x))) 1110.88/291.50 average(x, y) -> aver(plus(x, y), 0) 1110.88/291.50 aver(sum, z) -> if(gt(sum, double(z)), sum, z) 1110.88/291.50 if(true, sum, z) -> aver(sum, s(z)) 1110.88/291.50 if(false, sum, z) -> z 1110.88/291.50 1110.88/291.50 S is empty. 1110.88/291.50 Rewrite Strategy: INNERMOST 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (13) DecreasingLoopProof (LOWER BOUND(ID)) 1110.88/291.50 The following loop(s) give(s) rise to the lower bound Omega(n^1): 1110.88/291.50 1110.88/291.50 The rewrite sequence 1110.88/291.50 1110.88/291.50 gt(s(x), s(y)) ->^+ gt(x, y) 1110.88/291.50 1110.88/291.50 gives rise to a decreasing loop by considering the right hand sides subterm at position []. 1110.88/291.50 1110.88/291.50 The pumping substitution is [x / s(x), y / s(y)]. 1110.88/291.50 1110.88/291.50 The result substitution is [ ]. 1110.88/291.50 1110.88/291.50 1110.88/291.50 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (14) 1110.88/291.50 Complex Obligation (BEST) 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (15) 1110.88/291.50 Obligation: 1110.88/291.50 Proved the lower bound n^1 for the following obligation: 1110.88/291.50 1110.88/291.50 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1110.88/291.50 1110.88/291.50 1110.88/291.50 The TRS R consists of the following rules: 1110.88/291.50 1110.88/291.50 gt(0, y) -> false 1110.88/291.50 gt(s(x), 0) -> true 1110.88/291.50 gt(s(x), s(y)) -> gt(x, y) 1110.88/291.50 plus(0, y) -> y 1110.88/291.50 plus(s(x), y) -> s(plus(x, y)) 1110.88/291.50 double(0) -> 0 1110.88/291.50 double(s(x)) -> s(s(double(x))) 1110.88/291.50 average(x, y) -> aver(plus(x, y), 0) 1110.88/291.50 aver(sum, z) -> if(gt(sum, double(z)), sum, z) 1110.88/291.50 if(true, sum, z) -> aver(sum, s(z)) 1110.88/291.50 if(false, sum, z) -> z 1110.88/291.50 1110.88/291.50 S is empty. 1110.88/291.50 Rewrite Strategy: INNERMOST 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (16) LowerBoundPropagationProof (FINISHED) 1110.88/291.50 Propagated lower bound. 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (17) 1110.88/291.50 BOUNDS(n^1, INF) 1110.88/291.50 1110.88/291.50 ---------------------------------------- 1110.88/291.50 1110.88/291.50 (18) 1110.88/291.50 Obligation: 1110.88/291.50 Analyzing the following TRS for decreasing loops: 1110.88/291.50 1110.88/291.50 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1110.88/291.50 1110.88/291.50 1110.88/291.50 The TRS R consists of the following rules: 1110.88/291.50 1110.88/291.50 gt(0, y) -> false 1110.88/291.50 gt(s(x), 0) -> true 1110.88/291.50 gt(s(x), s(y)) -> gt(x, y) 1110.88/291.50 plus(0, y) -> y 1110.88/291.50 plus(s(x), y) -> s(plus(x, y)) 1110.88/291.50 double(0) -> 0 1110.88/291.50 double(s(x)) -> s(s(double(x))) 1110.88/291.50 average(x, y) -> aver(plus(x, y), 0) 1110.88/291.50 aver(sum, z) -> if(gt(sum, double(z)), sum, z) 1110.88/291.50 if(true, sum, z) -> aver(sum, s(z)) 1110.88/291.50 if(false, sum, z) -> z 1110.88/291.50 1110.88/291.50 S is empty. 1110.88/291.50 Rewrite Strategy: INNERMOST 1111.09/291.56 EOF