WORST_CASE(?,O(n^1)) proof of input_rjiIYPb3ZA.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 [ComplexityIfPolyImplication, 0 ms] (4) CdtProblem (5) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTRS (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) NarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxTypedWeightedCompleteTrs (17) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (18) CpxRNTS (19) SimplificationProof [BOTH BOUNDS(ID, ID), 0 ms] (20) CpxRNTS (21) CpxRntsAnalysisOrderProof [BOTH BOUNDS(ID, ID), 0 ms] (22) CpxRNTS (23) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (24) CpxRNTS (25) IntTrsBoundProof [UPPER BOUND(ID), 273 ms] (26) CpxRNTS (27) IntTrsBoundProof [UPPER BOUND(ID), 37 ms] (28) CpxRNTS (29) FinalProof [FINISHED, 0 ms] (30) 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: perfectp(0) -> false perfectp(s(x)) -> f(x, s(0), s(x), s(x)) f(0, y, 0, u) -> true f(0, y, s(z), u) -> false f(s(x), 0, z, u) -> f(x, u, minus(z, s(x)), u) f(s(x), s(y), z, u) -> if(le(x, y), f(s(x), minus(y, x), z, u), f(x, u, z, u)) 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: perfectp(0) -> false perfectp(s(z0)) -> f(z0, s(0), s(z0), s(z0)) f(0, z0, 0, z1) -> true f(0, z0, s(z1), z2) -> false f(s(z0), 0, z1, z2) -> f(z0, z2, minus(z1, s(z0)), z2) f(s(z0), s(z1), z2, z3) -> if(le(z0, z1), f(s(z0), minus(z1, z0), z2, z3), f(z0, z3, z2, z3)) Tuples: PERFECTP(0) -> c PERFECTP(s(z0)) -> c1(F(z0, s(0), s(z0), s(z0))) F(0, z0, 0, z1) -> c2 F(0, z0, s(z1), z2) -> c3 F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) F(s(z0), s(z1), z2, z3) -> c5(F(s(z0), minus(z1, z0), z2, z3)) F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) S tuples: PERFECTP(0) -> c PERFECTP(s(z0)) -> c1(F(z0, s(0), s(z0), s(z0))) F(0, z0, 0, z1) -> c2 F(0, z0, s(z1), z2) -> c3 F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) F(s(z0), s(z1), z2, z3) -> c5(F(s(z0), minus(z1, z0), z2, z3)) F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) K tuples:none Defined Rule Symbols: perfectp_1, f_4 Defined Pair Symbols: PERFECTP_1, F_4 Compound Symbols: c, c1_1, c2, c3, c4_1, c5_1, c6_1 ---------------------------------------- (3) CdtLeafRemovalProof (ComplexityIfPolyImplication) Removed 1 leading nodes: PERFECTP(s(z0)) -> c1(F(z0, s(0), s(z0), s(z0))) Removed 4 trailing nodes: F(0, z0, s(z1), z2) -> c3 F(s(z0), s(z1), z2, z3) -> c5(F(s(z0), minus(z1, z0), z2, z3)) PERFECTP(0) -> c F(0, z0, 0, z1) -> c2 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: perfectp(0) -> false perfectp(s(z0)) -> f(z0, s(0), s(z0), s(z0)) f(0, z0, 0, z1) -> true f(0, z0, s(z1), z2) -> false f(s(z0), 0, z1, z2) -> f(z0, z2, minus(z1, s(z0)), z2) f(s(z0), s(z1), z2, z3) -> if(le(z0, z1), f(s(z0), minus(z1, z0), z2, z3), f(z0, z3, z2, z3)) Tuples: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) S tuples: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) K tuples:none Defined Rule Symbols: perfectp_1, f_4 Defined Pair Symbols: F_4 Compound Symbols: c4_1, c6_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: perfectp(0) -> false perfectp(s(z0)) -> f(z0, s(0), s(z0), s(z0)) f(0, z0, 0, z1) -> true f(0, z0, s(z1), z2) -> false f(s(z0), 0, z1, z2) -> f(z0, z2, minus(z1, s(z0)), z2) f(s(z0), s(z1), z2, z3) -> if(le(z0, z1), f(s(z0), minus(z1, z0), z2, z3), f(z0, z3, z2, z3)) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules:none Tuples: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) S tuples: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) K tuples:none Defined Rule Symbols:none Defined Pair Symbols: F_4 Compound Symbols: c4_1, c6_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 CpxTRS could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) S is empty. 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: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) [1] F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) [1] 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: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) [1] F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) [1] The TRS has the following type information: F :: s:0 -> s:0 -> minus -> s:0 -> c4:c6 s :: s:0 -> s:0 0 :: s:0 c4 :: c4:c6 -> c4:c6 minus :: minus -> s:0 -> minus c6 :: c4:c6 -> c4:c6 Rewrite Strategy: INNERMOST ---------------------------------------- (13) CompletionProof (UPPER BOUND(ID)) The transformation into a RNTS is sound, since: (a) The obligation is a constructor system where every type has a constant constructor, (b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols: F_4 (c) The following functions are completely defined: none Due to the following rules being added: none And the following fresh constants: const, const1 ---------------------------------------- (14) Obligation: Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) [1] F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) [1] The TRS has the following type information: F :: s:0 -> s:0 -> minus -> s:0 -> c4:c6 s :: s:0 -> s:0 0 :: s:0 c4 :: c4:c6 -> c4:c6 minus :: minus -> s:0 -> minus c6 :: c4:c6 -> c4:c6 const :: c4:c6 const1 :: minus Rewrite Strategy: INNERMOST ---------------------------------------- (15) NarrowingProof (BOTH BOUNDS(ID, ID)) Narrowed the inner basic terms of all right-hand sides by a single narrowing step. ---------------------------------------- (16) Obligation: Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: F(s(z0), 0, z1, z2) -> c4(F(z0, z2, minus(z1, s(z0)), z2)) [1] F(s(z0), s(z1), z2, z3) -> c6(F(z0, z3, z2, z3)) [1] The TRS has the following type information: F :: s:0 -> s:0 -> minus -> s:0 -> c4:c6 s :: s:0 -> s:0 0 :: s:0 c4 :: c4:c6 -> c4:c6 minus :: minus -> s:0 -> minus c6 :: c4:c6 -> c4:c6 const :: c4:c6 const1 :: minus 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 const => 0 const1 => 0 ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'', z4) -{ 1 }-> 1 + F(z0, z2, 1 + z1 + (1 + z0), z2) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z2 >= 0, z' = 0, z'' = z1, z4 = z2 F(z, z', z'', z4) -{ 1 }-> 1 + F(z0, z3, z2, z3) :|: z'' = z2, z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1, z4 = z3, z2 >= 0, z3 >= 0 ---------------------------------------- (19) SimplificationProof (BOTH BOUNDS(ID, ID)) Simplified the RNTS by moving equalities from the constraints into the right-hand sides. ---------------------------------------- (20) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, z'', z4) :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0, z4 >= 0 F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, 1 + z'' + (1 + (z - 1)), z4) :|: z'' >= 0, z - 1 >= 0, z4 >= 0, z' = 0 ---------------------------------------- (21) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID)) Found the following analysis order by SCC decomposition: { F } ---------------------------------------- (22) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, z'', z4) :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0, z4 >= 0 F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, 1 + z'' + (1 + (z - 1)), z4) :|: z'' >= 0, z - 1 >= 0, z4 >= 0, z' = 0 Function symbols to be analyzed: {F} ---------------------------------------- (23) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (24) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, z'', z4) :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0, z4 >= 0 F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, 1 + z'' + (1 + (z - 1)), z4) :|: z'' >= 0, z - 1 >= 0, z4 >= 0, z' = 0 Function symbols to be analyzed: {F} ---------------------------------------- (25) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: F after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 0 ---------------------------------------- (26) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, z'', z4) :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0, z4 >= 0 F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, 1 + z'' + (1 + (z - 1)), z4) :|: z'' >= 0, z - 1 >= 0, z4 >= 0, z' = 0 Function symbols to be analyzed: {F} Previous analysis results are: F: runtime: ?, size: O(1) [0] ---------------------------------------- (27) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: F after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z ---------------------------------------- (28) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, z'', z4) :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0, z4 >= 0 F(z, z', z'', z4) -{ 1 }-> 1 + F(z - 1, z4, 1 + z'' + (1 + (z - 1)), z4) :|: z'' >= 0, z - 1 >= 0, z4 >= 0, z' = 0 Function symbols to be analyzed: Previous analysis results are: F: runtime: O(n^1) [z], size: O(1) [0] ---------------------------------------- (29) FinalProof (FINISHED) Computed overall runtime complexity ---------------------------------------- (30) BOUNDS(1, n^1)