/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, 29 ms] (2) BOUNDS(1, EXP) (3) Loat Proof [FINISHED, 344 ms] (4) BOUNDS(EXP, INF) ---------------------------------------- (0) Obligation: Complexity Int TRS consisting of the following rules: f(A, B) -> Com_1(g(A, 1)) :|: TRUE g(A, B) -> Com_1(g(A - 1, B + B)) :|: A > 0 g(A, B) -> Com_1(h(A, B)) :|: A <= 0 h(A, B) -> Com_1(h(A, B - 1)) :|: B > 0 The start-symbols are:[f_2] ---------------------------------------- (1) Koat Proof (FINISHED) YES(?, pow(2, Ar_1) + Ar_1 + 2) Initial complexity problem: 1: T: (Comp: ?, Cost: 1) f(Ar_0, Ar_1) -> Com_1(g(1, Ar_1)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(2*Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_1 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0 - 1, Ar_1)) [ Ar_0 >= 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(1, Ar_1)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(2*Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_1 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0 - 1, Ar_1)) [ Ar_0 >= 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_1 ] strictly and produces the following problem: 3: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1) -> Com_1(g(1, Ar_1)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(2*Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_1 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0 - 1, Ar_1)) [ Ar_0 >= 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_2 Pol(g) = V_2 Pol(h) = V_2 Pol(koat_start) = V_2 orients all transitions weakly and the transition g(Ar_0, Ar_1) -> Com_1(g(2*Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] strictly and produces the following problem: 4: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1) -> Com_1(g(1, Ar_1)) (Comp: Ar_1, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(2*Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_1 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0 - 1, Ar_1)) [ Ar_0 >= 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_1 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 - 1, Ar_1)) [ Ar_0 >= 1 ]", 0-0) = pow(2, Ar_1) S("h(Ar_0, Ar_1) -> Com_1(h(Ar_0 - 1, Ar_1)) [ Ar_0 >= 1 ]", 0-1) = Ar_1 S("g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_1 ]", 0-0) = pow(2, Ar_1) S("g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_1 ]", 0-1) = Ar_1 S("g(Ar_0, Ar_1) -> Com_1(g(2*Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ]", 0-0) = pow(2, Ar_1) S("g(Ar_0, Ar_1) -> Com_1(g(2*Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ]", 0-1) = Ar_1 S("f(Ar_0, Ar_1) -> Com_1(g(1, Ar_1))", 0-0) = 1 S("f(Ar_0, Ar_1) -> Com_1(g(1, Ar_1))", 0-1) = Ar_1 orients the transitions h(Ar_0, Ar_1) -> Com_1(h(Ar_0 - 1, Ar_1)) [ Ar_0 >= 1 ] weakly and the transition h(Ar_0, Ar_1) -> Com_1(h(Ar_0 - 1, Ar_1)) [ Ar_0 >= 1 ] strictly and produces the following problem: 5: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1) -> Com_1(g(1, Ar_1)) (Comp: Ar_1, Cost: 1) g(Ar_0, Ar_1) -> Com_1(g(2*Ar_0, Ar_1 - 1)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1) -> Com_1(h(Ar_0, Ar_1)) [ 0 >= Ar_1 ] (Comp: pow(2, Ar_1), Cost: 1) h(Ar_0, Ar_1) -> Com_1(h(Ar_0 - 1, Ar_1)) [ Ar_0 >= 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_1) + Ar_1 + 2 Time: 0.075 sec (SMT: 0.065 sec) ---------------------------------------- (2) BOUNDS(1, EXP) ---------------------------------------- (3) Loat Proof (FINISHED) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: f 0: f -> g : A'=1, [], cost: 1 1: g -> g : A'=2*A, B'=-1+B, [ B>=1 ], cost: 1 2: g -> h : [ 0>=B ], cost: 1 3: h -> h : A'=-1+A, [ A>=1 ], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 0: f -> g : A'=1, [], cost: 1 ### Simplification by acceleration and chaining ### Accelerating simple loops of location 1. Accelerating the following rules: 1: g -> g : A'=2*A, B'=-1+B, [ B>=1 ], cost: 1 Accelerated rule 1 with metering function B, yielding the new rule 4. Removing the simple loops: 1. Accelerating simple loops of location 2. Accelerating the following rules: 3: h -> h : A'=-1+A, [ A>=1 ], cost: 1 Accelerated rule 3 with metering function A, 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 : A'=1, [], cost: 1 2: g -> h : [ 0>=B ], cost: 1 4: g -> g : A'=2^B*A, B'=0, [ B>=1 ], cost: B 5: h -> h : A'=0, [ A>=1 ], cost: A Chained accelerated rules (with incoming rules): Start location: f 0: f -> g : A'=1, [], cost: 1 6: f -> g : A'=2^B, B'=0, [ B>=1 ], cost: 1+B 2: g -> h : [ 0>=B ], cost: 1 7: g -> h : A'=0, [ 0>=B && A>=1 ], cost: 1+A Removed unreachable locations (and leaf rules with constant cost): Start location: f 0: f -> g : A'=1, [], cost: 1 6: f -> g : A'=2^B, B'=0, [ B>=1 ], cost: 1+B 7: g -> h : A'=0, [ 0>=B && A>=1 ], cost: 1+A Eliminated locations (on tree-shaped paths): Start location: f 8: f -> h : A'=0, [ 0>=B ], cost: 3 9: f -> h : A'=0, B'=0, [ B>=1 && 2^B>=1 ], cost: 2+2^B+B Applied pruning (of leafs and parallel rules): Start location: f 9: f -> h : A'=0, B'=0, [ B>=1 && 2^B>=1 ], cost: 2+2^B+B ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: f 9: f -> h : A'=0, B'=0, [ B>=1 && 2^B>=1 ], cost: 2+2^B+B Computing asymptotic complexity for rule 9 Solved the limit problem by the following transformations: Created initial limit problem: 2^B (+/+!), 2+2^B+B (+), B (+/+!) [not solved] applying transformation rule (E), replacing 2^B (+/+!) by 1 (+/+!) and B (+) resulting limit problem: 1 (+/+!), 2+2^B+B (+), B (+) [not solved] applying transformation rule (B), deleting 1 (+/+!) resulting limit problem: 2+2^B+B (+), B (+) [not solved] applying transformation rule (E), replacing 2+2^B+B (+) by 1 (+/+!) and B (+) resulting limit problem: 1 (+/+!), B (+) [not solved] applying transformation rule (B), deleting 1 (+/+!) resulting limit problem: B (+) [solved] Solution: B / n 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^B+B Rule guard: [ B>=1 && 2^B>=1 ] WORST_CASE(EXP,?) ---------------------------------------- (4) BOUNDS(EXP, INF)