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 CpxRelTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 228 ms] (2) CpxRelTRS (3) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxWeightedTrs (5) CpxWeightedTrsRenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxWeightedTrs (7) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTypedWeightedTrs (9) CompletionProof [UPPER BOUND(ID), 0 ms] (10) CpxTypedWeightedCompleteTrs (11) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (12) CpxRNTS (13) CompleteCoflocoProof [FINISHED, 160 ms] (14) BOUNDS(1, n^1) (15) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (16) TRS for Loop Detection (17) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) TRS for Loop Detection ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) The (relative) TRS S consists of the following rules: *(z0, +(z1, z2)) -> +(*(z0, z1), *(z0, z2)) Rewrite Strategy: INNERMOST ---------------------------------------- (1) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) The (relative) TRS S consists of the following rules: *(z0, +(z1, z2)) -> +(*(z0, z1), *(z0, z2)) Rewrite Strategy: INNERMOST ---------------------------------------- (3) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (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: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) [1] *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) [1] *(z0, +(z1, z2)) -> +(*(z0, z1), *(z0, z2)) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (5) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: * => times ---------------------------------------- (6) 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: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) [1] *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) [1] times(z0, +(z1, z2)) -> +(times(z0, z1), times(z0, z2)) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (7) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (8) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) [1] *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) [1] times(z0, +(z1, z2)) -> +(times(z0, z1), times(z0, z2)) [0] The TRS has the following type information: *' :: a -> + -> c:c1 + :: + -> + -> + c :: c:c1 -> c:c1 c1 :: c:c1 -> c:c1 times :: b -> + -> + Rewrite Strategy: INNERMOST ---------------------------------------- (9) 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] *'(v0, v1) -> null_*' [0] And the following fresh constants: null_times, null_*', const, const1 ---------------------------------------- (10) 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: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) [1] *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) [1] times(z0, +(z1, z2)) -> +(times(z0, z1), times(z0, z2)) [0] times(v0, v1) -> null_times [0] *'(v0, v1) -> null_*' [0] The TRS has the following type information: *' :: a -> +:null_times -> c:c1:null_*' + :: +:null_times -> +:null_times -> +:null_times c :: c:c1:null_*' -> c:c1:null_*' c1 :: c:c1:null_*' -> c:c1:null_*' times :: b -> +:null_times -> +:null_times null_times :: +:null_times null_*' :: c:c1:null_*' const :: a const1 :: b Rewrite Strategy: INNERMOST ---------------------------------------- (11) 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 null_*' => 0 const => 0 const1 => 0 ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: *'(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 *'(z, z') -{ 1 }-> 1 + *'(z0, z1) :|: z = z0, z1 >= 0, z' = 1 + z1 + z2, z0 >= 0, z2 >= 0 *'(z, z') -{ 1 }-> 1 + *'(z0, z2) :|: z = z0, z1 >= 0, z' = 1 + z1 + z2, z0 >= 0, z2 >= 0 times(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 times(z, z') -{ 0 }-> 1 + times(z0, z1) + times(z0, z2) :|: z = z0, z1 >= 0, z' = 1 + z1 + z2, z0 >= 0, z2 >= 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (13) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[times(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[fun(V3, V2, Ret1)],[Out = 1 + Ret1,V1 = V3,V2 >= 0,V = 1 + V2 + V4,V3 >= 0,V4 >= 0]). eq(fun(V1, V, Out),1,[fun(V7, V5, Ret11)],[Out = 1 + Ret11,V1 = V7,V6 >= 0,V = 1 + V5 + V6,V7 >= 0,V5 >= 0]). eq(times(V1, V, Out),0,[times(V10, V9, Ret01),times(V10, V8, Ret12)],[Out = 1 + Ret01 + Ret12,V1 = V10,V9 >= 0,V = 1 + V8 + V9,V10 >= 0,V8 >= 0]). eq(times(V1, V, Out),0,[],[Out = 0,V12 >= 0,V11 >= 0,V1 = V12,V = V11]). eq(fun(V1, V, Out),0,[],[Out = 0,V14 >= 0,V13 >= 0,V1 = V14,V = V13]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(times(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun/3] 1. recursive [multiple] : [times/3] 2. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into times/3 2. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 4 is refined into CE [7] * CE 3 is refined into CE [8] ### Cost equations --> "Loop" of fun/3 * CEs [8] --> Loop 6 * CEs [7] --> Loop 7 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [6]: [V] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [6]: - RF of loop [6:1]: V ### Specialization of cost equations times/3 * CE 6 is refined into CE [9] * CE 5 is refined into CE [10] ### Cost equations --> "Loop" of times/3 * CEs [10] --> Loop 8 * CEs [9] --> Loop 9 ### Ranking functions of CR times(V1,V,Out) * RF of phase [8]: [V] #### Partial ranking functions of CR times(V1,V,Out) * Partial RF of phase [8]: - RF of loop [8:1,8:2]: V ### Specialization of cost equations start/2 * CE 1 is refined into CE [11,12] * CE 2 is refined into CE [13,14] ### Cost equations --> "Loop" of start/2 * CEs [11,12,13,14] --> Loop 10 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of fun(V1,V,Out): * Chain [[6],7]: 1*it(6)+0 Such that:it(6) =< V with precondition: [V1>=0,Out>=1,V>=Out] * Chain [7]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of times(V1,V,Out): * Chain [9]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [multiple([8],[[9]])]: 0 with precondition: [V1>=0,Out>=1,V>=Out] #### Cost of chains of start(V1,V): * Chain [10]: 1*s(1)+0 Such that:s(1) =< V with precondition: [V1>=0,V>=0] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [10] with precondition: [V1>=0,V>=0] - Upper bound: V - Complexity: n ### Maximum cost of start(V1,V): V Asymptotic class: n * Total analysis performed in 93 ms. ---------------------------------------- (14) BOUNDS(1, n^1) ---------------------------------------- (15) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (16) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) The (relative) TRS S consists of the following rules: *(z0, +(z1, z2)) -> +(*(z0, z1), *(z0, z2)) Rewrite Strategy: INNERMOST ---------------------------------------- (17) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence *'(z0, +(z1, z2)) ->^+ c(*'(z0, z1)) gives rise to a decreasing loop by considering the right hand sides subterm at position [0]. The pumping substitution is [z1 / +(z1, z2)]. The result substitution is [ ]. ---------------------------------------- (18) Complex Obligation (BEST) ---------------------------------------- (19) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) The (relative) TRS S consists of the following rules: *(z0, +(z1, z2)) -> +(*(z0, z1), *(z0, z2)) Rewrite Strategy: INNERMOST ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: *'(z0, +(z1, z2)) -> c(*'(z0, z1)) *'(z0, +(z1, z2)) -> c1(*'(z0, z2)) The (relative) TRS S consists of the following rules: *(z0, +(z1, z2)) -> +(*(z0, z1), *(z0, z2)) Rewrite Strategy: INNERMOST