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