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