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