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