3.77/1.80 WORST_CASE(Omega(n^1), O(n^1)) 3.81/2.35 proof of /export/starexec/sandbox/benchmark/theBenchmark.koat 3.81/2.35 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 3.81/2.35 3.81/2.35 3.81/2.35 The runtime complexity of the given CpxIntTrs could be proven to be BOUNDS(n^1, n^1). 3.81/2.35 3.81/2.35 (0) CpxIntTrs 3.81/2.35 (1) Koat Proof [FINISHED, 5 ms] 3.81/2.35 (2) BOUNDS(1, n^1) 3.81/2.35 (3) Loat Proof [FINISHED, 134 ms] 3.81/2.35 (4) BOUNDS(n^1, INF) 3.81/2.35 3.81/2.35 3.81/2.35 ---------------------------------------- 3.81/2.35 3.81/2.35 (0) 3.81/2.35 Obligation: 3.81/2.35 Complexity Int TRS consisting of the following rules: 3.81/2.35 sumto(A, B) -> Com_1(end(A, B)) :|: A >= B + 1 3.81/2.35 sumto(A, B) -> Com_1(sumto(A + 1, B)) :|: B >= A 3.81/2.35 start(A, B) -> Com_1(sumto(A, B)) :|: TRUE 3.81/2.35 3.81/2.35 The start-symbols are:[start_2] 3.81/2.35 3.81/2.35 3.81/2.35 ---------------------------------------- 3.81/2.35 3.81/2.35 (1) Koat Proof (FINISHED) 3.81/2.35 YES(?, ar_0 + ar_1 + 3) 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Initial complexity problem: 3.81/2.35 3.81/2.35 1: T: 3.81/2.35 3.81/2.35 (Comp: ?, Cost: 1) sumto(ar_0, ar_1) -> Com_1(end(ar_0, ar_1)) [ ar_0 >= ar_1 + 1 ] 3.81/2.35 3.81/2.35 (Comp: ?, Cost: 1) sumto(ar_0, ar_1) -> Com_1(sumto(ar_0 + 1, ar_1)) [ ar_1 >= ar_0 ] 3.81/2.35 3.81/2.35 (Comp: ?, Cost: 1) start(ar_0, ar_1) -> Com_1(sumto(ar_0, ar_1)) 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 0) koat_start(ar_0, ar_1) -> Com_1(start(ar_0, ar_1)) [ 0 <= 0 ] 3.81/2.35 3.81/2.35 start location: koat_start 3.81/2.35 3.81/2.35 leaf cost: 0 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Repeatedly propagating knowledge in problem 1 produces the following problem: 3.81/2.35 3.81/2.35 2: T: 3.81/2.35 3.81/2.35 (Comp: ?, Cost: 1) sumto(ar_0, ar_1) -> Com_1(end(ar_0, ar_1)) [ ar_0 >= ar_1 + 1 ] 3.81/2.35 3.81/2.35 (Comp: ?, Cost: 1) sumto(ar_0, ar_1) -> Com_1(sumto(ar_0 + 1, ar_1)) [ ar_1 >= ar_0 ] 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 1) start(ar_0, ar_1) -> Com_1(sumto(ar_0, ar_1)) 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 0) koat_start(ar_0, ar_1) -> Com_1(start(ar_0, ar_1)) [ 0 <= 0 ] 3.81/2.35 3.81/2.35 start location: koat_start 3.81/2.35 3.81/2.35 leaf cost: 0 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 A polynomial rank function with 3.81/2.35 3.81/2.35 Pol(sumto) = 1 3.81/2.35 3.81/2.35 Pol(end) = 0 3.81/2.35 3.81/2.35 Pol(start) = 1 3.81/2.35 3.81/2.35 Pol(koat_start) = 1 3.81/2.35 3.81/2.35 orients all transitions weakly and the transition 3.81/2.35 3.81/2.35 sumto(ar_0, ar_1) -> Com_1(end(ar_0, ar_1)) [ ar_0 >= ar_1 + 1 ] 3.81/2.35 3.81/2.35 strictly and produces the following problem: 3.81/2.35 3.81/2.35 3: T: 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 1) sumto(ar_0, ar_1) -> Com_1(end(ar_0, ar_1)) [ ar_0 >= ar_1 + 1 ] 3.81/2.35 3.81/2.35 (Comp: ?, Cost: 1) sumto(ar_0, ar_1) -> Com_1(sumto(ar_0 + 1, ar_1)) [ ar_1 >= ar_0 ] 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 1) start(ar_0, ar_1) -> Com_1(sumto(ar_0, ar_1)) 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 0) koat_start(ar_0, ar_1) -> Com_1(start(ar_0, ar_1)) [ 0 <= 0 ] 3.81/2.35 3.81/2.35 start location: koat_start 3.81/2.35 3.81/2.35 leaf cost: 0 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 A polynomial rank function with 3.81/2.35 3.81/2.35 Pol(sumto) = -V_1 + V_2 + 1 3.81/2.35 3.81/2.35 Pol(end) = -V_1 + V_2 3.81/2.35 3.81/2.35 Pol(start) = -V_1 + V_2 + 1 3.81/2.35 3.81/2.35 Pol(koat_start) = -V_1 + V_2 + 1 3.81/2.35 3.81/2.35 orients all transitions weakly and the transition 3.81/2.35 3.81/2.35 sumto(ar_0, ar_1) -> Com_1(sumto(ar_0 + 1, ar_1)) [ ar_1 >= ar_0 ] 3.81/2.35 3.81/2.35 strictly and produces the following problem: 3.81/2.35 3.81/2.35 4: T: 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 1) sumto(ar_0, ar_1) -> Com_1(end(ar_0, ar_1)) [ ar_0 >= ar_1 + 1 ] 3.81/2.35 3.81/2.35 (Comp: ar_0 + ar_1 + 1, Cost: 1) sumto(ar_0, ar_1) -> Com_1(sumto(ar_0 + 1, ar_1)) [ ar_1 >= ar_0 ] 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 1) start(ar_0, ar_1) -> Com_1(sumto(ar_0, ar_1)) 3.81/2.35 3.81/2.35 (Comp: 1, Cost: 0) koat_start(ar_0, ar_1) -> Com_1(start(ar_0, ar_1)) [ 0 <= 0 ] 3.81/2.35 3.81/2.35 start location: koat_start 3.81/2.35 3.81/2.35 leaf cost: 0 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Complexity upper bound ar_0 + ar_1 + 3 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Time: 0.030 sec (SMT: 0.027 sec) 3.81/2.35 3.81/2.35 3.81/2.35 ---------------------------------------- 3.81/2.35 3.81/2.35 (2) 3.81/2.35 BOUNDS(1, n^1) 3.81/2.35 3.81/2.35 ---------------------------------------- 3.81/2.35 3.81/2.35 (3) Loat Proof (FINISHED) 3.81/2.35 3.81/2.35 3.81/2.35 ### Pre-processing the ITS problem ### 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Initial linear ITS problem 3.81/2.35 3.81/2.35 Start location: start 3.81/2.35 3.81/2.35 0: sumto -> end : [ A>=1+B ], cost: 1 3.81/2.35 3.81/2.35 1: sumto -> sumto : A'=1+A, [ B>=A ], cost: 1 3.81/2.35 3.81/2.35 2: start -> sumto : [], cost: 1 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Removed unreachable and leaf rules: 3.81/2.35 3.81/2.35 Start location: start 3.81/2.35 3.81/2.35 1: sumto -> sumto : A'=1+A, [ B>=A ], cost: 1 3.81/2.35 3.81/2.35 2: start -> sumto : [], cost: 1 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 ### Simplification by acceleration and chaining ### 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Accelerating simple loops of location 0. 3.81/2.35 3.81/2.35 Accelerating the following rules: 3.81/2.35 3.81/2.35 1: sumto -> sumto : A'=1+A, [ B>=A ], cost: 1 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Accelerated rule 1 with metering function 1-A+B, yielding the new rule 3. 3.81/2.35 3.81/2.35 Removing the simple loops: 1. 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Accelerated all simple loops using metering functions (where possible): 3.81/2.35 3.81/2.35 Start location: start 3.81/2.35 3.81/2.35 3: sumto -> sumto : A'=1+B, [ B>=A ], cost: 1-A+B 3.81/2.35 3.81/2.35 2: start -> sumto : [], cost: 1 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Chained accelerated rules (with incoming rules): 3.81/2.35 3.81/2.35 Start location: start 3.81/2.35 3.81/2.35 2: start -> sumto : [], cost: 1 3.81/2.35 3.81/2.35 4: start -> sumto : A'=1+B, [ B>=A ], cost: 2-A+B 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Removed unreachable locations (and leaf rules with constant cost): 3.81/2.35 3.81/2.35 Start location: start 3.81/2.35 3.81/2.35 4: start -> sumto : A'=1+B, [ B>=A ], cost: 2-A+B 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 ### Computing asymptotic complexity ### 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Fully simplified ITS problem 3.81/2.35 3.81/2.35 Start location: start 3.81/2.35 3.81/2.35 4: start -> sumto : A'=1+B, [ B>=A ], cost: 2-A+B 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Computing asymptotic complexity for rule 4 3.81/2.35 3.81/2.35 Solved the limit problem by the following transformations: 3.81/2.35 3.81/2.35 Created initial limit problem: 3.81/2.35 3.81/2.35 1-A+B (+/+!), 2-A+B (+) [not solved] 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 removing all constraints (solved by SMT) 3.81/2.35 3.81/2.35 resulting limit problem: [solved] 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 applying transformation rule (C) using substitution {A==0,B==n} 3.81/2.35 3.81/2.35 resulting limit problem: 3.81/2.35 3.81/2.35 [solved] 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Solution: 3.81/2.35 3.81/2.35 A / 0 3.81/2.35 3.81/2.35 B / n 3.81/2.35 3.81/2.35 Resulting cost 2+n has complexity: Poly(n^1) 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Found new complexity Poly(n^1). 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 Obtained the following overall complexity (w.r.t. the length of the input n): 3.81/2.35 3.81/2.35 Complexity: Poly(n^1) 3.81/2.35 3.81/2.35 Cpx degree: 1 3.81/2.35 3.81/2.35 Solved cost: 2+n 3.81/2.35 3.81/2.35 Rule cost: 2-A+B 3.81/2.35 3.81/2.35 Rule guard: [ B>=A ] 3.81/2.35 3.81/2.35 3.81/2.35 3.81/2.35 WORST_CASE(Omega(n^1),?) 3.81/2.35 3.81/2.35 3.81/2.35 ---------------------------------------- 3.81/2.35 3.81/2.35 (4) 3.81/2.35 BOUNDS(n^1, INF) 3.83/2.41 EOF