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