WORST_CASE(?,O(n^1)) proof of input_MOte4gaImL.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) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CdtProblem (5) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxTRS (7) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxWeightedTrs (9) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxTypedWeightedTrs (11) CompletionProof [UPPER BOUND(ID), 0 ms] (12) CpxTypedWeightedCompleteTrs (13) NarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxTypedWeightedCompleteTrs (15) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (16) CpxRNTS (17) SimplificationProof [BOTH BOUNDS(ID, ID), 0 ms] (18) CpxRNTS (19) CpxRntsAnalysisOrderProof [BOTH BOUNDS(ID, ID), 0 ms] (20) CpxRNTS (21) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (22) CpxRNTS (23) IntTrsBoundProof [UPPER BOUND(ID), 286 ms] (24) CpxRNTS (25) IntTrsBoundProof [UPPER BOUND(ID), 114 ms] (26) CpxRNTS (27) FinalProof [FINISHED, 0 ms] (28) 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: f(0, 1, x) -> f(s(x), x, x) f(x, y, s(z)) -> s(f(0, 1, 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: f(0, 1, z0) -> f(s(z0), z0, z0) f(z0, z1, s(z2)) -> s(f(0, 1, z2)) Tuples: F(0, 1, z0) -> c(F(s(z0), z0, z0)) F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) S tuples: F(0, 1, z0) -> c(F(s(z0), z0, z0)) F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) K tuples:none Defined Rule Symbols: f_3 Defined Pair Symbols: F_3 Compound Symbols: c_1, c1_1 ---------------------------------------- (3) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: f(0, 1, z0) -> f(s(z0), z0, z0) f(z0, z1, s(z2)) -> s(f(0, 1, z2)) ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules:none Tuples: F(0, 1, z0) -> c(F(s(z0), z0, z0)) F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) S tuples: F(0, 1, z0) -> c(F(s(z0), z0, z0)) F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) K tuples:none Defined Rule Symbols:none Defined Pair Symbols: F_3 Compound Symbols: c_1, c1_1 ---------------------------------------- (5) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (6) 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(0, 1, z0) -> c(F(s(z0), z0, z0)) F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (7) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (8) 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(0, 1, z0) -> c(F(s(z0), z0, z0)) [1] F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (9) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (10) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: F(0, 1, z0) -> c(F(s(z0), z0, z0)) [1] F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) [1] The TRS has the following type information: F :: 0:1:s -> 0:1:s -> 0:1:s -> c:c1 0 :: 0:1:s 1 :: 0:1:s c :: c:c1 -> c:c1 s :: 0:1:s -> 0:1:s c1 :: c:c1 -> c:c1 Rewrite Strategy: INNERMOST ---------------------------------------- (11) 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_3 (c) The following functions are completely defined: none Due to the following rules being added: none And the following fresh constants: const ---------------------------------------- (12) 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(0, 1, z0) -> c(F(s(z0), z0, z0)) [1] F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) [1] The TRS has the following type information: F :: 0:1:s -> 0:1:s -> 0:1:s -> c:c1 0 :: 0:1:s 1 :: 0:1:s c :: c:c1 -> c:c1 s :: 0:1:s -> 0:1:s c1 :: c:c1 -> c:c1 const :: c:c1 Rewrite Strategy: INNERMOST ---------------------------------------- (13) NarrowingProof (BOTH BOUNDS(ID, ID)) Narrowed the inner basic terms of all right-hand sides by a single narrowing step. ---------------------------------------- (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(0, 1, z0) -> c(F(s(z0), z0, z0)) [1] F(z0, z1, s(z2)) -> c1(F(0, 1, z2)) [1] The TRS has the following type information: F :: 0:1:s -> 0:1:s -> 0:1:s -> c:c1 0 :: 0:1:s 1 :: 0:1:s c :: c:c1 -> c:c1 s :: 0:1:s -> 0:1:s c1 :: c:c1 -> c:c1 const :: c:c1 Rewrite Strategy: INNERMOST ---------------------------------------- (15) 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 1 => 1 const => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'') -{ 1 }-> 1 + F(0, 1, z2) :|: z = z0, z1 >= 0, z' = z1, z0 >= 0, z'' = 1 + z2, z2 >= 0 F(z, z', z'') -{ 1 }-> 1 + F(1 + z0, z0, z0) :|: z'' = z0, z0 >= 0, z' = 1, z = 0 ---------------------------------------- (17) SimplificationProof (BOTH BOUNDS(ID, ID)) Simplified the RNTS by moving equalities from the constraints into the right-hand sides. ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'') -{ 1 }-> 1 + F(0, 1, z'' - 1) :|: z' >= 0, z >= 0, z'' - 1 >= 0 F(z, z', z'') -{ 1 }-> 1 + F(1 + z'', z'', z'') :|: z'' >= 0, z' = 1, z = 0 ---------------------------------------- (19) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID)) Found the following analysis order by SCC decomposition: { F } ---------------------------------------- (20) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'') -{ 1 }-> 1 + F(0, 1, z'' - 1) :|: z' >= 0, z >= 0, z'' - 1 >= 0 F(z, z', z'') -{ 1 }-> 1 + F(1 + z'', z'', z'') :|: z'' >= 0, z' = 1, z = 0 Function symbols to be analyzed: {F} ---------------------------------------- (21) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (22) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'') -{ 1 }-> 1 + F(0, 1, z'' - 1) :|: z' >= 0, z >= 0, z'' - 1 >= 0 F(z, z', z'') -{ 1 }-> 1 + F(1 + z'', z'', z'') :|: z'' >= 0, z' = 1, z = 0 Function symbols to be analyzed: {F} ---------------------------------------- (23) 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 ---------------------------------------- (24) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'') -{ 1 }-> 1 + F(0, 1, z'' - 1) :|: z' >= 0, z >= 0, z'' - 1 >= 0 F(z, z', z'') -{ 1 }-> 1 + F(1 + z'', z'', z'') :|: z'' >= 0, z' = 1, z = 0 Function symbols to be analyzed: {F} Previous analysis results are: F: runtime: ?, size: O(1) [0] ---------------------------------------- (25) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using KoAT for: F after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 1 + 2*z'' ---------------------------------------- (26) Obligation: Complexity RNTS consisting of the following rules: F(z, z', z'') -{ 1 }-> 1 + F(0, 1, z'' - 1) :|: z' >= 0, z >= 0, z'' - 1 >= 0 F(z, z', z'') -{ 1 }-> 1 + F(1 + z'', z'', z'') :|: z'' >= 0, z' = 1, z = 0 Function symbols to be analyzed: Previous analysis results are: F: runtime: O(n^1) [1 + 2*z''], size: O(1) [0] ---------------------------------------- (27) FinalProof (FINISHED) Computed overall runtime complexity ---------------------------------------- (28) BOUNDS(1, n^1)