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