/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.koat /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^2), ?) proof of /export/starexec/sandbox/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^2, INF). (0) CpxIntTrs (1) Loat Proof [FINISHED, 1138 ms] (2) BOUNDS(n^2, INF) ---------------------------------------- (0) Obligation: Complexity Int TRS consisting of the following rules: f1(A, B) -> Com_1(f2(A - 1, B)) :|: A >= 1 f2(A, B) -> Com_1(f2(A - 1, B + 1)) :|: A >= 1 f999(A, B) -> Com_1(f1(1, B - 1)) :|: B >= 1 && A >= 0 && A <= 0 f1(A, B) -> Com_1(f1(A + 1, B - 1)) :|: B >= 1 f2(A, B) -> Com_1(f1(A + 1, B - 1)) :|: B >= 1 The start-symbols are:[f999_2] ---------------------------------------- (1) Loat Proof (FINISHED) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: f999 0: f1 -> f2 : A'=-1+A, [ A>=1 ], cost: 1 3: f1 -> f1 : A'=1+A, B'=-1+B, [ B>=1 ], cost: 1 1: f2 -> f2 : A'=-1+A, B'=1+B, [ A>=1 ], cost: 1 4: f2 -> f1 : A'=1+A, B'=-1+B, [ B>=1 ], cost: 1 2: f999 -> f1 : A'=1, B'=-1+B, [ B>=1 && A==0 ], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 2: f999 -> f1 : A'=1, B'=-1+B, [ B>=1 && A==0 ], cost: 1 ### Simplification by acceleration and chaining ### Accelerating simple loops of location 0. Accelerating the following rules: 3: f1 -> f1 : A'=1+A, B'=-1+B, [ B>=1 ], cost: 1 Accelerated rule 3 with metering function B, yielding the new rule 5. Removing the simple loops: 3. Accelerating simple loops of location 1. Accelerating the following rules: 1: f2 -> f2 : A'=-1+A, B'=1+B, [ A>=1 ], cost: 1 Accelerated rule 1 with metering function A, yielding the new rule 6. Removing the simple loops: 1. Accelerated all simple loops using metering functions (where possible): Start location: f999 0: f1 -> f2 : A'=-1+A, [ A>=1 ], cost: 1 5: f1 -> f1 : A'=A+B, B'=0, [ B>=1 ], cost: B 4: f2 -> f1 : A'=1+A, B'=-1+B, [ B>=1 ], cost: 1 6: f2 -> f2 : A'=0, B'=A+B, [ A>=1 ], cost: A 2: f999 -> f1 : A'=1, B'=-1+B, [ B>=1 && A==0 ], cost: 1 Chained accelerated rules (with incoming rules): Start location: f999 0: f1 -> f2 : A'=-1+A, [ A>=1 ], cost: 1 9: f1 -> f2 : A'=0, B'=-1+A+B, [ -1+A>=1 ], cost: A 4: f2 -> f1 : A'=1+A, B'=-1+B, [ B>=1 ], cost: 1 8: f2 -> f1 : A'=A+B, B'=0, [ -1+B>=1 ], cost: B 2: f999 -> f1 : A'=1, B'=-1+B, [ B>=1 && A==0 ], cost: 1 7: f999 -> f1 : A'=B, B'=0, [ A==0 && -1+B>=1 ], cost: B Eliminated locations (on tree-shaped paths): Start location: f999 10: f1 -> f1 : A'=A, B'=-1+B, [ A>=1 && B>=1 ], cost: 2 11: f1 -> f1 : A'=-1+A+B, B'=0, [ A>=1 && -1+B>=1 ], cost: 1+B 12: f1 -> f1 : A'=1, B'=-2+A+B, [ -1+A>=1 && -1+A+B>=1 ], cost: 1+A 13: f1 -> f1 : A'=-1+A+B, B'=0, [ -1+A>=1 && -2+A+B>=1 ], cost: -1+2*A+B 2: f999 -> f1 : A'=1, B'=-1+B, [ B>=1 && A==0 ], cost: 1 7: f999 -> f1 : A'=B, B'=0, [ A==0 && -1+B>=1 ], cost: B Accelerating simple loops of location 0. Simplified some of the simple loops (and removed duplicate rules). Accelerating the following rules: 10: f1 -> f1 : B'=-1+B, [ A>=1 && B>=1 ], cost: 2 11: f1 -> f1 : A'=-1+A+B, B'=0, [ A>=1 && -1+B>=1 ], cost: 1+B 12: f1 -> f1 : A'=1, B'=-2+A+B, [ -1+A>=1 && -1+A+B>=1 ], cost: 1+A 13: f1 -> f1 : A'=-1+A+B, B'=0, [ -1+A>=1 && -2+A+B>=1 ], cost: -1+2*A+B Accelerated rule 10 with metering function B, yielding the new rule 14. Found no metering function for rule 11. Found no metering function for rule 12. Accelerated rule 13 with metering function -2+A+B, yielding the new rule 15. Removing the simple loops: 10 13. Accelerated all simple loops using metering functions (where possible): Start location: f999 11: f1 -> f1 : A'=-1+A+B, B'=0, [ A>=1 && -1+B>=1 ], cost: 1+B 12: f1 -> f1 : A'=1, B'=-2+A+B, [ -1+A>=1 && -1+A+B>=1 ], cost: 1+A 14: f1 -> f1 : B'=0, [ A>=1 && B>=1 ], cost: 2*B 15: f1 -> f1 : A'=2, B'=0, [ -1+A>=1 && -2+A+B>=1 ], cost: 2*(-2+A+B)*A+2*(-2+A+B)*B-(-2+A+B)^2 2: f999 -> f1 : A'=1, B'=-1+B, [ B>=1 && A==0 ], cost: 1 7: f999 -> f1 : A'=B, B'=0, [ A==0 && -1+B>=1 ], cost: B Chained accelerated rules (with incoming rules): Start location: f999 2: f999 -> f1 : A'=1, B'=-1+B, [ B>=1 && A==0 ], cost: 1 7: f999 -> f1 : A'=B, B'=0, [ A==0 && -1+B>=1 ], cost: B 16: f999 -> f1 : A'=-1+B, B'=0, [ A==0 && -2+B>=1 ], cost: 1+B 17: f999 -> f1 : A'=1, B'=-2+B, [ A==0 && -1+B>=1 ], cost: 1+2*B 18: f999 -> f1 : A'=1, B'=0, [ A==0 && -1+B>=1 ], cost: -1+2*B 19: f999 -> f1 : A'=2, B'=0, [ A==0 && -2+B>=1 ], cost: -(-2+B)^2+2*(-2+B)*B+B Removed unreachable locations (and leaf rules with constant cost): Start location: f999 7: f999 -> f1 : A'=B, B'=0, [ A==0 && -1+B>=1 ], cost: B 16: f999 -> f1 : A'=-1+B, B'=0, [ A==0 && -2+B>=1 ], cost: 1+B 17: f999 -> f1 : A'=1, B'=-2+B, [ A==0 && -1+B>=1 ], cost: 1+2*B 18: f999 -> f1 : A'=1, B'=0, [ A==0 && -1+B>=1 ], cost: -1+2*B 19: f999 -> f1 : A'=2, B'=0, [ A==0 && -2+B>=1 ], cost: -(-2+B)^2+2*(-2+B)*B+B ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: f999 7: f999 -> f1 : A'=B, B'=0, [ A==0 && -1+B>=1 ], cost: B 16: f999 -> f1 : A'=-1+B, B'=0, [ A==0 && -2+B>=1 ], cost: 1+B 17: f999 -> f1 : A'=1, B'=-2+B, [ A==0 && -1+B>=1 ], cost: 1+2*B 19: f999 -> f1 : A'=2, B'=0, [ A==0 && -2+B>=1 ], cost: -(-2+B)^2+2*(-2+B)*B+B Computing asymptotic complexity for rule 7 Solved the limit problem by the following transformations: Created initial limit problem: 1-A (+/+!), -1+B (+/+!), B (+), 1+A (+/+!) [not solved] removing all constraints (solved by SMT) resulting limit problem: [solved] applying transformation rule (C) using substitution {A==0,B==n} resulting limit problem: [solved] Solution: A / 0 B / n Resulting cost n has complexity: Poly(n^1) Found new complexity Poly(n^1). Computing asymptotic complexity for rule 19 Solved the limit problem by the following transformations: Created initial limit problem: 1-A (+/+!), -4+B+B^2 (+), -2+B (+/+!), 1+A (+/+!) [not solved] removing all constraints (solved by SMT) resulting limit problem: [solved] applying transformation rule (C) using substitution {A==0,B==n} resulting limit problem: [solved] Solution: A / 0 B / n Resulting cost -4+n^2+n has complexity: Poly(n^2) Found new complexity Poly(n^2). Obtained the following overall complexity (w.r.t. the length of the input n): Complexity: Poly(n^2) Cpx degree: 2 Solved cost: -4+n^2+n Rule cost: -(-2+B)^2+2*(-2+B)*B+B Rule guard: [ A==0 && -2+B>=1 ] WORST_CASE(Omega(n^2),?) ---------------------------------------- (2) BOUNDS(n^2, INF)