WORST_CASE(?,O(n^1)) proof of input_pIyVOyUeL1.trs # AProVE Commit ID: 5b976082cb74a395683ed8cc7acf94bd611ab29f fuhs 20230524 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1). (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, 1108 ms] (18) BOUNDS(1, n^1) ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: minus(x, 0) -> x minus(s(x), s(y)) -> minus(x, y) double(0) -> 0 double(s(x)) -> s(s(double(x))) plus(0, y) -> y plus(s(x), y) -> s(plus(x, y)) plus(s(x), y) -> plus(x, s(y)) plus(s(x), y) -> s(plus(minus(x, y), double(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, 0) -> z0 minus(s(z0), s(z1)) -> minus(z0, z1) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) plus(0, z0) -> z0 plus(s(z0), z1) -> s(plus(z0, z1)) plus(s(z0), z1) -> plus(z0, s(z1)) plus(s(z0), z1) -> s(plus(minus(z0, z1), double(z1))) Tuples: MINUS(z0, 0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) DOUBLE(0) -> c2 DOUBLE(s(z0)) -> c3(DOUBLE(z0)) PLUS(0, z0) -> c4 PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) S tuples: MINUS(z0, 0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) DOUBLE(0) -> c2 DOUBLE(s(z0)) -> c3(DOUBLE(z0)) PLUS(0, z0) -> c4 PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) K tuples:none Defined Rule Symbols: minus_2, double_1, plus_2 Defined Pair Symbols: MINUS_2, DOUBLE_1, PLUS_2 Compound Symbols: c, c1_1, c2, c3_1, c4, c5_1, c6_1, c7_2, c8_2 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 3 trailing nodes: PLUS(0, z0) -> c4 DOUBLE(0) -> c2 MINUS(z0, 0) -> c ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: minus(z0, 0) -> z0 minus(s(z0), s(z1)) -> minus(z0, z1) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) plus(0, z0) -> z0 plus(s(z0), z1) -> s(plus(z0, z1)) plus(s(z0), z1) -> plus(z0, s(z1)) plus(s(z0), z1) -> s(plus(minus(z0, z1), double(z1))) Tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) DOUBLE(s(z0)) -> c3(DOUBLE(z0)) PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) S tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) DOUBLE(s(z0)) -> c3(DOUBLE(z0)) PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) K tuples:none Defined Rule Symbols: minus_2, double_1, plus_2 Defined Pair Symbols: MINUS_2, DOUBLE_1, PLUS_2 Compound Symbols: c1_1, c3_1, c5_1, c6_1, c7_2, c8_2 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: plus(0, z0) -> z0 plus(s(z0), z1) -> s(plus(z0, z1)) plus(s(z0), z1) -> plus(z0, s(z1)) plus(s(z0), z1) -> s(plus(minus(z0, z1), double(z1))) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: minus(z0, 0) -> z0 minus(s(z0), s(z1)) -> minus(z0, z1) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) Tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) DOUBLE(s(z0)) -> c3(DOUBLE(z0)) PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) S tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) DOUBLE(s(z0)) -> c3(DOUBLE(z0)) PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) K tuples:none Defined Rule Symbols: minus_2, double_1 Defined Pair Symbols: MINUS_2, DOUBLE_1, PLUS_2 Compound Symbols: c1_1, c3_1, c5_1, c6_1, c7_2, c8_2 ---------------------------------------- (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^1). The TRS R consists of the following rules: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) DOUBLE(s(z0)) -> c3(DOUBLE(z0)) PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) The (relative) TRS S consists of the following rules: minus(z0, 0) -> z0 minus(s(z0), s(z1)) -> minus(z0, z1) double(0) -> 0 double(s(z0)) -> s(s(double(z0))) 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^1). The TRS R consists of the following rules: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) [1] DOUBLE(s(z0)) -> c3(DOUBLE(z0)) [1] PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) [1] PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) [1] PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) [1] PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) [1] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] double(0) -> 0 [0] double(s(z0)) -> s(s(double(z0))) [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(s(z0), s(z1)) -> c1(MINUS(z0, z1)) [1] DOUBLE(s(z0)) -> c3(DOUBLE(z0)) [1] PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) [1] PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) [1] PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) [1] PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) [1] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] double(0) -> 0 [0] double(s(z0)) -> s(s(double(z0))) [0] The TRS has the following type information: MINUS :: s:0 -> s:0 -> c1 s :: s:0 -> s:0 c1 :: c1 -> c1 DOUBLE :: s:0 -> c3 c3 :: c3 -> c3 PLUS :: s:0 -> s:0 -> c5:c6:c7:c8 c5 :: c5:c6:c7:c8 -> c5:c6:c7:c8 c6 :: c5:c6:c7:c8 -> c5:c6:c7:c8 c7 :: c5:c6:c7:c8 -> c1 -> c5:c6:c7:c8 minus :: s:0 -> s:0 -> s:0 double :: s:0 -> s:0 c8 :: c5:c6:c7:c8 -> c3 -> c5:c6:c7:c8 0 :: s:0 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: minus(v0, v1) -> null_minus [0] double(v0) -> null_double [0] MINUS(v0, v1) -> null_MINUS [0] DOUBLE(v0) -> null_DOUBLE [0] PLUS(v0, v1) -> null_PLUS [0] And the following fresh constants: null_minus, null_double, null_MINUS, null_DOUBLE, null_PLUS ---------------------------------------- (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(s(z0), s(z1)) -> c1(MINUS(z0, z1)) [1] DOUBLE(s(z0)) -> c3(DOUBLE(z0)) [1] PLUS(s(z0), z1) -> c5(PLUS(z0, z1)) [1] PLUS(s(z0), z1) -> c6(PLUS(z0, s(z1))) [1] PLUS(s(z0), z1) -> c7(PLUS(minus(z0, z1), double(z1)), MINUS(z0, z1)) [1] PLUS(s(z0), z1) -> c8(PLUS(minus(z0, z1), double(z1)), DOUBLE(z1)) [1] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] double(0) -> 0 [0] double(s(z0)) -> s(s(double(z0))) [0] minus(v0, v1) -> null_minus [0] double(v0) -> null_double [0] MINUS(v0, v1) -> null_MINUS [0] DOUBLE(v0) -> null_DOUBLE [0] PLUS(v0, v1) -> null_PLUS [0] The TRS has the following type information: MINUS :: s:0:null_minus:null_double -> s:0:null_minus:null_double -> c1:null_MINUS s :: s:0:null_minus:null_double -> s:0:null_minus:null_double c1 :: c1:null_MINUS -> c1:null_MINUS DOUBLE :: s:0:null_minus:null_double -> c3:null_DOUBLE c3 :: c3:null_DOUBLE -> c3:null_DOUBLE PLUS :: s:0:null_minus:null_double -> s:0:null_minus:null_double -> c5:c6:c7:c8:null_PLUS c5 :: c5:c6:c7:c8:null_PLUS -> c5:c6:c7:c8:null_PLUS c6 :: c5:c6:c7:c8:null_PLUS -> c5:c6:c7:c8:null_PLUS c7 :: c5:c6:c7:c8:null_PLUS -> c1:null_MINUS -> c5:c6:c7:c8:null_PLUS minus :: s:0:null_minus:null_double -> s:0:null_minus:null_double -> s:0:null_minus:null_double double :: s:0:null_minus:null_double -> s:0:null_minus:null_double c8 :: c5:c6:c7:c8:null_PLUS -> c3:null_DOUBLE -> c5:c6:c7:c8:null_PLUS 0 :: s:0:null_minus:null_double null_minus :: s:0:null_minus:null_double null_double :: s:0:null_minus:null_double null_MINUS :: c1:null_MINUS null_DOUBLE :: c3:null_DOUBLE null_PLUS :: c5:c6:c7:c8:null_PLUS 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: 0 => 0 null_minus => 0 null_double => 0 null_MINUS => 0 null_DOUBLE => 0 null_PLUS => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: DOUBLE(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 DOUBLE(z) -{ 1 }-> 1 + DOUBLE(z0) :|: z = 1 + z0, z0 >= 0 MINUS(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 MINUS(z, z') -{ 1 }-> 1 + MINUS(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 PLUS(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 PLUS(z, z') -{ 1 }-> 1 + PLUS(z0, z1) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 PLUS(z, z') -{ 1 }-> 1 + PLUS(z0, 1 + z1) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 PLUS(z, z') -{ 1 }-> 1 + PLUS(minus(z0, z1), double(z1)) + MINUS(z0, z1) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 PLUS(z, z') -{ 1 }-> 1 + PLUS(minus(z0, z1), double(z1)) + DOUBLE(z1) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 double(z) -{ 0 }-> 0 :|: z = 0 double(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 double(z) -{ 0 }-> 1 + (1 + double(z0)) :|: z = 1 + z0, z0 >= 0 minus(z, z') -{ 0 }-> z0 :|: z = z0, z0 >= 0, z' = 0 minus(z, z') -{ 0 }-> minus(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 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),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[fun1(V1, Out)],[V1 >= 0]). eq(start(V1, V),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[minus(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[double(V1, Out)],[V1 >= 0]). eq(fun(V1, V, Out),1,[fun(V3, V2, Ret1)],[Out = 1 + Ret1,V2 >= 0,V1 = 1 + V3,V3 >= 0,V = 1 + V2]). eq(fun1(V1, Out),1,[fun1(V4, Ret11)],[Out = 1 + Ret11,V1 = 1 + V4,V4 >= 0]). eq(fun2(V1, V, Out),1,[fun2(V6, V5, Ret12)],[Out = 1 + Ret12,V5 >= 0,V1 = 1 + V6,V = V5,V6 >= 0]). eq(fun2(V1, V, Out),1,[fun2(V7, 1 + V8, Ret13)],[Out = 1 + Ret13,V8 >= 0,V1 = 1 + V7,V = V8,V7 >= 0]). eq(fun2(V1, V, Out),1,[minus(V9, V10, Ret010),double(V10, Ret011),fun2(Ret010, Ret011, Ret01),fun(V9, V10, Ret14)],[Out = 1 + Ret01 + Ret14,V10 >= 0,V1 = 1 + V9,V = V10,V9 >= 0]). eq(fun2(V1, V, Out),1,[minus(V12, V11, Ret0101),double(V11, Ret0111),fun2(Ret0101, Ret0111, Ret012),fun1(V11, Ret15)],[Out = 1 + Ret012 + Ret15,V11 >= 0,V1 = 1 + V12,V = V11,V12 >= 0]). eq(minus(V1, V, Out),0,[],[Out = V13,V1 = V13,V13 >= 0,V = 0]). eq(minus(V1, V, Out),0,[minus(V15, V14, Ret)],[Out = Ret,V14 >= 0,V1 = 1 + V15,V15 >= 0,V = 1 + V14]). eq(double(V1, Out),0,[],[Out = 0,V1 = 0]). eq(double(V1, Out),0,[double(V16, Ret111)],[Out = 2 + Ret111,V1 = 1 + V16,V16 >= 0]). eq(minus(V1, V, Out),0,[],[Out = 0,V18 >= 0,V17 >= 0,V1 = V18,V = V17]). eq(double(V1, Out),0,[],[Out = 0,V19 >= 0,V1 = V19]). eq(fun(V1, V, Out),0,[],[Out = 0,V21 >= 0,V20 >= 0,V1 = V21,V = V20]). eq(fun1(V1, Out),0,[],[Out = 0,V22 >= 0,V1 = V22]). eq(fun2(V1, V, Out),0,[],[Out = 0,V23 >= 0,V24 >= 0,V1 = V23,V = V24]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,Out),[V1],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(minus(V1,V,Out),[V1,V],[Out]). input_output_vars(double(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [double/2] 1. recursive : [fun/3] 2. recursive : [fun1/2] 3. recursive : [minus/3] 4. recursive [non_tail] : [fun2/3] 5. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into double/2 1. SCC is partially evaluated into fun/3 2. SCC is partially evaluated into fun1/2 3. SCC is partially evaluated into minus/3 4. SCC is partially evaluated into fun2/3 5. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations double/2 * CE 18 is refined into CE [20] * CE 19 is refined into CE [21] ### Cost equations --> "Loop" of double/2 * CEs [21] --> Loop 14 * CEs [20] --> Loop 15 ### Ranking functions of CR double(V1,Out) * RF of phase [14]: [V1] #### Partial ranking functions of CR double(V1,Out) * Partial RF of phase [14]: - RF of loop [14:1]: V1 ### Specialization of cost equations fun/3 * CE 7 is refined into CE [22] * CE 6 is refined into CE [23] ### Cost equations --> "Loop" of fun/3 * CEs [23] --> Loop 16 * CEs [22] --> Loop 17 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [16]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [16]: - RF of loop [16:1]: V V1 ### Specialization of cost equations fun1/2 * CE 9 is refined into CE [24] * CE 8 is refined into CE [25] ### Cost equations --> "Loop" of fun1/2 * CEs [25] --> Loop 18 * CEs [24] --> Loop 19 ### Ranking functions of CR fun1(V1,Out) * RF of phase [18]: [V1] #### Partial ranking functions of CR fun1(V1,Out) * Partial RF of phase [18]: - RF of loop [18:1]: V1 ### Specialization of cost equations minus/3 * CE 17 is refined into CE [26] * CE 15 is refined into CE [27] * CE 16 is refined into CE [28] ### Cost equations --> "Loop" of minus/3 * CEs [28] --> Loop 20 * CEs [26] --> Loop 21 * CEs [27] --> Loop 22 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [20]: [V,V1] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [20]: - RF of loop [20:1]: V V1 ### Specialization of cost equations fun2/3 * CE 14 is refined into CE [29] * CE 10 is refined into CE [30] * CE 11 is refined into CE [31] * CE 12 is refined into CE [32,33,34,35,36,37,38,39,40] * CE 13 is refined into CE [41,42,43,44,45,46,47,48,49] ### Cost equations --> "Loop" of fun2/3 * CEs [40,49] --> Loop 23 * CEs [39,48] --> Loop 24 * CEs [31] --> Loop 25 * CEs [38,47] --> Loop 26 * CEs [37,46] --> Loop 27 * CEs [36,45] --> Loop 28 * CEs [35,44] --> Loop 29 * CEs [34,43] --> Loop 30 * CEs [33,42] --> Loop 31 * CEs [30,32,41] --> Loop 32 * CEs [29] --> Loop 33 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [23,24,25,26,27,32]: [V1,2*V1-1] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [23,24,25,26,27,32]: - RF of loop [23:1,24:1]: V1+V-2 V1/3-V/3 - RF of loop [23:1,24:1,26:1,27:1]: V1/2-1/2 - RF of loop [25:1,32:1]: V1 - RF of loop [26:1,27:1]: V depends on loops [23:1,24:1,25:1] V1-V ### Specialization of cost equations start/2 * CE 1 is refined into CE [50,51] * CE 2 is refined into CE [52,53] * CE 3 is refined into CE [54,55,56,57] * CE 4 is refined into CE [58,59,60] * CE 5 is refined into CE [61,62] ### Cost equations --> "Loop" of start/2 * CEs [50,51,52,53,54,55,56,57,58,59,60,61,62] --> Loop 34 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of double(V1,Out): * Chain [[14],15]: 0 with precondition: [Out>=2,2*V1>=Out] * Chain [15]: 0 with precondition: [Out=0,V1>=0] #### Cost of chains of fun(V1,V,Out): * Chain [[16],17]: 1*it(16)+0 Such that:it(16) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [17]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun1(V1,Out): * Chain [[18],19]: 1*it(18)+0 Such that:it(18) =< Out with precondition: [Out>=1,V1>=Out] * Chain [19]: 0 with precondition: [Out=0,V1>=0] #### Cost of chains of minus(V1,V,Out): * Chain [[20],22]: 0 with precondition: [V1=Out+V,V>=1,V1>=V] * Chain [[20],21]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [22]: 0 with precondition: [V=0,V1=Out,V1>=0] * Chain [21]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun2(V1,V,Out): * Chain [[23,24,25,26,27,32],33]: 1*it(23)+1*it(24)+2*it(25)+1*it(26)+1*it(27)+2*s(9)+2*s(11)+0 Such that:aux(25) =< V1-V aux(27) =< V1+V aux(31) =< 2*V1+V aux(36) =< V1/3-V/3 aux(40) =< V1 aux(41) =< 2*V1 aux(42) =< 3*V1 aux(43) =< V1/2 aux(44) =< V aux(45) =< 2*V it(23) =< aux(40) it(24) =< aux(40) it(25) =< aux(40) it(26) =< aux(40) it(27) =< aux(40) it(26) =< aux(25) it(27) =< aux(25) it(26) =< aux(42) it(27) =< aux(42) it(25) =< aux(42) it(23) =< aux(27) it(24) =< aux(27) it(26) =< aux(27) it(27) =< aux(27) it(23) =< aux(41) it(24) =< aux(41) it(26) =< aux(41) it(27) =< aux(41) it(25) =< aux(41) aux(3) =< aux(31) it(24) =< aux(31) it(25) =< aux(31) it(26) =< aux(31) it(27) =< aux(31) s(12) =< aux(31) aux(3) =< aux(42) it(24) =< aux(42) s(12) =< aux(42) it(23) =< aux(43) it(24) =< aux(43) it(26) =< aux(43) it(27) =< aux(43) it(23) =< aux(36) it(24) =< aux(36) it(23) =< aux(42) it(26) =< it(25)+aux(3)+aux(3)+aux(44) it(27) =< it(25)+aux(3)+aux(3)+aux(44) aux(11) =< aux(3)*2 it(27) =< it(25)*2+aux(11)+aux(11)+aux(45) s(12) =< it(25)*2+aux(11)+aux(11)+aux(45) s(12) =< it(26)*aux(27) s(11) =< s(12) s(9) =< aux(3) with precondition: [V>=0,Out>=1,V1>=Out] * Chain [[23,24,25,26,27,32],31,33]: 1*it(23)+1*it(24)+2*it(25)+1*it(26)+1*it(27)+2*s(9)+2*s(11)+1 Such that:aux(25) =< V1-V aux(27) =< V1+V aux(31) =< 2*V1+V aux(36) =< V1/3-V/3 aux(46) =< V1 aux(47) =< 2*V1 aux(48) =< 3*V1 aux(49) =< V1/2 aux(50) =< V aux(51) =< 2*V it(23) =< aux(46) it(24) =< aux(46) it(25) =< aux(46) it(26) =< aux(46) it(27) =< aux(46) it(26) =< aux(25) it(27) =< aux(25) it(26) =< aux(48) it(27) =< aux(48) it(25) =< aux(48) it(23) =< aux(27) it(24) =< aux(27) it(26) =< aux(27) it(27) =< aux(27) it(23) =< aux(47) it(24) =< aux(47) it(26) =< aux(47) it(27) =< aux(47) it(25) =< aux(47) aux(3) =< aux(31) it(24) =< aux(31) it(25) =< aux(31) it(26) =< aux(31) it(27) =< aux(31) s(12) =< aux(31) aux(3) =< aux(48) it(24) =< aux(48) s(12) =< aux(48) it(23) =< aux(49) it(24) =< aux(49) it(26) =< aux(49) it(27) =< aux(49) it(23) =< aux(36) it(24) =< aux(36) it(23) =< aux(48) it(26) =< it(25)+aux(3)+aux(3)+aux(50) it(27) =< it(25)+aux(3)+aux(3)+aux(50) aux(11) =< aux(3)*2 it(27) =< it(25)*2+aux(11)+aux(11)+aux(51) s(12) =< it(25)*2+aux(11)+aux(11)+aux(51) s(12) =< it(26)*aux(27) s(11) =< s(12) s(9) =< aux(3) with precondition: [V>=0,Out>=2,V1>=Out] * Chain [[23,24,25,26,27,32],30,33]: 1*it(23)+1*it(24)+1*it(25)+1*it(26)+1*it(27)+1*it(32)+4*s(9)+2*s(11)+1 Such that:aux(25) =< V1-V aux(36) =< V1/3-V/3 aux(38) =< V aux(13) =< 2*V aux(53) =< V1 aux(54) =< V1+V aux(55) =< 2*V1 aux(56) =< 2*V1+V aux(57) =< 3*V1 aux(58) =< V1/2 s(9) =< aux(56) it(23) =< aux(53) it(24) =< aux(53) it(25) =< aux(53) it(26) =< aux(53) it(27) =< aux(53) it(32) =< aux(53) it(26) =< aux(25) it(27) =< aux(25) it(26) =< aux(57) it(27) =< aux(57) it(32) =< aux(57) it(23) =< aux(54) it(24) =< aux(54) it(26) =< aux(54) it(27) =< aux(54) it(32) =< aux(54) it(23) =< aux(55) it(24) =< aux(55) it(25) =< aux(55) it(26) =< aux(55) it(27) =< aux(55) it(32) =< aux(55) it(24) =< aux(56) it(25) =< aux(56) it(26) =< aux(56) it(27) =< aux(56) it(32) =< aux(56) s(12) =< aux(56) it(23) =< aux(58) it(24) =< aux(58) it(26) =< aux(58) it(27) =< aux(58) it(23) =< aux(36) it(24) =< aux(36) it(23) =< aux(57) it(24) =< aux(57) it(26) =< it(25)+aux(56)+aux(56)+aux(38) it(27) =< it(25)+aux(56)+aux(56)+aux(38) aux(11) =< aux(56)*2 it(26) =< it(25)+aux(56)+aux(56)+aux(53) it(27) =< it(25)+aux(56)+aux(56)+aux(53) it(27) =< it(25)*2+aux(11)+aux(11)+aux(55) s(12) =< it(25)*2+aux(11)+aux(11)+aux(55) it(27) =< it(25)*2+aux(11)+aux(11)+aux(13) s(12) =< it(25)*2+aux(11)+aux(11)+aux(13) s(12) =< it(26)*aux(54) s(11) =< s(12) with precondition: [V1>=2,V>=0,Out>=3,V+2*V1>=Out+1] * Chain [[23,24,25,26,27,32],29,33]: 1*it(23)+1*it(24)+2*it(25)+1*it(26)+1*it(27)+2*s(9)+2*s(11)+1 Such that:aux(25) =< V1-V aux(27) =< V1+V aux(31) =< 2*V1+V aux(36) =< V1/3-V/3 aux(38) =< V aux(13) =< 2*V aux(59) =< V1 aux(60) =< 2*V1 aux(61) =< 3*V1 aux(62) =< V1/2 it(23) =< aux(59) it(24) =< aux(59) it(25) =< aux(59) it(26) =< aux(59) it(27) =< aux(59) it(26) =< aux(25) it(27) =< aux(25) it(26) =< aux(61) it(27) =< aux(61) it(25) =< aux(61) it(23) =< aux(27) it(24) =< aux(27) it(26) =< aux(27) it(27) =< aux(27) it(23) =< aux(60) it(24) =< aux(60) it(26) =< aux(60) it(27) =< aux(60) it(25) =< aux(60) aux(3) =< aux(31) it(24) =< aux(31) it(25) =< aux(31) it(26) =< aux(31) it(27) =< aux(31) s(12) =< aux(31) aux(3) =< aux(61) it(24) =< aux(61) s(12) =< aux(61) it(23) =< aux(62) it(24) =< aux(62) it(26) =< aux(62) it(27) =< aux(62) it(23) =< aux(36) it(24) =< aux(36) it(23) =< aux(61) it(26) =< it(25)+aux(3)+aux(3)+aux(38) it(27) =< it(25)+aux(3)+aux(3)+aux(38) aux(11) =< aux(3)*2 it(26) =< it(25)+aux(3)+aux(3)+aux(59) it(27) =< it(25)+aux(3)+aux(3)+aux(59) it(27) =< it(25)*2+aux(11)+aux(11)+aux(60) s(12) =< it(25)*2+aux(11)+aux(11)+aux(60) it(27) =< it(25)*2+aux(11)+aux(11)+aux(13) s(12) =< it(25)*2+aux(11)+aux(11)+aux(13) s(12) =< it(26)*aux(27) s(11) =< s(12) s(9) =< aux(3) with precondition: [V>=0,Out>=2,V1>=Out] * Chain [[23,24,25,26,27,32],28,33]: 1*it(23)+1*it(24)+1*it(25)+1*it(26)+1*it(27)+1*it(32)+2*s(9)+2*s(11)+2*s(15)+1 Such that:aux(25) =< V1-V aux(31) =< 2*V1+V aux(32) =< 3*V1 aux(34) =< V1/2 aux(36) =< V1/3-V/3 aux(38) =< V aux(13) =< 2*V aux(63) =< V1 aux(64) =< V1+V aux(65) =< 2*V1 s(15) =< aux(64) it(23) =< aux(63) it(24) =< aux(63) it(25) =< aux(63) it(26) =< aux(63) it(27) =< aux(63) it(32) =< aux(63) it(26) =< aux(25) it(27) =< aux(25) it(26) =< aux(65) it(27) =< aux(65) it(32) =< aux(65) it(23) =< aux(64) it(24) =< aux(64) it(26) =< aux(64) it(27) =< aux(64) it(32) =< aux(64) it(23) =< aux(65) it(24) =< aux(65) it(25) =< aux(65) aux(3) =< aux(31) it(24) =< aux(31) it(25) =< aux(31) it(26) =< aux(31) it(27) =< aux(31) it(32) =< aux(31) s(12) =< aux(31) aux(3) =< aux(32) it(24) =< aux(32) it(25) =< aux(32) it(26) =< aux(32) it(27) =< aux(32) it(32) =< aux(32) s(12) =< aux(32) it(23) =< aux(34) it(24) =< aux(34) it(26) =< aux(34) it(27) =< aux(34) it(23) =< aux(36) it(24) =< aux(36) it(26) =< it(25)+aux(3)+aux(3)+aux(38) it(27) =< it(25)+aux(3)+aux(3)+aux(38) aux(11) =< aux(3)*2 it(26) =< it(25)+aux(3)+aux(3)+aux(63) it(27) =< it(25)+aux(3)+aux(3)+aux(63) it(27) =< it(25)*2+aux(11)+aux(11)+aux(65) s(12) =< it(25)*2+aux(11)+aux(11)+aux(65) it(27) =< it(25)*2+aux(11)+aux(11)+aux(13) s(12) =< it(25)*2+aux(11)+aux(11)+aux(13) s(12) =< it(26)*aux(64) s(11) =< s(12) s(9) =< aux(3) with precondition: [V1>=2,V>=0,Out>=3,V+2*V1>=Out+1] * Chain [33]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [31,33]: 1 with precondition: [Out=1,V1>=1,V>=0] * Chain [30,33]: 2*s(13)+1 Such that:aux(52) =< V s(13) =< aux(52) with precondition: [V1>=1,Out>=2,V+1>=Out] * Chain [29,33]: 1 with precondition: [Out=1,V1>=1,V>=1] * Chain [28,33]: 1*s(15)+1*s(16)+1 Such that:s(15) =< V1 s(16) =< V with precondition: [V1>=1,Out>=2,V+1>=Out] #### Cost of chains of start(V1,V): * Chain [34]: 4*s(123)+2*s(124)+4*s(135)+5*s(136)+7*s(137)+2*s(138)+2*s(139)+4*s(143)+8*s(144)+2*s(145)+2*s(146)+4*s(148)+2*s(162)+1*s(163)+2*s(168)+4*s(174)+1*s(176)+1*s(177)+1*s(178)+2*s(181)+1 Such that:aux(87) =< V1 aux(88) =< V1-V aux(89) =< V1+V aux(90) =< 2*V1 aux(91) =< 2*V1+V aux(92) =< 3*V1 aux(93) =< V1/2 aux(94) =< V1/3-V/3 aux(95) =< V aux(96) =< 2*V s(124) =< aux(87) s(123) =< aux(95) s(135) =< aux(87) s(136) =< aux(87) s(137) =< aux(87) s(138) =< aux(87) s(139) =< aux(87) s(138) =< aux(88) s(139) =< aux(88) s(138) =< aux(92) s(139) =< aux(92) s(137) =< aux(92) s(135) =< aux(89) s(136) =< aux(89) s(138) =< aux(89) s(139) =< aux(89) s(135) =< aux(90) s(136) =< aux(90) s(138) =< aux(90) s(139) =< aux(90) s(137) =< aux(90) s(140) =< aux(91) s(136) =< aux(91) s(137) =< aux(91) s(138) =< aux(91) s(139) =< aux(91) s(141) =< aux(91) s(140) =< aux(92) s(136) =< aux(92) s(141) =< aux(92) s(135) =< aux(93) s(136) =< aux(93) s(138) =< aux(93) s(139) =< aux(93) s(135) =< aux(94) s(136) =< aux(94) s(135) =< aux(92) s(138) =< s(137)+s(140)+s(140)+aux(95) s(139) =< s(137)+s(140)+s(140)+aux(95) s(142) =< s(140)*2 s(138) =< s(137)+s(140)+s(140)+aux(87) s(139) =< s(137)+s(140)+s(140)+aux(87) s(139) =< s(137)*2+s(142)+s(142)+aux(90) s(141) =< s(137)*2+s(142)+s(142)+aux(90) s(139) =< s(137)*2+s(142)+s(142)+aux(96) s(141) =< s(137)*2+s(142)+s(142)+aux(96) s(141) =< s(138)*aux(89) s(143) =< s(141) s(144) =< s(140) s(145) =< aux(87) s(146) =< aux(87) s(145) =< aux(88) s(146) =< aux(88) s(145) =< aux(92) s(146) =< aux(92) s(145) =< aux(89) s(146) =< aux(89) s(145) =< aux(90) s(146) =< aux(90) s(145) =< aux(91) s(146) =< aux(91) s(147) =< aux(91) s(147) =< aux(92) s(145) =< aux(93) s(146) =< aux(93) s(145) =< s(137)+s(140)+s(140)+aux(95) s(146) =< s(137)+s(140)+s(140)+aux(95) s(146) =< s(137)*2+s(142)+s(142)+aux(96) s(147) =< s(137)*2+s(142)+s(142)+aux(96) s(147) =< s(145)*aux(89) s(148) =< s(147) s(162) =< aux(89) s(163) =< aux(87) s(168) =< aux(87) s(168) =< aux(90) s(163) =< aux(89) s(168) =< aux(89) s(163) =< aux(90) s(168) =< aux(91) s(168) =< aux(92) s(163) =< aux(93) s(163) =< aux(94) s(174) =< aux(91) s(176) =< aux(87) s(177) =< aux(87) s(178) =< aux(87) s(177) =< aux(88) s(178) =< aux(88) s(177) =< aux(92) s(178) =< aux(92) s(177) =< aux(89) s(178) =< aux(89) s(176) =< aux(90) s(177) =< aux(90) s(178) =< aux(90) s(176) =< aux(91) s(177) =< aux(91) s(178) =< aux(91) s(179) =< aux(91) s(177) =< aux(93) s(178) =< aux(93) s(177) =< s(176)+aux(91)+aux(91)+aux(95) s(178) =< s(176)+aux(91)+aux(91)+aux(95) s(180) =< aux(91)*2 s(177) =< s(176)+aux(91)+aux(91)+aux(87) s(178) =< s(176)+aux(91)+aux(91)+aux(87) s(178) =< s(176)*2+s(180)+s(180)+aux(90) s(179) =< s(176)*2+s(180)+s(180)+aux(90) s(178) =< s(176)*2+s(180)+s(180)+aux(96) s(179) =< s(176)*2+s(180)+s(180)+aux(96) s(179) =< s(177)*aux(89) s(181) =< s(179) with precondition: [V1>=0] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [34] with precondition: [V1>=0] - Upper bound: 32*V1+1+nat(V)*4+nat(V1+V)*2+nat(2*V1+V)*22 - Complexity: n ### Maximum cost of start(V1,V): 32*V1+1+nat(V)*4+nat(V1+V)*2+nat(2*V1+V)*22 Asymptotic class: n * Total analysis performed in 993 ms. ---------------------------------------- (18) BOUNDS(1, n^1)