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