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