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