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