WORST_CASE(?,O(n^2)) proof of input_8Mm4N6IHRD.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2). (0) CpxTRS (1) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (2) CdtProblem (3) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CdtProblem (5) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxRelTRS (9) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxWeightedTrs (11) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTypedWeightedTrs (13) CompletionProof [UPPER BOUND(ID), 0 ms] (14) CpxTypedWeightedCompleteTrs (15) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (16) CpxRNTS (17) CompleteCoflocoProof [FINISHED, 858 ms] (18) BOUNDS(1, n^2) ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: minus(x, y) -> cond(equal(min(x, y), y), x, y) cond(true, x, y) -> s(minus(x, s(y))) min(0, v) -> 0 min(u, 0) -> 0 min(s(u), s(v)) -> s(min(u, v)) equal(0, 0) -> true equal(s(x), 0) -> false equal(0, s(y)) -> false equal(s(x), s(y)) -> equal(x, y) S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (1) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (2) Obligation: Complexity Dependency Tuples Problem Rules: minus(z0, z1) -> cond(equal(min(z0, z1), z1), z0, z1) cond(true, z0, z1) -> s(minus(z0, s(z1))) min(0, z0) -> 0 min(z0, 0) -> 0 min(s(z0), s(z1)) -> s(min(z0, z1)) equal(0, 0) -> true equal(s(z0), 0) -> false equal(0, s(z0)) -> false equal(s(z0), s(z1)) -> equal(z0, z1) Tuples: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) MIN(0, z0) -> c2 MIN(z0, 0) -> c3 MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) EQUAL(0, 0) -> c5 EQUAL(s(z0), 0) -> c6 EQUAL(0, s(z0)) -> c7 EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) MIN(0, z0) -> c2 MIN(z0, 0) -> c3 MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) EQUAL(0, 0) -> c5 EQUAL(s(z0), 0) -> c6 EQUAL(0, s(z0)) -> c7 EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, cond_3, min_2, equal_2 Defined Pair Symbols: MINUS_2, COND_3, MIN_2, EQUAL_2 Compound Symbols: c_3, c1_1, c2, c3, c4_1, c5, c6, c7, c8_1 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 5 trailing nodes: EQUAL(0, 0) -> c5 EQUAL(s(z0), 0) -> c6 MIN(0, z0) -> c2 EQUAL(0, s(z0)) -> c7 MIN(z0, 0) -> c3 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: minus(z0, z1) -> cond(equal(min(z0, z1), z1), z0, z1) cond(true, z0, z1) -> s(minus(z0, s(z1))) min(0, z0) -> 0 min(z0, 0) -> 0 min(s(z0), s(z1)) -> s(min(z0, z1)) equal(0, 0) -> true equal(s(z0), 0) -> false equal(0, s(z0)) -> false equal(s(z0), s(z1)) -> equal(z0, z1) Tuples: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, cond_3, min_2, equal_2 Defined Pair Symbols: MINUS_2, COND_3, MIN_2, EQUAL_2 Compound Symbols: c_3, c1_1, c4_1, c8_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: minus(z0, z1) -> cond(equal(min(z0, z1), z1), z0, z1) cond(true, z0, z1) -> s(minus(z0, s(z1))) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: equal(0, 0) -> true equal(s(z0), 0) -> false equal(0, s(z0)) -> false equal(s(z0), s(z1)) -> equal(z0, z1) min(0, z0) -> 0 min(z0, 0) -> 0 min(s(z0), s(z1)) -> s(min(z0, z1)) Tuples: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) S tuples: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) K tuples:none Defined Rule Symbols: equal_2, min_2 Defined Pair Symbols: MINUS_2, COND_3, MIN_2, EQUAL_2 Compound Symbols: c_3, c1_1, c4_1, c8_1 ---------------------------------------- (7) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (8) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) The (relative) TRS S consists of the following rules: equal(0, 0) -> true equal(s(z0), 0) -> false equal(0, s(z0)) -> false equal(s(z0), s(z1)) -> equal(z0, z1) min(0, z0) -> 0 min(z0, 0) -> 0 min(s(z0), s(z1)) -> s(min(z0, z1)) Rewrite Strategy: INNERMOST ---------------------------------------- (9) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (10) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) [1] COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) [1] MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) [1] EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) [1] equal(0, 0) -> true [0] equal(s(z0), 0) -> false [0] equal(0, s(z0)) -> false [0] equal(s(z0), s(z1)) -> equal(z0, z1) [0] min(0, z0) -> 0 [0] min(z0, 0) -> 0 [0] min(s(z0), s(z1)) -> s(min(z0, z1)) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (11) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (12) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) [1] COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) [1] MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) [1] EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) [1] equal(0, 0) -> true [0] equal(s(z0), 0) -> false [0] equal(0, s(z0)) -> false [0] equal(s(z0), s(z1)) -> equal(z0, z1) [0] min(0, z0) -> 0 [0] min(z0, 0) -> 0 [0] min(s(z0), s(z1)) -> s(min(z0, z1)) [0] The TRS has the following type information: MINUS :: s:0 -> s:0 -> c c :: c1 -> c8 -> c4 -> c COND :: true:false -> s:0 -> s:0 -> c1 equal :: s:0 -> s:0 -> true:false min :: s:0 -> s:0 -> s:0 EQUAL :: s:0 -> s:0 -> c8 MIN :: s:0 -> s:0 -> c4 true :: true:false c1 :: c -> c1 s :: s:0 -> s:0 c4 :: c4 -> c4 c8 :: c8 -> c8 0 :: s:0 false :: true:false Rewrite Strategy: INNERMOST ---------------------------------------- (13) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: equal(v0, v1) -> null_equal [0] min(v0, v1) -> null_min [0] COND(v0, v1, v2) -> null_COND [0] MIN(v0, v1) -> null_MIN [0] EQUAL(v0, v1) -> null_EQUAL [0] And the following fresh constants: null_equal, null_min, null_COND, null_MIN, null_EQUAL, const ---------------------------------------- (14) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: MINUS(z0, z1) -> c(COND(equal(min(z0, z1), z1), z0, z1), EQUAL(min(z0, z1), z1), MIN(z0, z1)) [1] COND(true, z0, z1) -> c1(MINUS(z0, s(z1))) [1] MIN(s(z0), s(z1)) -> c4(MIN(z0, z1)) [1] EQUAL(s(z0), s(z1)) -> c8(EQUAL(z0, z1)) [1] equal(0, 0) -> true [0] equal(s(z0), 0) -> false [0] equal(0, s(z0)) -> false [0] equal(s(z0), s(z1)) -> equal(z0, z1) [0] min(0, z0) -> 0 [0] min(z0, 0) -> 0 [0] min(s(z0), s(z1)) -> s(min(z0, z1)) [0] equal(v0, v1) -> null_equal [0] min(v0, v1) -> null_min [0] COND(v0, v1, v2) -> null_COND [0] MIN(v0, v1) -> null_MIN [0] EQUAL(v0, v1) -> null_EQUAL [0] The TRS has the following type information: MINUS :: s:0:null_min -> s:0:null_min -> c c :: c1:null_COND -> c8:null_EQUAL -> c4:null_MIN -> c COND :: true:false:null_equal -> s:0:null_min -> s:0:null_min -> c1:null_COND equal :: s:0:null_min -> s:0:null_min -> true:false:null_equal min :: s:0:null_min -> s:0:null_min -> s:0:null_min EQUAL :: s:0:null_min -> s:0:null_min -> c8:null_EQUAL MIN :: s:0:null_min -> s:0:null_min -> c4:null_MIN true :: true:false:null_equal c1 :: c -> c1:null_COND s :: s:0:null_min -> s:0:null_min c4 :: c4:null_MIN -> c4:null_MIN c8 :: c8:null_EQUAL -> c8:null_EQUAL 0 :: s:0:null_min false :: true:false:null_equal null_equal :: true:false:null_equal null_min :: s:0:null_min null_COND :: c1:null_COND null_MIN :: c4:null_MIN null_EQUAL :: c8:null_EQUAL const :: c Rewrite Strategy: INNERMOST ---------------------------------------- (15) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: true => 2 0 => 0 false => 1 null_equal => 0 null_min => 0 null_COND => 0 null_MIN => 0 null_EQUAL => 0 const => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: COND(z, z', z'') -{ 0 }-> 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0 COND(z, z', z'') -{ 1 }-> 1 + MINUS(z0, 1 + z1) :|: z = 2, z1 >= 0, z0 >= 0, z' = z0, z'' = z1 EQUAL(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 EQUAL(z, z') -{ 1 }-> 1 + EQUAL(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 MIN(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 MIN(z, z') -{ 1 }-> 1 + MIN(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 MINUS(z, z') -{ 1 }-> 1 + COND(equal(min(z0, z1), z1), z0, z1) + EQUAL(min(z0, z1), z1) + MIN(z0, z1) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 equal(z, z') -{ 0 }-> equal(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 equal(z, z') -{ 0 }-> 2 :|: z = 0, z' = 0 equal(z, z') -{ 0 }-> 1 :|: z = 1 + z0, z0 >= 0, z' = 0 equal(z, z') -{ 0 }-> 1 :|: z0 >= 0, z' = 1 + z0, z = 0 equal(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 min(z, z') -{ 0 }-> 0 :|: z0 >= 0, z = 0, z' = z0 min(z, z') -{ 0 }-> 0 :|: z = z0, z0 >= 0, z' = 0 min(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 min(z, z') -{ 0 }-> 1 + min(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (17) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V, V4),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[fun1(V1, V, V4, Out)],[V1 >= 0,V >= 0,V4 >= 0]). eq(start(V1, V, V4),0,[fun3(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[equal(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V4),0,[min(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[min(V3, V2, Ret00100),equal(Ret00100, V2, Ret0010),fun1(Ret0010, V3, V2, Ret001),min(V3, V2, Ret010),fun2(Ret010, V2, Ret01),fun3(V3, V2, Ret1)],[Out = 1 + Ret001 + Ret01 + Ret1,V1 = V3,V2 >= 0,V = V2,V3 >= 0]). eq(fun1(V1, V, V4, Out),1,[fun(V6, 1 + V5, Ret11)],[Out = 1 + Ret11,V1 = 2,V5 >= 0,V6 >= 0,V = V6,V4 = V5]). eq(fun3(V1, V, Out),1,[fun3(V8, V7, Ret12)],[Out = 1 + Ret12,V7 >= 0,V1 = 1 + V8,V8 >= 0,V = 1 + V7]). eq(fun2(V1, V, Out),1,[fun2(V9, V10, Ret13)],[Out = 1 + Ret13,V10 >= 0,V1 = 1 + V9,V9 >= 0,V = 1 + V10]). eq(equal(V1, V, Out),0,[],[Out = 2,V1 = 0,V = 0]). eq(equal(V1, V, Out),0,[],[Out = 1,V1 = 1 + V11,V11 >= 0,V = 0]). eq(equal(V1, V, Out),0,[],[Out = 1,V12 >= 0,V = 1 + V12,V1 = 0]). eq(equal(V1, V, Out),0,[equal(V14, V13, Ret)],[Out = Ret,V13 >= 0,V1 = 1 + V14,V14 >= 0,V = 1 + V13]). eq(min(V1, V, Out),0,[],[Out = 0,V15 >= 0,V1 = 0,V = V15]). eq(min(V1, V, Out),0,[],[Out = 0,V1 = V16,V16 >= 0,V = 0]). eq(min(V1, V, Out),0,[min(V17, V18, Ret14)],[Out = 1 + Ret14,V18 >= 0,V1 = 1 + V17,V17 >= 0,V = 1 + V18]). eq(equal(V1, V, Out),0,[],[Out = 0,V20 >= 0,V19 >= 0,V1 = V20,V = V19]). eq(min(V1, V, Out),0,[],[Out = 0,V22 >= 0,V21 >= 0,V1 = V22,V = V21]). eq(fun1(V1, V, V4, Out),0,[],[Out = 0,V24 >= 0,V4 = V25,V23 >= 0,V1 = V24,V = V23,V25 >= 0]). eq(fun3(V1, V, Out),0,[],[Out = 0,V26 >= 0,V27 >= 0,V1 = V26,V = V27]). eq(fun2(V1, V, Out),0,[],[Out = 0,V29 >= 0,V28 >= 0,V1 = V29,V = V28]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,V4,Out),[V1,V,V4],[Out]). input_output_vars(fun3(V1,V,Out),[V1,V],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(equal(V1,V,Out),[V1,V],[Out]). input_output_vars(min(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [equal/3] 1. recursive : [fun2/3] 2. recursive : [fun3/3] 3. recursive : [min/3] 4. recursive [non_tail] : [fun/3,fun1/4] 5. non_recursive : [start/3] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into equal/3 1. SCC is partially evaluated into fun2/3 2. SCC is partially evaluated into fun3/3 3. SCC is partially evaluated into min/3 4. SCC is partially evaluated into fun/3 5. SCC is partially evaluated into start/3 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations equal/3 * CE 18 is refined into CE [22] * CE 15 is refined into CE [23] * CE 16 is refined into CE [24] * CE 14 is refined into CE [25] * CE 17 is refined into CE [26] ### Cost equations --> "Loop" of equal/3 * CEs [26] --> Loop 15 * CEs [22] --> Loop 16 * CEs [23] --> Loop 17 * CEs [24] --> Loop 18 * CEs [25] --> Loop 19 ### Ranking functions of CR equal(V1,V,Out) * RF of phase [15]: [V,V1] #### Partial ranking functions of CR equal(V1,V,Out) * Partial RF of phase [15]: - RF of loop [15:1]: V V1 ### Specialization of cost equations fun2/3 * CE 13 is refined into CE [27] * CE 12 is refined into CE [28] ### Cost equations --> "Loop" of fun2/3 * CEs [28] --> Loop 20 * CEs [27] --> Loop 21 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [20]: [V,V1] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [20]: - RF of loop [20:1]: V V1 ### Specialization of cost equations fun3/3 * CE 11 is refined into CE [29] * CE 10 is refined into CE [30] ### Cost equations --> "Loop" of fun3/3 * CEs [30] --> Loop 22 * CEs [29] --> Loop 23 ### Ranking functions of CR fun3(V1,V,Out) * RF of phase [22]: [V,V1] #### Partial ranking functions of CR fun3(V1,V,Out) * Partial RF of phase [22]: - RF of loop [22:1]: V V1 ### Specialization of cost equations min/3 * CE 19 is refined into CE [31] * CE 20 is refined into CE [32] * CE 21 is refined into CE [33] ### Cost equations --> "Loop" of min/3 * CEs [33] --> Loop 24 * CEs [31,32] --> Loop 25 ### Ranking functions of CR min(V1,V,Out) * RF of phase [24]: [V,V1] #### Partial ranking functions of CR min(V1,V,Out) * Partial RF of phase [24]: - RF of loop [24:1]: V V1 ### Specialization of cost equations fun/3 * CE 9 is refined into CE [34,35,36,37,38,39,40] * CE 8 is refined into CE [41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71] ### Cost equations --> "Loop" of fun/3 * CEs [71] --> Loop 26 * CEs [67,69,70] --> Loop 27 * CEs [47,53,59,65] --> Loop 28 * CEs [43,45,46,49,51,52,55,57,58,61,63,64] --> Loop 29 * CEs [41,42,44,48,50,54,56,60,62,66,68] --> Loop 30 * CEs [40] --> Loop 31 * CEs [36,38,39] --> Loop 32 * CEs [35,37] --> Loop 33 * CEs [34] --> Loop 34 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [31,32,33]: [V1-V+1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [31,32,33]: - RF of loop [31:1,32:1,33:1]: V1-V+1 ### Specialization of cost equations start/3 * CE 1 is refined into CE [72] * CE 2 is refined into CE [73,74,75,76] * CE 3 is refined into CE [77,78,79,80,81,82,83] * CE 4 is refined into CE [84,85] * CE 5 is refined into CE [86,87] * CE 6 is refined into CE [88,89,90,91,92,93,94] * CE 7 is refined into CE [95,96] ### Cost equations --> "Loop" of start/3 * CEs [94] --> Loop 35 * CEs [73,74,75,76] --> Loop 36 * CEs [89] --> Loop 37 * CEs [72,77,78,79,80,81,82,83,84,85,86,87,88,90,91,92,93,95,96] --> Loop 38 ### Ranking functions of CR start(V1,V,V4) #### Partial ranking functions of CR start(V1,V,V4) Computing Bounds ===================================== #### Cost of chains of equal(V1,V,Out): * Chain [[15],19]: 0 with precondition: [Out=2,V1=V,V1>=1] * Chain [[15],18]: 0 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[15],17]: 0 with precondition: [Out=1,V>=1,V1>=V+1] * Chain [[15],16]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [19]: 0 with precondition: [V1=0,V=0,Out=2] * Chain [18]: 0 with precondition: [V1=0,Out=1,V>=1] * Chain [17]: 0 with precondition: [V=0,Out=1,V1>=1] * Chain [16]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun2(V1,V,Out): * Chain [[20],21]: 1*it(20)+0 Such that:it(20) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [21]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun3(V1,V,Out): * Chain [[22],23]: 1*it(22)+0 Such that:it(22) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [23]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of min(V1,V,Out): * Chain [[24],25]: 0 with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [25]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun(V1,V,Out): * Chain [[31,32,33],30]: 6*it(31)+2*s(10)+3*s(12)+1 Such that:aux(3) =< V1+1 aux(7) =< V1-V+1 it(31) =< aux(7) aux(4) =< aux(3) s(11) =< it(31)*aux(3) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V>=1,Out>=3,V1>=V] * Chain [[31,32,33],29]: 6*it(31)+2*s(10)+3*s(12)+9*s(14)+3*s(23)+1 Such that:aux(8) =< V1 aux(10) =< V1+1 aux(11) =< V1-V+1 s(23) =< aux(8) s(14) =< aux(10) it(31) =< aux(11) aux(4) =< aux(10) s(11) =< it(31)*aux(10) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V>=1,Out>=4,V1>=V] * Chain [[31,32,33],28]: 6*it(31)+2*s(10)+3*s(12)+5*s(26)+3*s(27)+1 Such that:aux(13) =< V1 aux(15) =< V1+1 aux(16) =< V1-V+1 s(26) =< aux(13) s(27) =< aux(15) it(31) =< aux(16) aux(4) =< aux(15) s(11) =< it(31)*aux(15) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V>=1,Out>=5,V1>=V] * Chain [[31,32,33],27]: 6*it(31)+2*s(10)+3*s(12)+3*s(34)+1 Such that:aux(17) =< V1 aux(3) =< V1+1 aux(6) =< V1-V aux(5) =< V1-V+1 s(34) =< aux(17) it(31) =< aux(5) it(31) =< aux(6) aux(4) =< aux(3) s(11) =< it(31)*aux(3) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V>=1,Out>=4,V1>=V+1] * Chain [[31,32,33],26]: 6*it(31)+2*s(10)+3*s(12)+2*s(37)+1 Such that:aux(18) =< V1 aux(3) =< V1+1 aux(6) =< V1-V aux(5) =< V1-V+1 s(37) =< aux(18) it(31) =< aux(5) it(31) =< aux(6) aux(4) =< aux(3) s(11) =< it(31)*aux(3) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V>=1,Out>=5,V1>=V+1] * Chain [34,[31,32,33],30]: 6*it(31)+2*s(10)+3*s(12)+3 Such that:aux(7) =< V1 aux(3) =< V1+1 it(31) =< aux(7) aux(4) =< aux(3) s(11) =< it(31)*aux(3) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V=0,V1>=1,Out>=5] * Chain [34,[31,32,33],29]: 9*it(31)+2*s(10)+3*s(12)+9*s(14)+3 Such that:aux(10) =< V1+1 aux(19) =< V1 it(31) =< aux(19) s(14) =< aux(10) aux(4) =< aux(10) s(11) =< it(31)*aux(10) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V=0,V1>=1,Out>=6] * Chain [34,[31,32,33],28]: 11*it(31)+2*s(10)+3*s(12)+3*s(27)+3 Such that:aux(15) =< V1+1 aux(20) =< V1 it(31) =< aux(20) s(27) =< aux(15) aux(4) =< aux(15) s(11) =< it(31)*aux(15) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V=0,V1>=1,Out>=7] * Chain [34,[31,32,33],27]: 9*it(31)+2*s(10)+3*s(12)+3 Such that:aux(3) =< V1+1 aux(21) =< V1 it(31) =< aux(21) aux(4) =< aux(3) s(11) =< it(31)*aux(3) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V=0,V1>=2,Out>=6] * Chain [34,[31,32,33],26]: 8*it(31)+2*s(10)+3*s(12)+3 Such that:aux(3) =< V1+1 aux(22) =< V1 it(31) =< aux(22) aux(4) =< aux(3) s(11) =< it(31)*aux(3) s(13) =< it(31)*aux(4) s(12) =< s(13) s(10) =< s(11) with precondition: [V=0,V1>=2,Out>=7] * Chain [34,30]: 3 with precondition: [V=0,Out=3,V1>=0] * Chain [34,29]: 9*s(14)+3*s(23)+3 Such that:aux(9) =< 1 aux(8) =< V1 s(23) =< aux(8) s(14) =< aux(9) with precondition: [V=0,Out=4,V1>=1] * Chain [34,28]: 5*s(26)+3*s(27)+3 Such that:aux(14) =< 1 aux(13) =< V1 s(26) =< aux(13) s(27) =< aux(14) with precondition: [V=0,Out=5,V1>=1] * Chain [34,27]: 3*s(34)+3 Such that:aux(17) =< 1 s(34) =< aux(17) with precondition: [V=0,Out=4,V1>=1] * Chain [34,26]: 2*s(37)+3 Such that:aux(18) =< 1 s(37) =< aux(18) with precondition: [V=0,Out=5,V1>=1] * Chain [30]: 1 with precondition: [Out=1,V1>=0,V>=0] * Chain [29]: 9*s(14)+3*s(23)+1 Such that:aux(8) =< V1 aux(9) =< V s(23) =< aux(8) s(14) =< aux(9) with precondition: [Out>=2,V1+1>=Out,V+1>=Out] * Chain [28]: 5*s(26)+3*s(27)+1 Such that:aux(13) =< V1 aux(14) =< V s(26) =< aux(13) s(27) =< aux(14) with precondition: [Out>=3,2*V1+1>=Out,2*V+1>=Out] * Chain [27]: 3*s(34)+1 Such that:aux(17) =< V s(34) =< aux(17) with precondition: [Out>=2,V1>=V,V+1>=Out] * Chain [26]: 2*s(37)+1 Such that:aux(18) =< V s(37) =< aux(18) with precondition: [Out>=3,V1>=V,2*V+1>=Out] #### Cost of chains of start(V1,V,V4): * Chain [38]: 17*s(155)+72*s(156)+15*s(165)+10*s(166)+24*s(167)+12*s(174)+6*s(178)+4*s(179)+18*s(181)+9*s(184)+6*s(185)+19*s(186)+3 Such that:s(171) =< V1-V s(172) =< V1-V+1 aux(32) =< 1 aux(33) =< V1 aux(34) =< V1+1 aux(35) =< V s(186) =< aux(35) s(155) =< aux(32) s(156) =< aux(33) s(162) =< aux(34) s(163) =< s(156)*aux(34) s(164) =< s(156)*s(162) s(165) =< s(164) s(166) =< s(163) s(167) =< aux(34) s(174) =< s(172) s(174) =< s(171) s(176) =< s(174)*aux(34) s(177) =< s(174)*s(162) s(178) =< s(177) s(179) =< s(176) s(181) =< s(172) s(182) =< s(181)*aux(34) s(183) =< s(181)*s(162) s(184) =< s(183) s(185) =< s(182) with precondition: [V1>=0,V>=0] * Chain [37]: 0 with precondition: [V1=0,V>=1] * Chain [36]: 21*s(202)+30*s(203)+15*s(207)+10*s(208)+12*s(209)+17*s(215)+2 Such that:s(199) =< V+1 aux(36) =< V-V4 aux(37) =< V aux(38) =< V4+1 s(202) =< aux(37) s(203) =< aux(36) s(204) =< s(199) s(205) =< s(203)*s(199) s(206) =< s(203)*s(204) s(207) =< s(206) s(208) =< s(205) s(209) =< s(199) s(215) =< aux(38) with precondition: [V1=2,V>=0,V4>=0] * Chain [35]: 0 with precondition: [V1=V,V1>=1] Closed-form bounds of start(V1,V,V4): ------------------------------------- * Chain [38] with precondition: [V1>=0,V>=0] - Upper bound: 72*V1+20+(V1+1)*(25*V1)+19*V+(24*V1+24)+(25*V1+25)*nat(V1-V+1)+nat(V1-V+1)*30 - Complexity: n^2 * Chain [37] with precondition: [V1=0,V>=1] - Upper bound: 0 - Complexity: constant * Chain [36] with precondition: [V1=2,V>=0,V4>=0] - Upper bound: 33*V+14+(25*V+25)*nat(V-V4)+(17*V4+17)+nat(V-V4)*30 - Complexity: n^2 * Chain [35] with precondition: [V1=V,V1>=1] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V,V4): 19*V+2+max([14*V+12+(25*V+25)*nat(V-V4)+nat(V4+1)*17+nat(V-V4)*30,72*V1+18+(V1+1)*(25*V1)+(24*V1+24)+(25*V1+25)*nat(V1-V+1)+nat(V1-V+1)*30]) Asymptotic class: n^2 * Total analysis performed in 839 ms. ---------------------------------------- (18) BOUNDS(1, n^2)