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