WORST_CASE(?,O(n^1)) proof of input_NxuqtFv0iF.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^1). (0) CpxTRS (1) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (2) CdtProblem (3) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CdtProblem (5) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CdtProblem (9) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxRelTRS (11) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxWeightedTrs (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxTypedWeightedTrs (15) CompletionProof [UPPER BOUND(ID), 0 ms] (16) CpxTypedWeightedCompleteTrs (17) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (18) CpxRNTS (19) CompleteCoflocoProof [FINISHED, 1119 ms] (20) 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: ge(x, 0) -> true ge(0, s(y)) -> false ge(s(x), s(y)) -> ge(x, y) minus(x, 0) -> x minus(0, y) -> 0 minus(s(x), s(y)) -> minus(x, y) id_inc(x) -> x id_inc(x) -> s(x) div(x, y) -> if(ge(y, s(0)), ge(x, y), x, y) if(false, b, x, y) -> div_by_zero if(true, false, x, y) -> 0 if(true, true, x, y) -> id_inc(div(minus(x, y), 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: ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) minus(z0, 0) -> z0 minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) id_inc(z0) -> z0 id_inc(z0) -> s(z0) div(z0, z1) -> if(ge(z1, s(0)), ge(z0, z1), z0, z1) if(false, z0, z1, z2) -> div_by_zero if(true, false, z0, z1) -> 0 if(true, true, z0, z1) -> id_inc(div(minus(z0, z1), z1)) Tuples: GE(z0, 0) -> c GE(0, s(z0)) -> c1 GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(z0, 0) -> c3 MINUS(0, z0) -> c4 MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) ID_INC(z0) -> c6 ID_INC(z0) -> c7 DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(false, z0, z1, z2) -> c10 IF(true, false, z0, z1) -> c11 IF(true, true, z0, z1) -> c12(ID_INC(div(minus(z0, z1), z1)), DIV(minus(z0, z1), z1), MINUS(z0, z1)) S tuples: GE(z0, 0) -> c GE(0, s(z0)) -> c1 GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(z0, 0) -> c3 MINUS(0, z0) -> c4 MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) ID_INC(z0) -> c6 ID_INC(z0) -> c7 DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(false, z0, z1, z2) -> c10 IF(true, false, z0, z1) -> c11 IF(true, true, z0, z1) -> c12(ID_INC(div(minus(z0, z1), z1)), DIV(minus(z0, z1), z1), MINUS(z0, z1)) K tuples:none Defined Rule Symbols: ge_2, minus_2, id_inc_1, div_2, if_4 Defined Pair Symbols: GE_2, MINUS_2, ID_INC_1, DIV_2, IF_4 Compound Symbols: c, c1, c2_1, c3, c4, c5_1, c6, c7, c8_2, c9_2, c10, c11, c12_3 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 8 trailing nodes: MINUS(0, z0) -> c4 MINUS(z0, 0) -> c3 IF(false, z0, z1, z2) -> c10 GE(z0, 0) -> c IF(true, false, z0, z1) -> c11 ID_INC(z0) -> c7 ID_INC(z0) -> c6 GE(0, s(z0)) -> c1 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) minus(z0, 0) -> z0 minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) id_inc(z0) -> z0 id_inc(z0) -> s(z0) div(z0, z1) -> if(ge(z1, s(0)), ge(z0, z1), z0, z1) if(false, z0, z1, z2) -> div_by_zero if(true, false, z0, z1) -> 0 if(true, true, z0, z1) -> id_inc(div(minus(z0, z1), z1)) Tuples: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(true, true, z0, z1) -> c12(ID_INC(div(minus(z0, z1), z1)), DIV(minus(z0, z1), z1), MINUS(z0, z1)) S tuples: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(true, true, z0, z1) -> c12(ID_INC(div(minus(z0, z1), z1)), DIV(minus(z0, z1), z1), MINUS(z0, z1)) K tuples:none Defined Rule Symbols: ge_2, minus_2, id_inc_1, div_2, if_4 Defined Pair Symbols: GE_2, MINUS_2, DIV_2, IF_4 Compound Symbols: c2_1, c5_1, c8_2, c9_2, c12_3 ---------------------------------------- (5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 1 trailing tuple parts ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: ge(z0, 0) -> true ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) minus(z0, 0) -> z0 minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) id_inc(z0) -> z0 id_inc(z0) -> s(z0) div(z0, z1) -> if(ge(z1, s(0)), ge(z0, z1), z0, z1) if(false, z0, z1, z2) -> div_by_zero if(true, false, z0, z1) -> 0 if(true, true, z0, z1) -> id_inc(div(minus(z0, z1), z1)) Tuples: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(true, true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) S tuples: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(true, true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) K tuples:none Defined Rule Symbols: ge_2, minus_2, id_inc_1, div_2, if_4 Defined Pair Symbols: GE_2, MINUS_2, DIV_2, IF_4 Compound Symbols: c2_1, c5_1, c8_2, c9_2, c12_2 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: id_inc(z0) -> z0 id_inc(z0) -> s(z0) div(z0, z1) -> if(ge(z1, s(0)), ge(z0, z1), z0, z1) if(false, z0, z1, z2) -> div_by_zero if(true, false, z0, z1) -> 0 if(true, true, z0, z1) -> id_inc(div(minus(z0, z1), z1)) ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) ge(z0, 0) -> true minus(z0, 0) -> z0 minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) Tuples: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(true, true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) S tuples: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(true, true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) K tuples:none Defined Rule Symbols: ge_2, minus_2 Defined Pair Symbols: GE_2, MINUS_2, DIV_2, IF_4 Compound Symbols: c2_1, c5_1, c8_2, c9_2, c12_2 ---------------------------------------- (9) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (10) 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: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) IF(true, true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) The (relative) TRS S consists of the following rules: ge(0, s(z0)) -> false ge(s(z0), s(z1)) -> ge(z0, z1) ge(z0, 0) -> true minus(z0, 0) -> z0 minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) Rewrite Strategy: INNERMOST ---------------------------------------- (11) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (12) 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: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) [1] MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) [1] DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) [1] DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) [1] IF(true, true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) [1] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] ge(z0, 0) -> true [0] minus(z0, 0) -> z0 [0] minus(0, z0) -> 0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) [1] MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) [1] DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) [1] DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) [1] IF(true, true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) [1] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] ge(z0, 0) -> true [0] minus(z0, 0) -> z0 [0] minus(0, z0) -> 0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] The TRS has the following type information: GE :: s:0 -> s:0 -> c2 s :: s:0 -> s:0 c2 :: c2 -> c2 MINUS :: s:0 -> s:0 -> c5 c5 :: c5 -> c5 DIV :: s:0 -> s:0 -> c8:c9 c8 :: c12 -> c2 -> c8:c9 IF :: true:false -> true:false -> s:0 -> s:0 -> c12 ge :: s:0 -> s:0 -> true:false 0 :: s:0 c9 :: c12 -> c2 -> c8:c9 true :: true:false c12 :: c8:c9 -> c5 -> c12 minus :: s:0 -> s:0 -> s:0 false :: true:false Rewrite Strategy: INNERMOST ---------------------------------------- (15) 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: ge(v0, v1) -> null_ge [0] minus(v0, v1) -> null_minus [0] GE(v0, v1) -> null_GE [0] MINUS(v0, v1) -> null_MINUS [0] IF(v0, v1, v2, v3) -> null_IF [0] And the following fresh constants: null_ge, null_minus, null_GE, null_MINUS, null_IF, const ---------------------------------------- (16) 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: GE(s(z0), s(z1)) -> c2(GE(z0, z1)) [1] MINUS(s(z0), s(z1)) -> c5(MINUS(z0, z1)) [1] DIV(z0, z1) -> c8(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z1, s(0))) [1] DIV(z0, z1) -> c9(IF(ge(z1, s(0)), ge(z0, z1), z0, z1), GE(z0, z1)) [1] IF(true, true, z0, z1) -> c12(DIV(minus(z0, z1), z1), MINUS(z0, z1)) [1] ge(0, s(z0)) -> false [0] ge(s(z0), s(z1)) -> ge(z0, z1) [0] ge(z0, 0) -> true [0] minus(z0, 0) -> z0 [0] minus(0, z0) -> 0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] ge(v0, v1) -> null_ge [0] minus(v0, v1) -> null_minus [0] GE(v0, v1) -> null_GE [0] MINUS(v0, v1) -> null_MINUS [0] IF(v0, v1, v2, v3) -> null_IF [0] The TRS has the following type information: GE :: s:0:null_minus -> s:0:null_minus -> c2:null_GE s :: s:0:null_minus -> s:0:null_minus c2 :: c2:null_GE -> c2:null_GE MINUS :: s:0:null_minus -> s:0:null_minus -> c5:null_MINUS c5 :: c5:null_MINUS -> c5:null_MINUS DIV :: s:0:null_minus -> s:0:null_minus -> c8:c9 c8 :: c12:null_IF -> c2:null_GE -> c8:c9 IF :: true:false:null_ge -> true:false:null_ge -> s:0:null_minus -> s:0:null_minus -> c12:null_IF ge :: s:0:null_minus -> s:0:null_minus -> true:false:null_ge 0 :: s:0:null_minus c9 :: c12:null_IF -> c2:null_GE -> c8:c9 true :: true:false:null_ge c12 :: c8:c9 -> c5:null_MINUS -> c12:null_IF minus :: s:0:null_minus -> s:0:null_minus -> s:0:null_minus false :: true:false:null_ge null_ge :: true:false:null_ge null_minus :: s:0:null_minus null_GE :: c2:null_GE null_MINUS :: c5:null_MINUS null_IF :: c12:null_IF const :: c8:c9 Rewrite Strategy: INNERMOST ---------------------------------------- (17) 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 true => 2 false => 1 null_ge => 0 null_minus => 0 null_GE => 0 null_MINUS => 0 null_IF => 0 const => 0 ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: DIV(z, z') -{ 1 }-> 1 + IF(ge(z1, 1 + 0), ge(z0, z1), z0, z1) + GE(z0, z1) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 DIV(z, z') -{ 1 }-> 1 + IF(ge(z1, 1 + 0), ge(z0, z1), z0, z1) + GE(z1, 1 + 0) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 GE(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 GE(z, z') -{ 1 }-> 1 + GE(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 IF(z, z', z'', z2) -{ 0 }-> 0 :|: z2 = v3, v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0, v3 >= 0 IF(z, z', z'', z2) -{ 1 }-> 1 + DIV(minus(z0, z1), z1) + MINUS(z0, z1) :|: z = 2, z1 >= 0, z' = 2, z2 = z1, z'' = 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 ge(z, z') -{ 0 }-> ge(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 ge(z, z') -{ 0 }-> 2 :|: z = z0, z0 >= 0, z' = 0 ge(z, z') -{ 0 }-> 1 :|: z0 >= 0, z' = 1 + z0, z = 0 ge(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 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 :|: z0 >= 0, z = 0, z' = z0 minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (19) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V, V12, V13),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V12, V13),0,[fun1(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V12, V13),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V12, V13),0,[fun3(V1, V, V12, V13, Out)],[V1 >= 0,V >= 0,V12 >= 0,V13 >= 0]). eq(start(V1, V, V12, V13),0,[ge(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V, V12, V13),0,[minus(V1, V, Out)],[V1 >= 0,V >= 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, V, Out),1,[fun1(V5, V4, Ret11)],[Out = 1 + Ret11,V4 >= 0,V1 = 1 + V5,V5 >= 0,V = 1 + V4]). eq(fun2(V1, V, Out),1,[ge(V6, 1 + 0, Ret010),ge(V7, V6, Ret011),fun3(Ret010, Ret011, V7, V6, Ret01),fun(V6, 1 + 0, Ret12)],[Out = 1 + Ret01 + Ret12,V1 = V7,V6 >= 0,V = V6,V7 >= 0]). eq(fun2(V1, V, Out),1,[ge(V9, 1 + 0, Ret0101),ge(V8, V9, Ret0111),fun3(Ret0101, Ret0111, V8, V9, Ret012),fun(V8, V9, Ret13)],[Out = 1 + Ret012 + Ret13,V1 = V8,V9 >= 0,V = V9,V8 >= 0]). eq(fun3(V1, V, V12, V13, Out),1,[minus(V11, V10, Ret0102),fun2(Ret0102, V10, Ret013),fun1(V11, V10, Ret14)],[Out = 1 + Ret013 + Ret14,V1 = 2,V10 >= 0,V = 2,V13 = V10,V12 = V11,V11 >= 0]). eq(ge(V1, V, Out),0,[],[Out = 1,V14 >= 0,V = 1 + V14,V1 = 0]). eq(ge(V1, V, Out),0,[ge(V16, V15, Ret)],[Out = Ret,V15 >= 0,V1 = 1 + V16,V16 >= 0,V = 1 + V15]). eq(ge(V1, V, Out),0,[],[Out = 2,V1 = V17,V17 >= 0,V = 0]). eq(minus(V1, V, Out),0,[],[Out = V18,V1 = V18,V18 >= 0,V = 0]). eq(minus(V1, V, Out),0,[],[Out = 0,V19 >= 0,V1 = 0,V = V19]). eq(minus(V1, V, Out),0,[minus(V21, V20, Ret2)],[Out = Ret2,V20 >= 0,V1 = 1 + V21,V21 >= 0,V = 1 + V20]). eq(ge(V1, V, Out),0,[],[Out = 0,V23 >= 0,V22 >= 0,V1 = V23,V = V22]). eq(minus(V1, V, Out),0,[],[Out = 0,V25 >= 0,V24 >= 0,V1 = V25,V = V24]). eq(fun(V1, V, Out),0,[],[Out = 0,V27 >= 0,V26 >= 0,V1 = V27,V = V26]). eq(fun1(V1, V, Out),0,[],[Out = 0,V28 >= 0,V29 >= 0,V1 = V28,V = V29]). eq(fun3(V1, V, V12, V13, Out),0,[],[Out = 0,V13 = V32,V31 >= 0,V12 = V33,V30 >= 0,V1 = V31,V = V30,V33 >= 0,V32 >= 0]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,Out),[V1,V],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(fun3(V1,V,V12,V13,Out),[V1,V,V12,V13],[Out]). input_output_vars(ge(V1,V,Out),[V1,V],[Out]). input_output_vars(minus(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun/3] 1. recursive : [fun1/3] 2. recursive : [minus/3] 3. recursive : [ge/3] 4. recursive [non_tail] : [fun2/3,fun3/5] 5. non_recursive : [start/4] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into fun1/3 2. SCC is partially evaluated into minus/3 3. SCC is partially evaluated into ge/3 4. SCC is partially evaluated into fun2/3 5. SCC is partially evaluated into start/4 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 18 is refined into CE [23] * CE 17 is refined into CE [24] ### Cost equations --> "Loop" of fun/3 * CEs [24] --> Loop 15 * CEs [23] --> Loop 16 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [15]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [15]: - RF of loop [15:1]: V V1 ### Specialization of cost equations fun1/3 * CE 16 is refined into CE [25] * CE 15 is refined into CE [26] ### Cost equations --> "Loop" of fun1/3 * CEs [26] --> Loop 17 * CEs [25] --> Loop 18 ### Ranking functions of CR fun1(V1,V,Out) * RF of phase [17]: [V,V1] #### Partial ranking functions of CR fun1(V1,V,Out) * Partial RF of phase [17]: - RF of loop [17:1]: V V1 ### Specialization of cost equations minus/3 * CE 9 is refined into CE [27] * CE 8 is refined into CE [28] * CE 10 is refined into CE [29] ### Cost equations --> "Loop" of minus/3 * CEs [29] --> Loop 19 * CEs [27] --> Loop 20 * CEs [28] --> Loop 21 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [19]: [V,V1] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [19]: - RF of loop [19:1]: V V1 ### Specialization of cost equations ge/3 * CE 22 is refined into CE [30] * CE 21 is refined into CE [31] * CE 19 is refined into CE [32] * CE 20 is refined into CE [33] ### Cost equations --> "Loop" of ge/3 * CEs [33] --> Loop 22 * CEs [30] --> Loop 23 * CEs [31] --> Loop 24 * CEs [32] --> Loop 25 ### Ranking functions of CR ge(V1,V,Out) * RF of phase [22]: [V,V1] #### Partial ranking functions of CR ge(V1,V,Out) * Partial RF of phase [22]: - RF of loop [22:1]: V V1 ### Specialization of cost equations fun2/3 * CE 13 is refined into CE [34,35,36,37,38,39,40,41] * CE 14 is refined into CE [42,43,44,45,46,47,48,49] * CE 11 is refined into CE [50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66] * CE 12 is refined into CE [67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85] ### Cost equations --> "Loop" of fun2/3 * CEs [59,66] --> Loop 26 * CEs [55,57,62,64] --> Loop 27 * CEs [50,51,53,67,68,71] --> Loop 28 * CEs [70,73,75,77,79,81,83,85] --> Loop 29 * CEs [52,54,56,58,60,61,63,65,69,72,74,76,78,80,82,84] --> Loop 30 * CEs [41,49] --> Loop 31 * CEs [39,40,47,48] --> Loop 32 * CEs [38,46] --> Loop 33 * CEs [37,45] --> Loop 34 * CEs [35,36,43,44] --> Loop 35 * CEs [34,42] --> Loop 36 ### Ranking functions of CR fun2(V1,V,Out) * RF of phase [31,32,33]: [V1,V1-V+1] #### Partial ranking functions of CR fun2(V1,V,Out) * Partial RF of phase [31,32,33]: - RF of loop [31:1,32:1,33:1]: V1 V1-V+1 ### Specialization of cost equations start/4 * CE 1 is refined into CE [86] * CE 2 is refined into CE [87,88,89,90,91,92,93,94,95,96,97,98,99,100,101] * CE 3 is refined into CE [102,103] * CE 4 is refined into CE [104,105] * CE 5 is refined into CE [106,107,108,109,110] * CE 6 is refined into CE [111,112,113,114,115] * CE 7 is refined into CE [116,117,118] ### Cost equations --> "Loop" of start/4 * CEs [112,116] --> Loop 37 * CEs [87,88,89,90,91,92,93,94,95,96,97,98,99,100,101] --> Loop 38 * CEs [86,102,103,104,105,106,107,108,109,110,111,113,114,115,117,118] --> Loop 39 ### Ranking functions of CR start(V1,V,V12,V13) #### Partial ranking functions of CR start(V1,V,V12,V13) Computing Bounds ===================================== #### Cost of chains of fun(V1,V,Out): * Chain [[15],16]: 1*it(15)+0 Such that:it(15) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [16]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun1(V1,V,Out): * Chain [[17],18]: 1*it(17)+0 Such that:it(17) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [18]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of minus(V1,V,Out): * Chain [[19],21]: 0 with precondition: [V1=Out+V,V>=1,V1>=V] * Chain [[19],20]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [21]: 0 with precondition: [V=0,V1=Out,V1>=0] * Chain [20]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of ge(V1,V,Out): * Chain [[22],25]: 0 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [[22],24]: 0 with precondition: [Out=2,V>=1,V1>=V] * Chain [[22],23]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [25]: 0 with precondition: [V1=0,Out=1,V>=1] * Chain [24]: 0 with precondition: [V=0,Out=2,V1>=0] * Chain [23]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun2(V1,V,Out): * Chain [[31,32,33],36,30]: 6*it(31)+6*s(15)+2*s(16)+3 Such that:aux(6) =< V1 aux(7) =< V1-V+1 aux(10) =< V1-V aux(4) =< aux(6) it(31) =< aux(6) s(17) =< aux(6) aux(4) =< aux(7) it(31) =< aux(7) aux(4) =< aux(10) it(31) =< aux(10) s(17) =< aux(10) s(16) =< aux(4) s(15) =< s(17) with precondition: [V>=1,Out>=5,V1>=2*V,4*V1+5>=6*V+Out] * Chain [[31,32,33],36,29]: 6*it(31)+6*s(15)+2*s(16)+11 Such that:aux(6) =< V1 aux(7) =< V1-V+1 aux(12) =< V1-V aux(4) =< aux(6) it(31) =< aux(6) s(17) =< aux(6) aux(4) =< aux(7) it(31) =< aux(7) aux(4) =< aux(12) it(31) =< aux(12) s(17) =< aux(12) s(16) =< aux(4) s(15) =< s(17) with precondition: [V>=1,Out>=6,V1>=2*V,4*V1+6>=6*V+Out] * Chain [[31,32,33],35,30]: 6*it(31)+6*s(15)+2*s(16)+3*s(29)+1*s(31)+3 Such that:s(31) =< 1 aux(6) =< V1 aux(7) =< V1-V+1 aux(13) =< V aux(14) =< V1-V s(29) =< aux(13) aux(4) =< aux(6) it(31) =< aux(6) s(17) =< aux(6) aux(4) =< aux(7) it(31) =< aux(7) aux(4) =< aux(14) it(31) =< aux(14) s(17) =< aux(14) s(16) =< aux(4) s(15) =< s(17) with precondition: [V>=1,Out>=6,V1>=2*V,4*V1+5>=5*V+Out] * Chain [[31,32,33],35,29]: 6*it(31)+6*s(15)+2*s(16)+3*s(29)+1*s(31)+11 Such that:s(31) =< 1 aux(6) =< V1 aux(7) =< V1-V+1 aux(13) =< V aux(15) =< V1-V s(29) =< aux(13) aux(4) =< aux(6) it(31) =< aux(6) s(17) =< aux(6) aux(4) =< aux(7) it(31) =< aux(7) aux(4) =< aux(15) it(31) =< aux(15) s(17) =< aux(15) s(16) =< aux(4) s(15) =< s(17) with precondition: [V>=1,Out>=7,V1>=2*V,4*V1+6>=5*V+Out] * Chain [[31,32,33],34,30]: 6*it(31)+6*s(15)+2*s(16)+3*s(33)+1*s(36)+3 Such that:s(36) =< 1 aux(6) =< V1 aux(7) =< V1-V+1 aux(17) =< V aux(18) =< V1-V s(33) =< aux(17) aux(4) =< aux(6) it(31) =< aux(6) s(17) =< aux(6) aux(4) =< aux(7) it(31) =< aux(7) aux(4) =< aux(18) it(31) =< aux(18) s(17) =< aux(18) s(16) =< aux(4) s(15) =< s(17) with precondition: [V>=1,Out>=7,V1>=2*V,4*V1+5>=4*V+Out] * Chain [[31,32,33],34,29]: 6*it(31)+6*s(15)+2*s(16)+3*s(33)+1*s(36)+11 Such that:s(36) =< 1 aux(6) =< V1 aux(7) =< V1-V+1 aux(17) =< V aux(19) =< V1-V s(33) =< aux(17) aux(4) =< aux(6) it(31) =< aux(6) s(17) =< aux(6) aux(4) =< aux(7) it(31) =< aux(7) aux(4) =< aux(19) it(31) =< aux(19) s(17) =< aux(19) s(16) =< aux(4) s(15) =< s(17) with precondition: [V>=1,Out>=8,V1>=2*V,4*V1+6>=4*V+Out] * Chain [[31,32,33],30]: 6*it(31)+6*s(15)+2*s(16)+1 Such that:aux(7) =< V1-V+1 aux(20) =< V1 aux(4) =< aux(20) it(31) =< aux(20) aux(4) =< aux(7) it(31) =< aux(7) s(16) =< aux(4) s(15) =< aux(20) with precondition: [V>=1,Out>=3,V1>=V,4*V1+3>=2*V+Out] * Chain [[31,32,33],29]: 6*it(31)+6*s(15)+2*s(16)+9 Such that:aux(7) =< V1-V+1 aux(21) =< V1 aux(4) =< aux(21) it(31) =< aux(21) aux(4) =< aux(7) it(31) =< aux(7) s(16) =< aux(4) s(15) =< aux(21) with precondition: [V>=1,Out>=4,V1>=V,4*V1+4>=2*V+Out] * Chain [[31,32,33],27]: 6*it(31)+8*s(15)+2*s(16)+2*s(37)+1 Such that:aux(7) =< V1-V+1 aux(23) =< V aux(24) =< V1 s(15) =< aux(24) s(37) =< aux(23) aux(4) =< aux(24) it(31) =< aux(24) aux(4) =< aux(7) it(31) =< aux(7) s(16) =< aux(4) with precondition: [V>=1,Out>=4,V1>=V+1,4*V1>=2*V+Out] * Chain [[31,32,33],26]: 6*it(31)+6*s(15)+2*s(16)+2*s(41)+1 Such that:aux(6) =< V1 aux(7) =< V1-V+1 aux(25) =< V aux(26) =< V1-V s(41) =< aux(25) aux(4) =< aux(6) it(31) =< aux(6) s(17) =< aux(6) aux(4) =< aux(7) it(31) =< aux(7) aux(4) =< aux(26) it(31) =< aux(26) s(17) =< aux(26) s(16) =< aux(4) s(15) =< s(17) with precondition: [V>=1,Out>=4,V1>=2*V,4*V1+3>=5*V+Out] * Chain [36,30]: 3 with precondition: [Out=3,V>=1,V1>=V] * Chain [36,29]: 11 with precondition: [Out=4,V>=1,V1>=V] * Chain [35,30]: 3*s(29)+1*s(31)+3 Such that:s(31) =< 1 aux(13) =< V s(29) =< aux(13) with precondition: [Out>=4,V1>=V,V+3>=Out] * Chain [35,29]: 3*s(29)+1*s(31)+11 Such that:s(31) =< 1 aux(13) =< V s(29) =< aux(13) with precondition: [Out>=5,V1>=V,V+4>=Out] * Chain [34,30]: 3*s(33)+1*s(36)+3 Such that:s(36) =< 1 aux(17) =< V s(33) =< aux(17) with precondition: [Out>=5,V1>=V,2*V+3>=Out] * Chain [34,29]: 3*s(33)+1*s(36)+11 Such that:s(36) =< 1 aux(17) =< V s(33) =< aux(17) with precondition: [Out>=6,V1>=V,2*V+4>=Out] * Chain [30]: 1 with precondition: [Out=1,V1>=0,V>=0] * Chain [29]: 9 with precondition: [Out=2,V1>=0,V>=1] * Chain [28]: 1 with precondition: [V=0,Out=1,V1>=0] * Chain [27]: 2*s(37)+2*s(38)+1 Such that:aux(22) =< V1 aux(23) =< V s(38) =< aux(22) s(37) =< aux(23) with precondition: [Out>=2,V1+1>=Out,V+1>=Out] * Chain [26]: 2*s(41)+1 Such that:aux(25) =< V s(41) =< aux(25) with precondition: [Out>=2,V1>=V,V+1>=Out] #### Cost of chains of start(V1,V,V12,V13): * Chain [39]: 34*s(151)+8*s(158)+42*s(161)+14*s(163)+42*s(164)+22*s(165)+18*s(167)+6*s(168)+11 Such that:aux(37) =< 1 aux(38) =< V1 aux(39) =< V1-V aux(40) =< V1-V+1 aux(41) =< V s(151) =< aux(41) s(158) =< aux(37) s(160) =< aux(38) s(161) =< aux(38) s(162) =< aux(38) s(160) =< aux(40) s(161) =< aux(40) s(160) =< aux(39) s(161) =< aux(39) s(162) =< aux(39) s(163) =< s(160) s(164) =< s(162) s(165) =< aux(38) s(166) =< aux(38) s(167) =< aux(38) s(166) =< aux(40) s(167) =< aux(40) s(168) =< s(166) with precondition: [V1>=0,V>=0] * Chain [38]: 71*s(189)+16*s(198)+84*s(201)+28*s(203)+84*s(204)+44*s(205)+36*s(207)+12*s(208)+12 Such that:aux(45) =< 1 aux(46) =< V12-2*V13 aux(47) =< V12-2*V13+1 aux(48) =< V12-V13 aux(49) =< V13 s(189) =< aux(49) s(198) =< aux(45) s(200) =< aux(48) s(201) =< aux(48) s(202) =< aux(48) s(200) =< aux(47) s(201) =< aux(47) s(200) =< aux(46) s(201) =< aux(46) s(202) =< aux(46) s(203) =< s(200) s(204) =< s(202) s(205) =< aux(48) s(206) =< aux(48) s(207) =< aux(48) s(206) =< aux(47) s(207) =< aux(47) s(208) =< s(206) with precondition: [V1=2,V=2,V12>=0,V13>=0] * Chain [37]: 0 with precondition: [V=0,V1>=0] Closed-form bounds of start(V1,V,V12,V13): ------------------------------------- * Chain [39] with precondition: [V1>=0,V>=0] - Upper bound: 144*V1+34*V+19 - Complexity: n * Chain [38] with precondition: [V1=2,V=2,V12>=0,V13>=0] - Upper bound: 71*V13+28+nat(V12-V13)*288 - Complexity: n * Chain [37] with precondition: [V=0,V1>=0] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V1,V,V12,V13): max([144*V1+34*V+19,nat(V13)*71+28+nat(V12-V13)*288]) Asymptotic class: n * Total analysis performed in 1007 ms. ---------------------------------------- (20) BOUNDS(1, n^1)