/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.koat /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^1)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.koat # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The runtime complexity of the given CpxIntTrs could be proven to be BOUNDS(n^1, max(2, 4 + 2 * Arg_1) + nat(1 + Arg_0) + nat(1 + Arg_1)). (0) CpxIntTrs (1) Koat2 Proof [FINISHED, 339 ms] (2) BOUNDS(1, max(2, 4 + 2 * Arg_1) + nat(1 + Arg_0) + nat(1 + Arg_1)) (3) Loat Proof [FINISHED, 397 ms] (4) BOUNDS(n^1, INF) ---------------------------------------- (0) Obligation: Complexity Int TRS consisting of the following rules: f2(A, B, C) -> Com_1(f2(-(1) + A, B, C)) :|: A >= 31 f2(A, B, C) -> Com_1(f300(A, -(1) + B, C)) :|: 30 >= A f300(A, B, C) -> Com_1(f2(A, B, C)) :|: B >= 21 f300(A, B, C) -> Com_1(f1(A, B, D)) :|: 20 >= B f3(A, B, C) -> Com_1(f300(A, B, C)) :|: TRUE The start-symbols are:[f3_3] ---------------------------------------- (1) Koat2 Proof (FINISHED) YES( ?, 2+max([0, 2*(1+Arg_1)])+max([0, 1+Arg_0])+max([0, 1+Arg_1]) {O(n)}) Initial Complexity Problem: Start: f3 Program_Vars: Arg_0, Arg_1, Arg_2 Temp_Vars: D Locations: f1, f2, f3, f300 Transitions: 0: f2->f2 1: f2->f300 4: f3->f300 3: f300->f1 2: f300->f2 Timebounds: Overall timebound: 2+max([0, 2*(1+Arg_1)])+max([0, 1+Arg_0])+max([0, 1+Arg_1]) {O(n)} 0: f2->f2: max([0, 1+Arg_0]) {O(n)} 1: f2->f300: max([0, 2*(1+Arg_1)]) {O(n)} 4: f3->f300: 1 {O(1)} 2: f300->f2: max([0, 1+Arg_1]) {O(n)} 3: f300->f1: 1 {O(1)} Costbounds: Overall costbound: 2+max([0, 2*(1+Arg_1)])+max([0, 1+Arg_0])+max([0, 1+Arg_1]) {O(n)} 0: f2->f2: max([0, 1+Arg_0]) {O(n)} 1: f2->f300: max([0, 2*(1+Arg_1)]) {O(n)} 4: f3->f300: 1 {O(1)} 2: f300->f2: max([0, 1+Arg_1]) {O(n)} 3: f300->f1: 1 {O(1)} Sizebounds: `Lower: 0: f2->f2, Arg_0: 30 {O(1)} 0: f2->f2, Arg_1: 21 {O(1)} 0: f2->f2, Arg_2: Arg_2 {O(n)} 1: f2->f300, Arg_0: min([30, Arg_0]) {O(n)} 1: f2->f300, Arg_1: 20 {O(1)} 1: f2->f300, Arg_2: Arg_2 {O(n)} 4: f3->f300, Arg_0: Arg_0 {O(n)} 4: f3->f300, Arg_1: Arg_1 {O(n)} 4: f3->f300, Arg_2: Arg_2 {O(n)} 2: f300->f2, Arg_0: min([30, Arg_0]) {O(n)} 2: f300->f2, Arg_1: 21 {O(1)} 2: f300->f2, Arg_2: Arg_2 {O(n)} 3: f300->f1, Arg_0: min([30, Arg_0]) {O(n)} 3: f300->f1, Arg_1: min([20, Arg_1]) {O(n)} `Upper: 0: f2->f2, Arg_0: max([30, Arg_0]) {O(n)} 0: f2->f2, Arg_1: Arg_1 {O(n)} 0: f2->f2, Arg_2: Arg_2 {O(n)} 1: f2->f300, Arg_0: 30 {O(1)} 1: f2->f300, Arg_1: Arg_1 {O(n)} 1: f2->f300, Arg_2: Arg_2 {O(n)} 4: f3->f300, Arg_0: Arg_0 {O(n)} 4: f3->f300, Arg_1: Arg_1 {O(n)} 4: f3->f300, Arg_2: Arg_2 {O(n)} 2: f300->f2, Arg_0: max([30, Arg_0]) {O(n)} 2: f300->f2, Arg_1: Arg_1 {O(n)} 2: f300->f2, Arg_2: Arg_2 {O(n)} 3: f300->f1, Arg_0: max([30, Arg_0]) {O(n)} 3: f300->f1, Arg_1: 20 {O(1)} ---------------------------------------- (2) BOUNDS(1, max(2, 4 + 2 * Arg_1) + nat(1 + Arg_0) + nat(1 + Arg_1)) ---------------------------------------- (3) Loat Proof (FINISHED) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: f3 0: f2 -> f2 : A'=-1+A, [ A>=31 ], cost: 1 1: f2 -> f300 : B'=-1+B, [ 30>=A ], cost: 1 2: f300 -> f2 : [ B>=21 ], cost: 1 3: f300 -> f1 : C'=free, [ 20>=B ], cost: 1 4: f3 -> f300 : [], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 4: f3 -> f300 : [], cost: 1 Removed unreachable and leaf rules: Start location: f3 0: f2 -> f2 : A'=-1+A, [ A>=31 ], cost: 1 1: f2 -> f300 : B'=-1+B, [ 30>=A ], cost: 1 2: f300 -> f2 : [ B>=21 ], cost: 1 4: f3 -> f300 : [], cost: 1 ### Simplification by acceleration and chaining ### Accelerating simple loops of location 0. Accelerating the following rules: 0: f2 -> f2 : A'=-1+A, [ A>=31 ], cost: 1 Accelerated rule 0 with metering function -30+A, yielding the new rule 5. Removing the simple loops: 0. Accelerated all simple loops using metering functions (where possible): Start location: f3 1: f2 -> f300 : B'=-1+B, [ 30>=A ], cost: 1 5: f2 -> f2 : A'=30, [ A>=31 ], cost: -30+A 2: f300 -> f2 : [ B>=21 ], cost: 1 4: f3 -> f300 : [], cost: 1 Chained accelerated rules (with incoming rules): Start location: f3 1: f2 -> f300 : B'=-1+B, [ 30>=A ], cost: 1 2: f300 -> f2 : [ B>=21 ], cost: 1 6: f300 -> f2 : A'=30, [ B>=21 && A>=31 ], cost: -29+A 4: f3 -> f300 : [], cost: 1 Eliminated locations (on tree-shaped paths): Start location: f3 7: f300 -> f300 : B'=-1+B, [ B>=21 && 30>=A ], cost: 2 8: f300 -> f300 : A'=30, B'=-1+B, [ B>=21 && A>=31 ], cost: -28+A 4: f3 -> f300 : [], cost: 1 Accelerating simple loops of location 1. Accelerating the following rules: 7: f300 -> f300 : B'=-1+B, [ B>=21 && 30>=A ], cost: 2 8: f300 -> f300 : A'=30, B'=-1+B, [ B>=21 && A>=31 ], cost: -28+A Accelerated rule 7 with metering function -20+B, yielding the new rule 9. Found no metering function for rule 8. Removing the simple loops: 7. Accelerated all simple loops using metering functions (where possible): Start location: f3 8: f300 -> f300 : A'=30, B'=-1+B, [ B>=21 && A>=31 ], cost: -28+A 9: f300 -> f300 : B'=20, [ B>=21 && 30>=A ], cost: -40+2*B 4: f3 -> f300 : [], cost: 1 Chained accelerated rules (with incoming rules): Start location: f3 4: f3 -> f300 : [], cost: 1 10: f3 -> f300 : A'=30, B'=-1+B, [ B>=21 && A>=31 ], cost: -27+A 11: f3 -> f300 : B'=20, [ B>=21 && 30>=A ], cost: -39+2*B Removed unreachable locations (and leaf rules with constant cost): Start location: f3 10: f3 -> f300 : A'=30, B'=-1+B, [ B>=21 && A>=31 ], cost: -27+A 11: f3 -> f300 : B'=20, [ B>=21 && 30>=A ], cost: -39+2*B ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: f3 10: f3 -> f300 : A'=30, B'=-1+B, [ B>=21 && A>=31 ], cost: -27+A 11: f3 -> f300 : B'=20, [ B>=21 && 30>=A ], cost: -39+2*B Computing asymptotic complexity for rule 10 Solved the limit problem by the following transformations: Created initial limit problem: -27+A (+), -30+A (+/+!), -20+B (+/+!) [not solved] removing all constraints (solved by SMT) resulting limit problem: [solved] applying transformation rule (C) using substitution {A==n,B==n} resulting limit problem: [solved] Solution: A / n B / n Resulting cost -27+n has complexity: Poly(n^1) Found new complexity Poly(n^1). Obtained the following overall complexity (w.r.t. the length of the input n): Complexity: Poly(n^1) Cpx degree: 1 Solved cost: -27+n Rule cost: -27+A Rule guard: [ B>=21 && A>=31 ] WORST_CASE(Omega(n^1),?) ---------------------------------------- (4) BOUNDS(n^1, INF)