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