WORST_CASE(Omega(n^1),O(n^1)) proof of /export/starexec/sandbox/benchmark/theBenchmark.trs # AProVE Commit ID: c69e44bd14796315568835c1ffa2502984884775 mhark 20210624 unpublished The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxWeightedTrs (3) CpxWeightedTrsRenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxWeightedTrs (5) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxTypedWeightedTrs (7) CompletionProof [UPPER BOUND(ID), 0 ms] (8) CpxTypedWeightedCompleteTrs (9) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (10) CpxRNTS (11) CompleteCoflocoProof [FINISHED, 111 ms] (12) BOUNDS(1, n^1) (13) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (14) TRS for Loop Detection (15) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (16) BEST (17) proven lower bound (18) LowerBoundPropagationProof [FINISHED, 0 ms] (19) BOUNDS(n^1, INF) (20) TRS for Loop Detection ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *(x, +(y, z)) -> +(*(x, y), *(x, z)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (2) 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: *(x, +(y, z)) -> +(*(x, y), *(x, z)) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (3) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: * => times ---------------------------------------- (4) 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: times(x, +(y, z)) -> +(times(x, y), times(x, z)) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (5) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (6) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: times(x, +(y, z)) -> +(times(x, y), times(x, z)) [1] The TRS has the following type information: times :: a -> + -> + + :: + -> + -> + Rewrite Strategy: INNERMOST ---------------------------------------- (7) 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: times(v0, v1) -> null_times [0] And the following fresh constants: null_times, const ---------------------------------------- (8) 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: times(x, +(y, z)) -> +(times(x, y), times(x, z)) [1] times(v0, v1) -> null_times [0] The TRS has the following type information: times :: a -> +:null_times -> +:null_times + :: +:null_times -> +:null_times -> +:null_times null_times :: +:null_times const :: a Rewrite Strategy: INNERMOST ---------------------------------------- (9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: null_times => 0 const => 0 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: times(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 times(z', z'') -{ 1 }-> 1 + times(x, y) + times(x, z) :|: z >= 0, z' = x, x >= 0, y >= 0, z'' = 1 + y + z Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (11) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V1),0,[times(V, V1, Out)],[V >= 0,V1 >= 0]). eq(times(V, V1, Out),1,[times(V3, V2, Ret01),times(V3, V4, Ret1)],[Out = 1 + Ret01 + Ret1,V4 >= 0,V = V3,V3 >= 0,V2 >= 0,V1 = 1 + V2 + V4]). eq(times(V, V1, Out),0,[],[Out = 0,V6 >= 0,V5 >= 0,V1 = V5,V = V6]). input_output_vars(times(V,V1,Out),[V,V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive [multiple] : [times/3] 1. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into times/3 1. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations times/3 * CE 3 is refined into CE [4] * CE 2 is refined into CE [5] ### Cost equations --> "Loop" of times/3 * CEs [5] --> Loop 4 * CEs [4] --> Loop 5 ### Ranking functions of CR times(V,V1,Out) * RF of phase [4]: [V1] #### Partial ranking functions of CR times(V,V1,Out) * Partial RF of phase [4]: - RF of loop [4:1,4:2]: V1 ### Specialization of cost equations start/2 * CE 1 is refined into CE [6,7] ### Cost equations --> "Loop" of start/2 * CEs [6,7] --> Loop 6 ### Ranking functions of CR start(V,V1) #### Partial ranking functions of CR start(V,V1) Computing Bounds ===================================== #### Cost of chains of times(V,V1,Out): * Chain [5]: 0 with precondition: [Out=0,V>=0,V1>=0] * Chain [multiple([4],[[5]])]: 1*it(4)+0 Such that:it(4) =< V1 with precondition: [V>=0,Out>=1,V1>=Out] #### Cost of chains of start(V,V1): * Chain [6]: 1*s(1)+0 Such that:s(1) =< V1 with precondition: [V>=0,V1>=0] Closed-form bounds of start(V,V1): ------------------------------------- * Chain [6] with precondition: [V>=0,V1>=0] - Upper bound: V1 - Complexity: n ### Maximum cost of start(V,V1): V1 Asymptotic class: n * Total analysis performed in 57 ms. ---------------------------------------- (12) BOUNDS(1, n^1) ---------------------------------------- (13) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (14) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *(x, +(y, z)) -> +(*(x, y), *(x, z)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (15) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence *(x, +(y, z)) ->^+ +(*(x, y), *(x, z)) gives rise to a decreasing loop by considering the right hand sides subterm at position [0]. The pumping substitution is [y / +(y, z)]. The result substitution is [ ]. ---------------------------------------- (16) Complex Obligation (BEST) ---------------------------------------- (17) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *(x, +(y, z)) -> +(*(x, y), *(x, z)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (18) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (19) BOUNDS(n^1, INF) ---------------------------------------- (20) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *(x, +(y, z)) -> +(*(x, y), *(x, z)) S is empty. Rewrite Strategy: INNERMOST