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