WORST_CASE(?,O(n^1)) proof of input_cbBhDSCqZ6.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) 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), 474 ms] (26) CpxRNTS (27) IntTrsBoundProof [UPPER BOUND(ID), 230 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: div(0, y) -> 0 div(x, y) -> quot(x, y, y) quot(0, s(y), z) -> 0 quot(s(x), s(y), z) -> quot(x, y, z) quot(x, 0, s(z)) -> s(div(x, s(z))) 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: div(0, z0) -> 0 div(z0, z1) -> quot(z0, z1, z1) quot(0, s(z0), z1) -> 0 quot(s(z0), s(z1), z2) -> quot(z0, z1, z2) quot(z0, 0, s(z1)) -> s(div(z0, s(z1))) Tuples: DIV(0, z0) -> c DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) QUOT(0, s(z0), z1) -> c2 QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) S tuples: DIV(0, z0) -> c DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) QUOT(0, s(z0), z1) -> c2 QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) K tuples:none Defined Rule Symbols: div_2, quot_3 Defined Pair Symbols: DIV_2, QUOT_3 Compound Symbols: c, c1_1, c2, c3_1, c4_1 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing nodes: DIV(0, z0) -> c QUOT(0, s(z0), z1) -> c2 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: div(0, z0) -> 0 div(z0, z1) -> quot(z0, z1, z1) quot(0, s(z0), z1) -> 0 quot(s(z0), s(z1), z2) -> quot(z0, z1, z2) quot(z0, 0, s(z1)) -> s(div(z0, s(z1))) Tuples: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) S tuples: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) K tuples:none Defined Rule Symbols: div_2, quot_3 Defined Pair Symbols: DIV_2, QUOT_3 Compound Symbols: c1_1, c3_1, c4_1 ---------------------------------------- (5) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: div(0, z0) -> 0 div(z0, z1) -> quot(z0, z1, z1) quot(0, s(z0), z1) -> 0 quot(s(z0), s(z1), z2) -> quot(z0, z1, z2) quot(z0, 0, s(z1)) -> s(div(z0, s(z1))) ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules:none Tuples: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) S tuples: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) K tuples:none Defined Rule Symbols:none Defined Pair Symbols: DIV_2, QUOT_3 Compound Symbols: c1_1, c3_1, c4_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: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) 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: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) [1] QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) [1] QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) [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: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) [1] QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) [1] QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) [1] The TRS has the following type information: DIV :: s:0 -> s:0 -> c1 c1 :: c3:c4 -> c1 QUOT :: s:0 -> s:0 -> s:0 -> c3:c4 s :: s:0 -> s:0 c3 :: c3:c4 -> c3:c4 0 :: s:0 c4 :: c1 -> c3:c4 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: DIV_2 QUOT_3 (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: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) [1] QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) [1] QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) [1] The TRS has the following type information: DIV :: s:0 -> s:0 -> c1 c1 :: c3:c4 -> c1 QUOT :: s:0 -> s:0 -> s:0 -> c3:c4 s :: s:0 -> s:0 c3 :: c3:c4 -> c3:c4 0 :: s:0 c4 :: c1 -> c3:c4 const :: c1 const1 :: c3:c4 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: DIV(z0, z1) -> c1(QUOT(z0, z1, z1)) [1] QUOT(s(z0), s(z1), z2) -> c3(QUOT(z0, z1, z2)) [1] QUOT(z0, 0, s(z1)) -> c4(DIV(z0, s(z1))) [1] The TRS has the following type information: DIV :: s:0 -> s:0 -> c1 c1 :: c3:c4 -> c1 QUOT :: s:0 -> s:0 -> s:0 -> c3:c4 s :: s:0 -> s:0 c3 :: c3:c4 -> c3:c4 0 :: s:0 c4 :: c1 -> c3:c4 const :: c1 const1 :: c3:c4 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: DIV(z, z') -{ 1 }-> 1 + QUOT(z0, z1, z1) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + QUOT(z0, z1, z2) :|: z'' = z2, z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1, z2 >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + DIV(z0, 1 + z1) :|: z = z0, z1 >= 0, z0 >= 0, z'' = 1 + z1, z' = 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: DIV(z, z') -{ 1 }-> 1 + QUOT(z, z', z') :|: z' >= 0, z >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + QUOT(z - 1, z' - 1, z'') :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + DIV(z, 1 + (z'' - 1)) :|: z'' - 1 >= 0, z >= 0, z' = 0 ---------------------------------------- (21) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID)) Found the following analysis order by SCC decomposition: { QUOT, DIV } ---------------------------------------- (22) Obligation: Complexity RNTS consisting of the following rules: DIV(z, z') -{ 1 }-> 1 + QUOT(z, z', z') :|: z' >= 0, z >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + QUOT(z - 1, z' - 1, z'') :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + DIV(z, 1 + (z'' - 1)) :|: z'' - 1 >= 0, z >= 0, z' = 0 Function symbols to be analyzed: {QUOT,DIV} ---------------------------------------- (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: DIV(z, z') -{ 1 }-> 1 + QUOT(z, z', z') :|: z' >= 0, z >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + QUOT(z - 1, z' - 1, z'') :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + DIV(z, 1 + (z'' - 1)) :|: z'' - 1 >= 0, z >= 0, z' = 0 Function symbols to be analyzed: {QUOT,DIV} ---------------------------------------- (25) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: QUOT after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 0 Computed SIZE bound using CoFloCo for: DIV after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (26) Obligation: Complexity RNTS consisting of the following rules: DIV(z, z') -{ 1 }-> 1 + QUOT(z, z', z') :|: z' >= 0, z >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + QUOT(z - 1, z' - 1, z'') :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + DIV(z, 1 + (z'' - 1)) :|: z'' - 1 >= 0, z >= 0, z' = 0 Function symbols to be analyzed: {QUOT,DIV} Previous analysis results are: QUOT: runtime: ?, size: O(1) [0] DIV: runtime: ?, size: O(1) [1] ---------------------------------------- (27) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: QUOT after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 2 + 3*z + 2*z' Computed RUNTIME bound using CoFloCo for: DIV after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 3 + 3*z + 2*z' ---------------------------------------- (28) Obligation: Complexity RNTS consisting of the following rules: DIV(z, z') -{ 1 }-> 1 + QUOT(z, z', z') :|: z' >= 0, z >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + QUOT(z - 1, z' - 1, z'') :|: z' - 1 >= 0, z - 1 >= 0, z'' >= 0 QUOT(z, z', z'') -{ 1 }-> 1 + DIV(z, 1 + (z'' - 1)) :|: z'' - 1 >= 0, z >= 0, z' = 0 Function symbols to be analyzed: Previous analysis results are: QUOT: runtime: O(n^1) [2 + 3*z + 2*z'], size: O(1) [0] DIV: runtime: O(n^1) [3 + 3*z + 2*z'], size: O(1) [1] ---------------------------------------- (29) FinalProof (FINISHED) Computed overall runtime complexity ---------------------------------------- (30) BOUNDS(1, n^1)