/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.koat /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^1)) 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^1, n^1). (0) CpxIntTrs (1) Koat Proof [FINISHED, 22 ms] (2) BOUNDS(1, n^1) (3) Loat Proof [FINISHED, 206 ms] (4) BOUNDS(n^1, INF) ---------------------------------------- (0) Obligation: Complexity Int TRS consisting of the following rules: evalfstart(A, B) -> Com_1(evalfentryin(A, B)) :|: TRUE evalfentryin(A, B) -> Com_1(evalfbb1in(B, A)) :|: TRUE evalfbb1in(A, B) -> Com_1(evalfbbin(A, B)) :|: A >= B evalfbb1in(A, B) -> Com_1(evalfreturnin(A, B)) :|: B >= A + 1 evalfbbin(A, B) -> Com_1(evalfbb1in(A, B + 1)) :|: TRUE evalfreturnin(A, B) -> Com_1(evalfstop(A, B)) :|: TRUE The start-symbols are:[evalfstart_2] ---------------------------------------- (1) Koat Proof (FINISHED) YES(?, 2*Ar_0 + 2*Ar_1 + 8) Initial complexity problem: 1: T: (Comp: ?, Cost: 1) evalfstart(Ar_0, Ar_1) -> Com_1(evalfentryin(Ar_0, Ar_1)) (Comp: ?, Cost: 1) evalfentryin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_1, Ar_0)) (Comp: ?, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfbbin(Ar_0, Ar_1)) [ Ar_0 >= Ar_1 ] (Comp: ?, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfreturnin(Ar_0, Ar_1)) [ Ar_1 >= Ar_0 + 1 ] (Comp: ?, Cost: 1) evalfbbin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_0, Ar_1 + 1)) (Comp: ?, Cost: 1) evalfreturnin(Ar_0, Ar_1) -> Com_1(evalfstop(Ar_0, Ar_1)) (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(evalfstart(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 Repeatedly propagating knowledge in problem 1 produces the following problem: 2: T: (Comp: 1, Cost: 1) evalfstart(Ar_0, Ar_1) -> Com_1(evalfentryin(Ar_0, Ar_1)) (Comp: 1, Cost: 1) evalfentryin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_1, Ar_0)) (Comp: ?, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfbbin(Ar_0, Ar_1)) [ Ar_0 >= Ar_1 ] (Comp: ?, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfreturnin(Ar_0, Ar_1)) [ Ar_1 >= Ar_0 + 1 ] (Comp: ?, Cost: 1) evalfbbin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_0, Ar_1 + 1)) (Comp: ?, Cost: 1) evalfreturnin(Ar_0, Ar_1) -> Com_1(evalfstop(Ar_0, Ar_1)) (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(evalfstart(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 A polynomial rank function with Pol(evalfstart) = 2 Pol(evalfentryin) = 2 Pol(evalfbb1in) = 2 Pol(evalfbbin) = 2 Pol(evalfreturnin) = 1 Pol(evalfstop) = 0 Pol(koat_start) = 2 orients all transitions weakly and the transitions evalfreturnin(Ar_0, Ar_1) -> Com_1(evalfstop(Ar_0, Ar_1)) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfreturnin(Ar_0, Ar_1)) [ Ar_1 >= Ar_0 + 1 ] strictly and produces the following problem: 3: T: (Comp: 1, Cost: 1) evalfstart(Ar_0, Ar_1) -> Com_1(evalfentryin(Ar_0, Ar_1)) (Comp: 1, Cost: 1) evalfentryin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_1, Ar_0)) (Comp: ?, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfbbin(Ar_0, Ar_1)) [ Ar_0 >= Ar_1 ] (Comp: 2, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfreturnin(Ar_0, Ar_1)) [ Ar_1 >= Ar_0 + 1 ] (Comp: ?, Cost: 1) evalfbbin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_0, Ar_1 + 1)) (Comp: 2, Cost: 1) evalfreturnin(Ar_0, Ar_1) -> Com_1(evalfstop(Ar_0, Ar_1)) (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(evalfstart(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 A polynomial rank function with Pol(evalfstart) = -V_1 + V_2 + 1 Pol(evalfentryin) = -V_1 + V_2 + 1 Pol(evalfbb1in) = V_1 - V_2 + 1 Pol(evalfbbin) = V_1 - V_2 Pol(evalfreturnin) = V_1 - V_2 Pol(evalfstop) = V_1 - V_2 Pol(koat_start) = -V_1 + V_2 + 1 orients all transitions weakly and the transition evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfbbin(Ar_0, Ar_1)) [ Ar_0 >= Ar_1 ] strictly and produces the following problem: 4: T: (Comp: 1, Cost: 1) evalfstart(Ar_0, Ar_1) -> Com_1(evalfentryin(Ar_0, Ar_1)) (Comp: 1, Cost: 1) evalfentryin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_1, Ar_0)) (Comp: Ar_0 + Ar_1 + 1, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfbbin(Ar_0, Ar_1)) [ Ar_0 >= Ar_1 ] (Comp: 2, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfreturnin(Ar_0, Ar_1)) [ Ar_1 >= Ar_0 + 1 ] (Comp: ?, Cost: 1) evalfbbin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_0, Ar_1 + 1)) (Comp: 2, Cost: 1) evalfreturnin(Ar_0, Ar_1) -> Com_1(evalfstop(Ar_0, Ar_1)) (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(evalfstart(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 Repeatedly propagating knowledge in problem 4 produces the following problem: 5: T: (Comp: 1, Cost: 1) evalfstart(Ar_0, Ar_1) -> Com_1(evalfentryin(Ar_0, Ar_1)) (Comp: 1, Cost: 1) evalfentryin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_1, Ar_0)) (Comp: Ar_0 + Ar_1 + 1, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfbbin(Ar_0, Ar_1)) [ Ar_0 >= Ar_1 ] (Comp: 2, Cost: 1) evalfbb1in(Ar_0, Ar_1) -> Com_1(evalfreturnin(Ar_0, Ar_1)) [ Ar_1 >= Ar_0 + 1 ] (Comp: Ar_0 + Ar_1 + 1, Cost: 1) evalfbbin(Ar_0, Ar_1) -> Com_1(evalfbb1in(Ar_0, Ar_1 + 1)) (Comp: 2, Cost: 1) evalfreturnin(Ar_0, Ar_1) -> Com_1(evalfstop(Ar_0, Ar_1)) (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(evalfstart(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 Complexity upper bound 2*Ar_0 + 2*Ar_1 + 8 Time: 0.034 sec (SMT: 0.026 sec) ---------------------------------------- (2) BOUNDS(1, n^1) ---------------------------------------- (3) Loat Proof (FINISHED) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: evalfstart 0: evalfstart -> evalfentryin : [], cost: 1 1: evalfentryin -> evalfbb1in : A'=B, B'=A, [], cost: 1 2: evalfbb1in -> evalfbbin : [ A>=B ], cost: 1 3: evalfbb1in -> evalfreturnin : [ B>=1+A ], cost: 1 4: evalfbbin -> evalfbb1in : B'=1+B, [], cost: 1 5: evalfreturnin -> evalfstop : [], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 0: evalfstart -> evalfentryin : [], cost: 1 Removed unreachable and leaf rules: Start location: evalfstart 0: evalfstart -> evalfentryin : [], cost: 1 1: evalfentryin -> evalfbb1in : A'=B, B'=A, [], cost: 1 2: evalfbb1in -> evalfbbin : [ A>=B ], cost: 1 4: evalfbbin -> evalfbb1in : B'=1+B, [], cost: 1 ### Simplification by acceleration and chaining ### Eliminated locations (on linear paths): Start location: evalfstart 6: evalfstart -> evalfbb1in : A'=B, B'=A, [], cost: 2 7: evalfbb1in -> evalfbb1in : B'=1+B, [ A>=B ], cost: 2 Accelerating simple loops of location 2. Accelerating the following rules: 7: evalfbb1in -> evalfbb1in : B'=1+B, [ A>=B ], cost: 2 Accelerated rule 7 with metering function 1+A-B, yielding the new rule 8. Removing the simple loops: 7. Accelerated all simple loops using metering functions (where possible): Start location: evalfstart 6: evalfstart -> evalfbb1in : A'=B, B'=A, [], cost: 2 8: evalfbb1in -> evalfbb1in : B'=1+A, [ A>=B ], cost: 2+2*A-2*B Chained accelerated rules (with incoming rules): Start location: evalfstart 6: evalfstart -> evalfbb1in : A'=B, B'=A, [], cost: 2 9: evalfstart -> evalfbb1in : A'=B, B'=1+B, [ B>=A ], cost: 4-2*A+2*B Removed unreachable locations (and leaf rules with constant cost): Start location: evalfstart 9: evalfstart -> evalfbb1in : A'=B, B'=1+B, [ B>=A ], cost: 4-2*A+2*B ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: evalfstart 9: evalfstart -> evalfbb1in : A'=B, B'=1+B, [ B>=A ], cost: 4-2*A+2*B Computing asymptotic complexity for rule 9 Solved the limit problem by the following transformations: Created initial limit problem: 1-A+B (+/+!), 4-2*A+2*B (+) [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+2*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: 4+2*n Rule cost: 4-2*A+2*B Rule guard: [ B>=A ] WORST_CASE(Omega(n^1),?) ---------------------------------------- (4) BOUNDS(n^1, INF)