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