3.61/1.85 WORST_CASE(Omega(n^1), O(n^1)) 3.61/1.86 proof of /export/starexec/sandbox/benchmark/theBenchmark.koat 3.61/1.86 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 3.61/1.86 3.61/1.86 3.61/1.86 The runtime complexity of the given CpxIntTrs could be proven to be BOUNDS(n^1, max(2, 2 + Arg_0)). 3.61/1.86 3.61/1.86 (0) CpxIntTrs 3.61/1.86 (1) Koat2 Proof [FINISHED, 29 ms] 3.61/1.86 (2) BOUNDS(1, max(2, 2 + Arg_0)) 3.61/1.86 (3) Loat Proof [FINISHED, 104 ms] 3.61/1.86 (4) BOUNDS(n^1, INF) 3.61/1.86 3.61/1.86 3.61/1.86 ---------------------------------------- 3.61/1.86 3.61/1.86 (0) 3.61/1.86 Obligation: 3.61/1.86 Complexity Int TRS consisting of the following rules: 3.61/1.86 f2(A, B) -> Com_1(f3(A, 1)) :|: 0 >= A 3.61/1.86 f0(A, B) -> Com_1(f2(A, 0)) :|: TRUE 3.61/1.86 f2(A, B) -> Com_1(f2(A - 1, B)) :|: A >= 1 3.61/1.86 3.61/1.86 The start-symbols are:[f0_2] 3.61/1.86 3.61/1.86 3.61/1.86 ---------------------------------------- 3.61/1.86 3.61/1.86 (1) Koat2 Proof (FINISHED) 3.61/1.86 YES( ?, max([2, 2+Arg_0]) {O(n)}) 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Initial Complexity Problem: 3.61/1.86 3.61/1.86 Start: f0 3.61/1.86 3.61/1.86 Program_Vars: Arg_0, Arg_1 3.61/1.86 3.61/1.86 Temp_Vars: 3.61/1.86 3.61/1.86 Locations: f0, f2, f3 3.61/1.86 3.61/1.86 Transitions: 3.61/1.86 3.61/1.86 f0(Arg_0,Arg_1) -> f2(Arg_0,0):|: 3.61/1.86 3.61/1.86 f2(Arg_0,Arg_1) -> f2(Arg_0-1,Arg_1):|:Arg_1 <= 0 && 0 <= Arg_1 && 1 <= Arg_0 3.61/1.86 3.61/1.86 f2(Arg_0,Arg_1) -> f3(Arg_0,1):|:Arg_1 <= 0 && 0 <= Arg_1 && Arg_0 <= 0 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Timebounds: 3.61/1.86 3.61/1.86 Overall timebound: max([2, 2+Arg_0]) {O(n)} 3.61/1.86 3.61/1.86 1: f0->f2: 1 {O(1)} 3.61/1.86 3.61/1.86 0: f2->f3: 1 {O(1)} 3.61/1.86 3.61/1.86 2: f2->f2: max([0, Arg_0]) {O(n)} 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Costbounds: 3.61/1.86 3.61/1.86 Overall costbound: max([2, 2+Arg_0]) {O(n)} 3.61/1.86 3.61/1.86 1: f0->f2: 1 {O(1)} 3.61/1.86 3.61/1.86 0: f2->f3: 1 {O(1)} 3.61/1.86 3.61/1.86 2: f2->f2: max([0, Arg_0]) {O(n)} 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Sizebounds: 3.61/1.86 3.61/1.86 `Lower: 3.61/1.86 3.61/1.86 1: f0->f2, Arg_0: Arg_0 {O(n)} 3.61/1.86 3.61/1.86 1: f0->f2, Arg_1: 0 {O(1)} 3.61/1.86 3.61/1.86 0: f2->f3, Arg_0: min([0, Arg_0]) {O(n)} 3.61/1.86 3.61/1.86 0: f2->f3, Arg_1: 1 {O(1)} 3.61/1.86 3.61/1.86 2: f2->f2, Arg_0: 0 {O(1)} 3.61/1.86 3.61/1.86 2: f2->f2, Arg_1: 0 {O(1)} 3.61/1.86 3.61/1.86 `Upper: 3.61/1.86 3.61/1.86 1: f0->f2, Arg_0: Arg_0 {O(n)} 3.61/1.86 3.61/1.86 1: f0->f2, Arg_1: 0 {O(1)} 3.61/1.86 3.61/1.86 0: f2->f3, Arg_0: 0 {O(1)} 3.61/1.86 3.61/1.86 0: f2->f3, Arg_1: 1 {O(1)} 3.61/1.86 3.61/1.86 2: f2->f2, Arg_0: Arg_0 {O(n)} 3.61/1.86 3.61/1.86 2: f2->f2, Arg_1: 0 {O(1)} 3.61/1.86 3.61/1.86 3.61/1.86 ---------------------------------------- 3.61/1.86 3.61/1.86 (2) 3.61/1.86 BOUNDS(1, max(2, 2 + Arg_0)) 3.61/1.86 3.61/1.86 ---------------------------------------- 3.61/1.86 3.61/1.86 (3) Loat Proof (FINISHED) 3.61/1.86 3.61/1.86 3.61/1.86 ### Pre-processing the ITS problem ### 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Initial linear ITS problem 3.61/1.86 3.61/1.86 Start location: f0 3.61/1.86 3.61/1.86 0: f2 -> f3 : B'=1, [ 0>=A ], cost: 1 3.61/1.86 3.61/1.86 2: f2 -> f2 : A'=-1+A, [ A>=1 ], cost: 1 3.61/1.86 3.61/1.86 1: f0 -> f2 : B'=0, [], cost: 1 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Removed unreachable and leaf rules: 3.61/1.86 3.61/1.86 Start location: f0 3.61/1.86 3.61/1.86 2: f2 -> f2 : A'=-1+A, [ A>=1 ], cost: 1 3.61/1.86 3.61/1.86 1: f0 -> f2 : B'=0, [], cost: 1 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 ### Simplification by acceleration and chaining ### 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Accelerating simple loops of location 0. 3.61/1.86 3.61/1.86 Accelerating the following rules: 3.61/1.86 3.61/1.86 2: f2 -> f2 : A'=-1+A, [ A>=1 ], cost: 1 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Accelerated rule 2 with metering function A, yielding the new rule 3. 3.61/1.86 3.61/1.86 Removing the simple loops: 2. 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Accelerated all simple loops using metering functions (where possible): 3.61/1.86 3.61/1.86 Start location: f0 3.61/1.86 3.61/1.86 3: f2 -> f2 : A'=0, [ A>=1 ], cost: A 3.61/1.86 3.61/1.86 1: f0 -> f2 : B'=0, [], cost: 1 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Chained accelerated rules (with incoming rules): 3.61/1.86 3.61/1.86 Start location: f0 3.61/1.86 3.61/1.86 1: f0 -> f2 : B'=0, [], cost: 1 3.61/1.86 3.61/1.86 4: f0 -> f2 : A'=0, B'=0, [ A>=1 ], cost: 1+A 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Removed unreachable locations (and leaf rules with constant cost): 3.61/1.86 3.61/1.86 Start location: f0 3.61/1.86 3.61/1.86 4: f0 -> f2 : A'=0, B'=0, [ A>=1 ], cost: 1+A 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 ### Computing asymptotic complexity ### 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Fully simplified ITS problem 3.61/1.86 3.61/1.86 Start location: f0 3.61/1.86 3.61/1.86 4: f0 -> f2 : A'=0, B'=0, [ A>=1 ], cost: 1+A 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Computing asymptotic complexity for rule 4 3.61/1.86 3.61/1.86 Solved the limit problem by the following transformations: 3.61/1.86 3.61/1.86 Created initial limit problem: 3.61/1.86 3.61/1.86 A (+/+!), 1+A (+) [not solved] 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 removing all constraints (solved by SMT) 3.61/1.86 3.61/1.86 resulting limit problem: [solved] 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 applying transformation rule (C) using substitution {A==n} 3.61/1.86 3.61/1.86 resulting limit problem: 3.61/1.86 3.61/1.86 [solved] 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Solution: 3.61/1.86 3.61/1.86 A / n 3.61/1.86 3.61/1.86 Resulting cost 1+n has complexity: Poly(n^1) 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Found new complexity Poly(n^1). 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 Obtained the following overall complexity (w.r.t. the length of the input n): 3.61/1.86 3.61/1.86 Complexity: Poly(n^1) 3.61/1.86 3.61/1.86 Cpx degree: 1 3.61/1.86 3.61/1.86 Solved cost: 1+n 3.61/1.86 3.61/1.86 Rule cost: 1+A 3.61/1.86 3.61/1.86 Rule guard: [ A>=1 ] 3.61/1.86 3.61/1.86 3.61/1.86 3.61/1.86 WORST_CASE(Omega(n^1),?) 3.61/1.86 3.61/1.86 3.61/1.86 ---------------------------------------- 3.61/1.86 3.61/1.86 (4) 3.61/1.86 BOUNDS(n^1, INF) 3.61/1.89 EOF