/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.koat /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(NON_POLY, ?) 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(EXP, EXP). (0) CpxIntTrs (1) Koat Proof [FINISHED, 6 ms] (2) BOUNDS(1, EXP) (3) Loat Proof [FINISHED, 626 ms] (4) BOUNDS(EXP, INF) ---------------------------------------- (0) Obligation: Complexity Int TRS consisting of the following rules: f(A, B) -> Com_1(g(A, B)) :|: TRUE g(A, B) -> Com_1(g(2 * A, B - 1)) :|: B > 0 g(A, B) -> Com_1(h(A, B)) :|: 0 >= B h(A, B) -> Com_1(h(A - 1, B)) :|: A > 0 The start-symbols are:[f_2] ---------------------------------------- (1) Koat Proof (FINISHED) YES(?, pow(2, Ar_0) * Ar_1 + Ar_0 + Ar_1 + 2) Initial complexity problem: 1: T: (Comp: ?, Cost: 1) f(Ar_0, Ar_1) -> Com_1(g(Ar_0, Ar_1)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(Ar_0 - 1, 2*Ar_1)) [ Ar_0 >= 1 ] (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_0 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(f(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) f(Ar_0, Ar_1) -> Com_1(g(Ar_0, Ar_1)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(Ar_0 - 1, 2*Ar_1)) [ Ar_0 >= 1 ] (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_0 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(f(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 A polynomial rank function with Pol(f) = 1 Pol(g) = 1 Pol(h) = 0 Pol(koat_start) = 1 orients all transitions weakly and the transition g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_0 ] strictly and produces the following problem: 3: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1) -> Com_1(g(Ar_0, Ar_1)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(Ar_0 - 1, 2*Ar_1)) [ Ar_0 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_0 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(f(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 A polynomial rank function with Pol(f) = V_1 Pol(g) = V_1 Pol(h) = V_1 Pol(koat_start) = V_1 orients all transitions weakly and the transition g(Ar_0, Ar_1) -> Com_1(g(Ar_0 - 1, 2*Ar_1)) [ Ar_0 >= 1 ] strictly and produces the following problem: 4: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1) -> Com_1(g(Ar_0, Ar_1)) (Comp: Ar_0, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(Ar_0 - 1, 2*Ar_1)) [ Ar_0 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_0 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(f(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 A polynomial rank function with Pol(h) = V_2 and size complexities S("koat_start(Ar_0, Ar_1) -> Com_1(f(Ar_0, Ar_1)) [ 0 <= 0 ]", 0-0) = Ar_0 S("koat_start(Ar_0, Ar_1) -> Com_1(f(Ar_0, Ar_1)) [ 0 <= 0 ]", 0-1) = Ar_1 S("h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ]", 0-0) = Ar_0 S("h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ]", 0-1) = pow(2, Ar_0) * Ar_1 + Ar_1 S("g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_0 ]", 0-0) = Ar_0 S("g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_0 ]", 0-1) = pow(2, Ar_0) * Ar_1 + Ar_1 S("g(Ar_0, Ar_1) -> Com_1(g(Ar_0 - 1, 2*Ar_1)) [ Ar_0 >= 1 ]", 0-0) = Ar_0 S("g(Ar_0, Ar_1) -> Com_1(g(Ar_0 - 1, 2*Ar_1)) [ Ar_0 >= 1 ]", 0-1) = pow(2, Ar_0) * Ar_1 S("f(Ar_0, Ar_1) -> Com_1(g(Ar_0, Ar_1))", 0-0) = Ar_0 S("f(Ar_0, Ar_1) -> Com_1(g(Ar_0, Ar_1))", 0-1) = Ar_1 orients the transitions h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] weakly and the transition h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] strictly and produces the following problem: 5: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1) -> Com_1(g(Ar_0, Ar_1)) (Comp: Ar_0, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(Ar_0 - 1, 2*Ar_1)) [ Ar_0 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_0 ] (Comp: pow(2, Ar_0) * Ar_1 + Ar_1, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(f(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 Complexity upper bound pow(2, Ar_0) * Ar_1 + Ar_0 + Ar_1 + 2 Time: 0.082 sec (SMT: 0.070 sec) ---------------------------------------- (2) BOUNDS(1, EXP) ---------------------------------------- (3) Loat Proof (FINISHED) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: f 0: f -> g : [], cost: 1 1: g -> g : A'=-1+A, B'=2*B, [ A>=1 ], cost: 1 2: g -> h : [ 0>=A ], cost: 1 3: h -> h : B'=-1+B, [ B>=1 ], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 0: f -> g : [], cost: 1 ### Simplification by acceleration and chaining ### Accelerating simple loops of location 1. Accelerating the following rules: 1: g -> g : A'=-1+A, B'=2*B, [ A>=1 ], cost: 1 Accelerated rule 1 with metering function A, yielding the new rule 4. Removing the simple loops: 1. Accelerating simple loops of location 2. Accelerating the following rules: 3: h -> h : B'=-1+B, [ B>=1 ], cost: 1 Accelerated rule 3 with metering function B, yielding the new rule 5. Removing the simple loops: 3. Accelerated all simple loops using metering functions (where possible): Start location: f 0: f -> g : [], cost: 1 2: g -> h : [ 0>=A ], cost: 1 4: g -> g : A'=0, B'=2^A*B, [ A>=1 ], cost: A 5: h -> h : B'=0, [ B>=1 ], cost: B Chained accelerated rules (with incoming rules): Start location: f 0: f -> g : [], cost: 1 6: f -> g : A'=0, B'=2^A*B, [ A>=1 ], cost: 1+A 2: g -> h : [ 0>=A ], cost: 1 7: g -> h : B'=0, [ 0>=A && B>=1 ], cost: 1+B Removed unreachable locations (and leaf rules with constant cost): Start location: f 0: f -> g : [], cost: 1 6: f -> g : A'=0, B'=2^A*B, [ A>=1 ], cost: 1+A 7: g -> h : B'=0, [ 0>=A && B>=1 ], cost: 1+B Eliminated locations (on tree-shaped paths): Start location: f 8: f -> h : B'=0, [ 0>=A && B>=1 ], cost: 2+B 9: f -> h : A'=0, B'=0, [ A>=1 && 2^A*B>=1 ], cost: 2+2^A*B+A ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: f 8: f -> h : B'=0, [ 0>=A && B>=1 ], cost: 2+B 9: f -> h : A'=0, B'=0, [ A>=1 && 2^A*B>=1 ], cost: 2+2^A*B+A Computing asymptotic complexity for rule 8 Solved the limit problem by the following transformations: Created initial limit problem: 1-A (+/+!), B (+/+!), 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 2+n has complexity: Poly(n^1) Found new complexity Poly(n^1). Computing asymptotic complexity for rule 9 Solved the limit problem by the following transformations: Created initial limit problem: 2+2^A*B+A (+), 2^A*B (+/+!), A (+/+!) [not solved] applying transformation rule (C) using substitution {A==1} resulting limit problem: 1 (+/+!), 3+2*B (+), 2*B (+/+!) [not solved] applying transformation rule (B), deleting 1 (+/+!) resulting limit problem: 3+2*B (+), 2*B (+/+!) [not solved] applying transformation rule (D), replacing 3+2*B (+) by 2*B (+) resulting limit problem: 2*B (+) [not solved] applying transformation rule (A), replacing 2*B (+) by B (+) and 2 (+!) using + limit vector (+,+!) resulting limit problem: 2 (+!), B (+) [not solved] applying transformation rule (B), deleting 2 (+!) resulting limit problem: B (+) [solved] Solved the limit problem by the following transformations: Created initial limit problem: 2+2^A*B+A (+), 2^A*B (+/+!), A (+/+!) [not solved] applying transformation rule (A), replacing 2+2^A*B+A (+) by 2 (+!) and 2^A*B+A (+) using + limit vector (+!,+) resulting limit problem: 2^A*B+A (+), 2 (+!), 2^A*B (+/+!), A (+/+!) [not solved] applying transformation rule (B), deleting 2 (+!) resulting limit problem: 2^A*B+A (+), 2^A*B (+/+!), A (+/+!) [not solved] applying transformation rule (A), replacing 2^A*B+A (+) by A (+) and 2^A*B (+) using + limit vector (+,+) resulting limit problem: 2^A*B (+), A (+) [not solved] applying transformation rule (A), replacing 2^A*B (+) by 2^A (+) and B (+!) using + limit vector (+,+!) resulting limit problem: A (+), 2^A (+), B (+!) [not solved] applying transformation rule (E), replacing 2^A (+) by 1 (+/+!) and A (+) resulting limit problem: 1 (+/+!), A (+), B (+!) [not solved] applying transformation rule (B), deleting 1 (+/+!) resulting limit problem: A (+), B (+!) [solved] Solution: A / n B / 1 Resulting cost 2+2^n+n has complexity: Exp Found new complexity Exp. Obtained the following overall complexity (w.r.t. the length of the input n): Complexity: Exp Cpx degree: Exp Solved cost: 2+2^n+n Rule cost: 2+2^A*B+A Rule guard: [ A>=1 && 2^A*B>=1 ] WORST_CASE(EXP,?) ---------------------------------------- (4) BOUNDS(EXP, INF)