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