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