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