/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^1)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxTRS (3) RelTrsToWeightedTrsProof [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, 167 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 (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: f(s(x), x) -> f(s(x), round(s(x))) round(0) -> 0 round(0) -> s(0) round(s(0)) -> s(0) round(s(s(x))) -> s(s(round(x))) S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. As the TRS is a non-duplicating overlay system, we have rc = irc. ---------------------------------------- (2) 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(s(x), x) -> f(s(x), round(s(x))) round(0) -> 0 round(0) -> s(0) round(s(0)) -> s(0) round(s(s(x))) -> s(s(round(x))) S is empty. 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: f(s(x), x) -> f(s(x), round(s(x))) [1] round(0) -> 0 [1] round(0) -> s(0) [1] round(s(0)) -> s(0) [1] round(s(s(x))) -> s(s(round(x))) [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: f(s(x), x) -> f(s(x), round(s(x))) [1] round(0) -> 0 [1] round(0) -> s(0) [1] round(s(0)) -> s(0) [1] round(s(s(x))) -> s(s(round(x))) [1] The TRS has the following type information: f :: s:0 -> s:0 -> f s :: s:0 -> s:0 round :: s:0 -> s:0 0 :: s:0 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: f(v0, v1) -> null_f [0] And the following fresh constants: null_f ---------------------------------------- (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: f(s(x), x) -> f(s(x), round(s(x))) [1] round(0) -> 0 [1] round(0) -> s(0) [1] round(s(0)) -> s(0) [1] round(s(s(x))) -> s(s(round(x))) [1] f(v0, v1) -> null_f [0] The TRS has the following type information: f :: s:0 -> s:0 -> null_f s :: s:0 -> s:0 round :: s:0 -> s:0 0 :: s:0 null_f :: null_f 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: 0 => 0 null_f => 0 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: f(z, z') -{ 1 }-> f(1 + x, round(1 + x)) :|: z' = x, x >= 0, z = 1 + x f(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 round(z) -{ 1 }-> 0 :|: z = 0 round(z) -{ 1 }-> 1 + 0 :|: z = 0 round(z) -{ 1 }-> 1 + 0 :|: z = 1 + 0 round(z) -{ 1 }-> 1 + (1 + round(x)) :|: x >= 0, z = 1 + (1 + x) 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(V1, V),0,[f(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[round(V1, Out)],[V1 >= 0]). eq(f(V1, V, Out),1,[round(1 + V2, Ret1),f(1 + V2, Ret1, Ret)],[Out = Ret,V = V2,V2 >= 0,V1 = 1 + V2]). eq(round(V1, Out),1,[],[Out = 0,V1 = 0]). eq(round(V1, Out),1,[],[Out = 1,V1 = 0]). eq(round(V1, Out),1,[],[Out = 1,V1 = 1]). eq(round(V1, Out),1,[round(V3, Ret11)],[Out = 2 + Ret11,V3 >= 0,V1 = 2 + V3]). eq(f(V1, V, Out),0,[],[Out = 0,V5 >= 0,V4 >= 0,V1 = V5,V = V4]). input_output_vars(f(V1,V,Out),[V1,V],[Out]). input_output_vars(round(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [round/2] 1. recursive : [f/3] 2. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into round/2 1. SCC is partially evaluated into f/3 2. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations round/2 * CE 8 is refined into CE [9] * CE 7 is refined into CE [10] * CE 6 is refined into CE [11] * CE 5 is refined into CE [12] ### Cost equations --> "Loop" of round/2 * CEs [10] --> Loop 8 * CEs [11] --> Loop 9 * CEs [12] --> Loop 10 * CEs [9] --> Loop 11 ### Ranking functions of CR round(V1,Out) * RF of phase [11]: [V1-1] #### Partial ranking functions of CR round(V1,Out) * Partial RF of phase [11]: - RF of loop [11:1]: V1-1 ### Specialization of cost equations f/3 * CE 4 is refined into CE [13] * CE 3 is refined into CE [14,15,16] ### Cost equations --> "Loop" of f/3 * CEs [16] --> Loop 12 * CEs [15] --> Loop 13 * CEs [14] --> Loop 14 * CEs [13] --> Loop 15 ### Ranking functions of CR f(V1,V,Out) #### Partial ranking functions of CR f(V1,V,Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [17,18] * CE 2 is refined into CE [19,20,21,22,23] ### Cost equations --> "Loop" of start/2 * CEs [22,23] --> Loop 16 * CEs [17,18] --> Loop 17 * CEs [21] --> Loop 18 * CEs [19,20] --> Loop 19 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of round(V1,Out): * Chain [[11],10]: 1*it(11)+1 Such that:it(11) =< Out with precondition: [V1=Out,V1>=2] * Chain [[11],9]: 1*it(11)+1 Such that:it(11) =< Out with precondition: [V1+1=Out,V1>=2] * Chain [[11],8]: 1*it(11)+1 Such that:it(11) =< Out with precondition: [V1=Out,V1>=3] * Chain [10]: 1 with precondition: [V1=0,Out=0] * Chain [9]: 1 with precondition: [V1=0,Out=1] * Chain [8]: 1 with precondition: [V1=1,Out=1] #### Cost of chains of f(V1,V,Out): * Chain [15]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [14,15]: 2 with precondition: [V1=1,V=0,Out=0] * Chain [13,15]: 1*s(3)+2 Such that:s(3) =< V1+1 with precondition: [Out=0,V1=V+1,V1>=2] * Chain [12,15]: 2*s(5)+2 Such that:s(4) =< V1 s(5) =< s(4) with precondition: [Out=0,V+1=V1,V>=1] #### Cost of chains of start(V1,V): * Chain [19]: 1 with precondition: [V1=0] * Chain [18]: 1 with precondition: [V1=1] * Chain [17]: 1*s(10)+2*s(11)+2 Such that:s(9) =< V+1 s(10) =< V+2 s(11) =< s(9) with precondition: [V1>=0,V>=0] * Chain [16]: 1*s(12)+2*s(14)+1 Such that:s(13) =< V1 s(12) =< V1+1 s(14) =< s(13) with precondition: [V1>=2] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [19] with precondition: [V1=0] - Upper bound: 1 - Complexity: constant * Chain [18] with precondition: [V1=1] - Upper bound: 1 - Complexity: constant * Chain [17] with precondition: [V1>=0,V>=0] - Upper bound: 3*V+6 - Complexity: n * Chain [16] with precondition: [V1>=2] - Upper bound: 3*V1+2 - Complexity: n ### Maximum cost of start(V1,V): max([3*V1+1,nat(V+1)*2+1+nat(V+2)])+1 Asymptotic class: n * Total analysis performed in 101 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 (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: f(s(x), x) -> f(s(x), round(s(x))) round(0) -> 0 round(0) -> s(0) round(s(0)) -> s(0) round(s(s(x))) -> s(s(round(x))) S is empty. Rewrite Strategy: FULL ---------------------------------------- (15) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence round(s(s(x))) ->^+ s(s(round(x))) gives rise to a decreasing loop by considering the right hand sides subterm at position [0,0]. The pumping substitution is [x / s(s(x))]. The result substitution is [ ]. ---------------------------------------- (16) Complex Obligation (BEST) ---------------------------------------- (17) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: f(s(x), x) -> f(s(x), round(s(x))) round(0) -> 0 round(0) -> s(0) round(s(0)) -> s(0) round(s(s(x))) -> s(s(round(x))) S is empty. Rewrite Strategy: FULL ---------------------------------------- (18) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (19) BOUNDS(n^1, INF) ---------------------------------------- (20) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: f(s(x), x) -> f(s(x), round(s(x))) round(0) -> 0 round(0) -> s(0) round(s(0)) -> s(0) round(s(s(x))) -> s(s(round(x))) S is empty. Rewrite Strategy: FULL