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