WORST_CASE(?,O(n^1)) proof of input_MXJtuWY7cW.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) CpxWeightedTrsRenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxWeightedTrs (15) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxTypedWeightedTrs (17) CompletionProof [UPPER BOUND(ID), 0 ms] (18) CpxTypedWeightedCompleteTrs (19) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (20) CpxRNTS (21) CompleteCoflocoProof [FINISHED, 827 ms] (22) 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: -(x, 0) -> x -(s(x), s(y)) -> -(x, y) p(s(x)) -> x f(s(x), y) -> f(p(-(s(x), y)), p(-(y, s(x)))) f(x, s(y)) -> f(p(-(x, s(y))), p(-(s(y), x))) 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: -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) p(s(z0)) -> z0 f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) Tuples: -'(z0, 0) -> c -'(s(z0), s(z1)) -> c1(-'(z0, z1)) P(s(z0)) -> c2 F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) S tuples: -'(z0, 0) -> c -'(s(z0), s(z1)) -> c1(-'(z0, z1)) P(s(z0)) -> c2 F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) K tuples:none Defined Rule Symbols: -_2, p_1, f_2 Defined Pair Symbols: -'_2, P_1, F_2 Compound Symbols: c, c1_1, c2, c3_3, c4_3, c5_3, c6_3 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing nodes: P(s(z0)) -> c2 -'(z0, 0) -> c ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) p(s(z0)) -> z0 f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) Tuples: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) S tuples: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(s(z0), z1)), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), P(-(z1, s(z0))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(z0, s(z1))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), P(-(s(z1), z0)), -'(s(z1), z0)) K tuples:none Defined Rule Symbols: -_2, p_1, f_2 Defined Pair Symbols: -'_2, F_2 Compound Symbols: c1_1, c3_3, c4_3, c5_3, c6_3 ---------------------------------------- (5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 4 trailing tuple parts ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) p(s(z0)) -> z0 f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) Tuples: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(s(z1), z0)) S tuples: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(s(z1), z0)) K tuples:none Defined Rule Symbols: -_2, p_1, f_2 Defined Pair Symbols: -'_2, F_2 Compound Symbols: c1_1, c3_2, c4_2, c5_2, c6_2 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: f(s(z0), z1) -> f(p(-(s(z0), z1)), p(-(z1, s(z0)))) f(z0, s(z1)) -> f(p(-(z0, s(z1))), p(-(s(z1), z0))) ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: p(s(z0)) -> z0 -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(z0, z1) Tuples: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(s(z1), z0)) S tuples: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(s(z1), z0)) K tuples:none Defined Rule Symbols: p_1, -_2 Defined Pair Symbols: -'_2, F_2 Compound Symbols: c1_1, c3_2, c4_2, c5_2, c6_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: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(s(z0), z1)) F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(z1, s(z0))) F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(z0, s(z1))) F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(s(z1), z0)) The (relative) TRS S consists of the following rules: p(s(z0)) -> z0 -(z0, 0) -> z0 -(s(z0), s(z1)) -> -(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: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) [1] F(s(z0), z1) -> c3(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(s(z0), z1)) [1] F(s(z0), z1) -> c4(F(p(-(s(z0), z1)), p(-(z1, s(z0)))), -'(z1, s(z0))) [1] F(z0, s(z1)) -> c5(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(z0, s(z1))) [1] F(z0, s(z1)) -> c6(F(p(-(z0, s(z1))), p(-(s(z1), z0))), -'(s(z1), z0)) [1] p(s(z0)) -> z0 [0] -(z0, 0) -> z0 [0] -(s(z0), s(z1)) -> -(z0, z1) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (13) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: - => minus ---------------------------------------- (14) 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: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) [1] F(s(z0), z1) -> c3(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), -'(s(z0), z1)) [1] F(s(z0), z1) -> c4(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), -'(z1, s(z0))) [1] F(z0, s(z1)) -> c5(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), -'(z0, s(z1))) [1] F(z0, s(z1)) -> c6(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), -'(s(z1), z0)) [1] p(s(z0)) -> z0 [0] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (15) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (16) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) [1] F(s(z0), z1) -> c3(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), -'(s(z0), z1)) [1] F(s(z0), z1) -> c4(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), -'(z1, s(z0))) [1] F(z0, s(z1)) -> c5(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), -'(z0, s(z1))) [1] F(z0, s(z1)) -> c6(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), -'(s(z1), z0)) [1] p(s(z0)) -> z0 [0] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] The TRS has the following type information: -' :: s:0 -> s:0 -> c1 s :: s:0 -> s:0 c1 :: c1 -> c1 F :: s:0 -> s:0 -> c3:c4:c5:c6 c3 :: c3:c4:c5:c6 -> c1 -> c3:c4:c5:c6 p :: s:0 -> s:0 minus :: s:0 -> s:0 -> s:0 c4 :: c3:c4:c5:c6 -> c1 -> c3:c4:c5:c6 c5 :: c3:c4:c5:c6 -> c1 -> c3:c4:c5:c6 c6 :: c3:c4:c5:c6 -> c1 -> c3:c4:c5:c6 0 :: s:0 Rewrite Strategy: INNERMOST ---------------------------------------- (17) 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: p(v0) -> null_p [0] minus(v0, v1) -> null_minus [0] -'(v0, v1) -> null_-' [0] F(v0, v1) -> null_F [0] And the following fresh constants: null_p, null_minus, null_-', null_F ---------------------------------------- (18) 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: -'(s(z0), s(z1)) -> c1(-'(z0, z1)) [1] F(s(z0), z1) -> c3(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), -'(s(z0), z1)) [1] F(s(z0), z1) -> c4(F(p(minus(s(z0), z1)), p(minus(z1, s(z0)))), -'(z1, s(z0))) [1] F(z0, s(z1)) -> c5(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), -'(z0, s(z1))) [1] F(z0, s(z1)) -> c6(F(p(minus(z0, s(z1))), p(minus(s(z1), z0))), -'(s(z1), z0)) [1] p(s(z0)) -> z0 [0] minus(z0, 0) -> z0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] p(v0) -> null_p [0] minus(v0, v1) -> null_minus [0] -'(v0, v1) -> null_-' [0] F(v0, v1) -> null_F [0] The TRS has the following type information: -' :: s:0:null_p:null_minus -> s:0:null_p:null_minus -> c1:null_-' s :: s:0:null_p:null_minus -> s:0:null_p:null_minus c1 :: c1:null_-' -> c1:null_-' F :: s:0:null_p:null_minus -> s:0:null_p:null_minus -> c3:c4:c5:c6:null_F c3 :: c3:c4:c5:c6:null_F -> c1:null_-' -> c3:c4:c5:c6:null_F p :: s:0:null_p:null_minus -> s:0:null_p:null_minus minus :: s:0:null_p:null_minus -> s:0:null_p:null_minus -> s:0:null_p:null_minus c4 :: c3:c4:c5:c6:null_F -> c1:null_-' -> c3:c4:c5:c6:null_F c5 :: c3:c4:c5:c6:null_F -> c1:null_-' -> c3:c4:c5:c6:null_F c6 :: c3:c4:c5:c6:null_F -> c1:null_-' -> c3:c4:c5:c6:null_F 0 :: s:0:null_p:null_minus null_p :: s:0:null_p:null_minus null_minus :: s:0:null_p:null_minus null_-' :: c1:null_-' null_F :: c3:c4:c5:c6:null_F Rewrite Strategy: INNERMOST ---------------------------------------- (19) 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_p => 0 null_minus => 0 null_-' => 0 null_F => 0 ---------------------------------------- (20) Obligation: Complexity RNTS consisting of the following rules: -'(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 -'(z, z') -{ 1 }-> 1 + -'(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 F(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 F(z, z') -{ 1 }-> 1 + F(p(minus(z0, 1 + z1)), p(minus(1 + z1, z0))) + -'(z0, 1 + z1) :|: z = z0, z1 >= 0, z0 >= 0, z' = 1 + z1 F(z, z') -{ 1 }-> 1 + F(p(minus(z0, 1 + z1)), p(minus(1 + z1, z0))) + -'(1 + z1, z0) :|: z = z0, z1 >= 0, z0 >= 0, z' = 1 + z1 F(z, z') -{ 1 }-> 1 + F(p(minus(1 + z0, z1)), p(minus(z1, 1 + z0))) + -'(z1, 1 + z0) :|: z1 >= 0, z = 1 + z0, z' = z1, z0 >= 0 F(z, z') -{ 1 }-> 1 + F(p(minus(1 + z0, z1)), p(minus(z1, 1 + z0))) + -'(1 + z0, z1) :|: z1 >= 0, z = 1 + z0, z' = z1, 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 p(z) -{ 0 }-> z0 :|: z = 1 + z0, z0 >= 0 p(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (21) 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, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[p(V1, Out)],[V1 >= 0]). eq(start(V1, V),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,[minus(1 + V5, V4, Ret0100),p(Ret0100, Ret010),minus(V4, 1 + V5, Ret0110),p(Ret0110, Ret011),fun1(Ret010, Ret011, Ret01),fun(1 + V5, V4, Ret11)],[Out = 1 + Ret01 + Ret11,V4 >= 0,V1 = 1 + V5,V = V4,V5 >= 0]). eq(fun1(V1, V, Out),1,[minus(1 + V7, V6, Ret01001),p(Ret01001, Ret0101),minus(V6, 1 + V7, Ret01101),p(Ret01101, Ret0111),fun1(Ret0101, Ret0111, Ret012),fun(V6, 1 + V7, Ret12)],[Out = 1 + Ret012 + Ret12,V6 >= 0,V1 = 1 + V7,V = V6,V7 >= 0]). eq(fun1(V1, V, Out),1,[minus(V8, 1 + V9, Ret01002),p(Ret01002, Ret0102),minus(1 + V9, V8, Ret01102),p(Ret01102, Ret0112),fun1(Ret0102, Ret0112, Ret013),fun(V8, 1 + V9, Ret13)],[Out = 1 + Ret013 + Ret13,V1 = V8,V9 >= 0,V8 >= 0,V = 1 + V9]). eq(fun1(V1, V, Out),1,[minus(V11, 1 + V10, Ret01003),p(Ret01003, Ret0103),minus(1 + V10, V11, Ret01103),p(Ret01103, Ret0113),fun1(Ret0103, Ret0113, Ret014),fun(1 + V10, V11, Ret14)],[Out = 1 + Ret014 + Ret14,V1 = V11,V10 >= 0,V11 >= 0,V = 1 + V10]). eq(p(V1, Out),0,[],[Out = V12,V1 = 1 + V12,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(p(V1, Out),0,[],[Out = 0,V16 >= 0,V1 = V16]). eq(minus(V1, V, Out),0,[],[Out = 0,V18 >= 0,V17 >= 0,V1 = V18,V = V17]). eq(fun(V1, V, Out),0,[],[Out = 0,V20 >= 0,V19 >= 0,V1 = V20,V = V19]). eq(fun1(V1, V, Out),0,[],[Out = 0,V21 >= 0,V22 >= 0,V1 = V21,V = V22]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,Out),[V1,V],[Out]). input_output_vars(p(V1,Out),[V1],[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 : [minus/3] 2. non_recursive : [p/2] 3. recursive [non_tail] : [fun1/3] 4. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into minus/3 2. SCC is partially evaluated into p/2 3. SCC is partially evaluated into fun1/3 4. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 6 is refined into CE [17] * CE 5 is refined into CE [18] ### Cost equations --> "Loop" of fun/3 * CEs [18] --> Loop 12 * CEs [17] --> Loop 13 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [12]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [12]: - RF of loop [12:1]: V V1 ### Specialization of cost equations minus/3 * CE 16 is refined into CE [19] * CE 14 is refined into CE [20] * CE 15 is refined into CE [21] ### Cost equations --> "Loop" of minus/3 * CEs [21] --> Loop 14 * CEs [19] --> Loop 15 * CEs [20] --> Loop 16 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [14]: [V,V1] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [14]: - RF of loop [14:1]: V V1 ### Specialization of cost equations p/2 * CE 12 is refined into CE [22] * CE 13 is refined into CE [23] ### Cost equations --> "Loop" of p/2 * CEs [22] --> Loop 17 * CEs [23] --> Loop 18 ### Ranking functions of CR p(V1,Out) #### Partial ranking functions of CR p(V1,Out) ### Specialization of cost equations fun1/3 * CE 11 is refined into CE [24] * CE 7 is refined into CE [25,26,27,28,29,30,31,32,33,34,35,36,37,38] * CE 8 is refined into CE [39,40,41,42,43,44,45,46,47,48,49,50,51,52] * CE 9 is refined into CE [53,54,55,56,57,58,59,60,61,62,63,64,65,66] * CE 10 is refined into CE [67,68,69,70,71,72,73,74,75,76,77,78,79,80] ### Cost equations --> "Loop" of fun1/3 * CEs [38,52,66,80] --> Loop 19 * CEs [37,51,65,79] --> Loop 20 * CEs [32,46,60,74] --> Loop 21 * CEs [31,45,59,73] --> Loop 22 * CEs [34,48,62,76] --> Loop 23 * CEs [28,30,36,42,44,50,56,58,64,70,72,78] --> Loop 24 * CEs [35,49,63,77] --> Loop 25 * CEs [26,40] --> Loop 26 * CEs [25,27,39,41] --> Loop 27 * CEs [54,68] --> Loop 28 * CEs [29,33,43,47,53,55,57,61,67,69,71,75] --> Loop 29 * CEs [24] --> Loop 30 ### Ranking functions of CR fun1(V1,V,Out) * RF of phase [26]: [V1] * RF of phase [28]: [V] #### Partial ranking functions of CR fun1(V1,V,Out) * Partial RF of phase [26]: - RF of loop [26:1]: V1 * Partial RF of phase [28]: - RF of loop [28:1]: V ### Specialization of cost equations start/2 * CE 1 is refined into CE [81,82] * CE 2 is refined into CE [83,84,85,86,87,88,89,90,91,92,93] * CE 3 is refined into CE [94,95] * CE 4 is refined into CE [96,97,98] ### Cost equations --> "Loop" of start/2 * CEs [84,96] --> Loop 31 * CEs [81,82,83,85,86,87,88,89,90,91,92,93,94,95,97,98] --> Loop 32 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of fun(V1,V,Out): * Chain [[12],13]: 1*it(12)+0 Such that:it(12) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [13]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of minus(V1,V,Out): * Chain [[14],16]: 0 with precondition: [V1=Out+V,V>=1,V1>=V] * Chain [[14],15]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [16]: 0 with precondition: [V=0,V1=Out,V1>=0] * Chain [15]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of p(V1,Out): * Chain [18]: 0 with precondition: [Out=0,V1>=0] * Chain [17]: 0 with precondition: [V1=Out+1,V1>=1] #### Cost of chains of fun1(V1,V,Out): * Chain [[28],30]: 1*it(28)+0 Such that:it(28) =< Out with precondition: [V1=0,Out>=1,V>=Out] * Chain [[28],29,30]: 1*it(28)+1 Such that:it(28) =< Out with precondition: [V1=0,Out>=2,V>=Out] * Chain [[26],30]: 1*it(26)+0 Such that:it(26) =< Out with precondition: [V=0,Out>=1,V1>=Out] * Chain [[26],27,30]: 1*it(26)+1 Such that:it(26) =< Out with precondition: [V=0,Out>=2,V1>=Out] * Chain [30]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [29,30]: 1 with precondition: [Out=1,V1>=0,V>=1] * Chain [27,30]: 1 with precondition: [Out=1,V1>=1,V>=0] * Chain [25,30]: 1 with precondition: [Out=1,V1=V,V1>=1] * Chain [24,30]: 4*s(1)+8*s(2)+1 Such that:aux(1) =< V1 aux(2) =< V s(2) =< aux(1) s(1) =< aux(2) with precondition: [Out>=2,V1+1>=Out,V+1>=Out] * Chain [23,30]: 4*s(13)+1 Such that:aux(3) =< V s(13) =< aux(3) with precondition: [Out>=2,V1>=V,V+1>=Out] * Chain [22,[28],30]: 1*it(28)+1 Such that:it(28) =< Out with precondition: [V1>=1,Out>=2,V>=Out+V1] * Chain [22,[28],29,30]: 1*it(28)+2 Such that:it(28) =< Out with precondition: [V1>=1,Out>=3,V>=Out+V1] * Chain [22,30]: 1 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [22,29,30]: 2 with precondition: [Out=2,V1>=1,V>=V1+2] * Chain [21,[28],30]: 1*it(28)+4*s(17)+1 Such that:it(28) =< -V1+V aux(4) =< V1 s(17) =< aux(4) with precondition: [V1>=1,Out>=3,V>=V1+2,V>=Out] * Chain [21,[28],29,30]: 1*it(28)+4*s(17)+2 Such that:it(28) =< -V1+V aux(4) =< V1 s(17) =< aux(4) with precondition: [V1>=1,Out>=4,V>=V1+3,V>=Out] * Chain [21,30]: 4*s(17)+1 Such that:aux(4) =< V1 s(17) =< aux(4) with precondition: [Out>=2,V>=V1+1,V1+1>=Out] * Chain [21,29,30]: 4*s(17)+2 Such that:aux(4) =< V1 s(17) =< aux(4) with precondition: [Out>=3,V>=V1+2,V1+2>=Out] * Chain [20,[26],30]: 1*it(26)+1 Such that:it(26) =< Out with precondition: [V>=1,Out>=2,V1>=Out+V] * Chain [20,[26],27,30]: 1*it(26)+2 Such that:it(26) =< Out with precondition: [V>=1,Out>=3,V1>=Out+V] * Chain [20,30]: 1 with precondition: [Out=1,V>=1,V1>=V+1] * Chain [20,27,30]: 2 with precondition: [Out=2,V>=1,V1>=V+2] * Chain [19,[26],30]: 1*it(26)+4*s(21)+1 Such that:it(26) =< V1-V aux(5) =< V+1 s(21) =< aux(5) with precondition: [V>=1,Out>=3,V1>=V+2,V1>=Out] * Chain [19,[26],27,30]: 1*it(26)+4*s(21)+2 Such that:it(26) =< V1-V aux(5) =< V+1 s(21) =< aux(5) with precondition: [V>=1,Out>=4,V1>=V+3,V1>=Out] * Chain [19,30]: 4*s(21)+1 Such that:aux(5) =< V+1 s(21) =< aux(5) with precondition: [Out>=2,V1>=V+1,V+1>=Out] * Chain [19,27,30]: 4*s(21)+2 Such that:aux(5) =< V+1 s(21) =< aux(5) with precondition: [Out>=3,V1>=V+2,V+2>=Out] #### Cost of chains of start(V1,V): * Chain [32]: 11*s(59)+4*s(63)+4*s(65)+24*s(69)+16*s(73)+2 Such that:aux(15) =< -V1+V aux(16) =< V1 aux(17) =< V1-V aux(18) =< V aux(19) =< V+1 s(59) =< aux(18) s(63) =< aux(15) s(69) =< aux(16) s(65) =< aux(17) s(73) =< aux(19) with precondition: [V1>=0] * Chain [31]: 2*s(83)+1 Such that:s(82) =< V1 s(83) =< s(82) with precondition: [V=0,V1>=0] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [32] with precondition: [V1>=0] - Upper bound: 24*V1+2+nat(V)*11+nat(V+1)*16+nat(-V1+V)*4+nat(V1-V)*4 - Complexity: n * Chain [31] with precondition: [V=0,V1>=0] - Upper bound: 2*V1+1 - Complexity: n ### Maximum cost of start(V1,V): 22*V1+1+nat(V)*11+nat(V+1)*16+nat(-V1+V)*4+nat(V1-V)*4+(2*V1+1) Asymptotic class: n * Total analysis performed in 850 ms. ---------------------------------------- (22) BOUNDS(1, n^1)