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