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