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