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