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