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