/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.koat /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(NON_POLY, ?) 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(EXP, EXP). (0) CpxIntTrs (1) Koat Proof [FINISHED, 21 ms] (2) BOUNDS(1, EXP) (3) Loat Proof [FINISHED, 324 ms] (4) BOUNDS(EXP, INF) ---------------------------------------- (0) Obligation: Complexity Int TRS consisting of the following rules: f(A, B, C) -> Com_1(g(1, 1, C)) :|: TRUE g(A, B, C) -> Com_1(g(A + B, A + B, C - 1)) :|: C > 0 g(A, B, C) -> Com_1(h(A, B, C)) :|: C <= 0 h(A, B, C) -> Com_1(h(A, B - 1, C)) :|: B > 0 The start-symbols are:[f_3] ---------------------------------------- (1) Koat Proof (FINISHED) YES(?, pow(2, 2*Ar_2) + Ar_2 + 3) Initial complexity problem: 1: T: (Comp: ?, Cost: 1) f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 1, Ar_2)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: ?, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1, Ar_2) -> Com_1(f(Ar_0, Ar_1, Ar_2)) [ 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, Ar_2) -> Com_1(g(1, 1, Ar_2)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: ?, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1, Ar_2) -> Com_1(f(Ar_0, Ar_1, Ar_2)) [ 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, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ] strictly and produces the following problem: 3: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 1, Ar_2)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1, Ar_2) -> Com_1(f(Ar_0, Ar_1, Ar_2)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 A polynomial rank function with Pol(f) = V_3 Pol(g) = V_3 Pol(h) = V_3 Pol(koat_start) = V_3 orients all transitions weakly and the transition g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ] strictly and produces the following problem: 4: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 1, Ar_2)) (Comp: Ar_2, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ] (Comp: ?, Cost: 1) h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1, Ar_2) -> Com_1(f(Ar_0, Ar_1, Ar_2)) [ 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, Ar_2) -> Com_1(f(Ar_0, Ar_1, Ar_2)) [ 0 <= 0 ]", 0-0) = Ar_0 S("koat_start(Ar_0, Ar_1, Ar_2) -> Com_1(f(Ar_0, Ar_1, Ar_2)) [ 0 <= 0 ]", 0-1) = Ar_1 S("koat_start(Ar_0, Ar_1, Ar_2) -> Com_1(f(Ar_0, Ar_1, Ar_2)) [ 0 <= 0 ]", 0-2) = Ar_2 S("h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ]", 0-0) = pow(2, 2*Ar_2) + 1 S("h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ]", 0-1) = pow(2, 2*Ar_2) + 1 S("h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ]", 0-2) = Ar_2 S("g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ]", 0-0) = pow(2, 2*Ar_2) + 1 S("g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ]", 0-1) = pow(2, 2*Ar_2) + 1 S("g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ]", 0-2) = Ar_2 S("g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ]", 0-0) = pow(2, 2*Ar_2) S("g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ]", 0-1) = pow(2, 2*Ar_2) S("g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ]", 0-2) = Ar_2 S("f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 1, Ar_2))", 0-0) = 1 S("f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 1, Ar_2))", 0-1) = 1 S("f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 1, Ar_2))", 0-2) = Ar_2 orients the transitions h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ] weakly and the transition h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ] strictly and produces the following problem: 5: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 1, Ar_2)) (Comp: Ar_2, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_0 + Ar_1, Ar_0 + Ar_1, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: 1, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ] (Comp: pow(2, 2*Ar_2) + 1, Cost: 1) h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1 - 1, Ar_2)) [ Ar_1 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1, Ar_2) -> Com_1(f(Ar_0, Ar_1, Ar_2)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 Complexity upper bound pow(2, 2*Ar_2) + Ar_2 + 3 Time: 0.119 sec (SMT: 0.113 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, B'=1, [], cost: 1 1: g -> g : A'=A+B, B'=A+B, C'=-1+C, [ C>=1 ], cost: 1 2: g -> h : [ 0>=C ], 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 : A'=1, B'=1, [], cost: 1 ### Simplification by acceleration and chaining ### Accelerating simple loops of location 1. Accelerating the following rules: 1: g -> g : A'=A+B, B'=A+B, C'=-1+C, [ C>=1 ], cost: 1 Accelerated rule 1 with metering function C, 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 : A'=1, B'=1, [], cost: 1 2: g -> h : [ 0>=C ], cost: 1 4: g -> g : A'=A*2^C, B'=A*2^C, C'=0, [ C>=1 && B==A ], cost: C 5: h -> h : B'=0, [ B>=1 ], cost: B Chained accelerated rules (with incoming rules): Start location: f 0: f -> g : A'=1, B'=1, [], cost: 1 6: f -> g : A'=2^C, B'=2^C, C'=0, [ C>=1 ], cost: 1+C 2: g -> h : [ 0>=C ], cost: 1 7: g -> h : B'=0, [ 0>=C && B>=1 ], cost: 1+B Removed unreachable locations (and leaf rules with constant cost): Start location: f 0: f -> g : A'=1, B'=1, [], cost: 1 6: f -> g : A'=2^C, B'=2^C, C'=0, [ C>=1 ], cost: 1+C 7: g -> h : B'=0, [ 0>=C && B>=1 ], cost: 1+B Eliminated locations (on tree-shaped paths): Start location: f 8: f -> h : A'=1, B'=0, [ 0>=C ], cost: 3 9: f -> h : A'=2^C, B'=0, C'=0, [ C>=1 && 2^C>=1 ], cost: 2+C+2^C Applied pruning (of leafs and parallel rules): Start location: f 9: f -> h : A'=2^C, B'=0, C'=0, [ C>=1 && 2^C>=1 ], cost: 2+C+2^C ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: f 9: f -> h : A'=2^C, B'=0, C'=0, [ C>=1 && 2^C>=1 ], cost: 2+C+2^C Computing asymptotic complexity for rule 9 Solved the limit problem by the following transformations: Created initial limit problem: C (+/+!), 2+C+2^C (+), 2^C (+/+!) [not solved] applying transformation rule (E), replacing 2+C+2^C (+) by 1 (+/+!) and C (+) resulting limit problem: 1 (+/+!), C (+), 2^C (+/+!) [not solved] applying transformation rule (B), deleting 1 (+/+!) resulting limit problem: C (+), 2^C (+/+!) [not solved] applying transformation rule (E), replacing 2^C (+/+!) by 1 (+/+!) and C (+) resulting limit problem: 1 (+/+!), C (+) [not solved] applying transformation rule (B), deleting 1 (+/+!) resulting limit problem: C (+) [solved] Solution: C / 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+C+2^C Rule guard: [ C>=1 && 2^C>=1 ] WORST_CASE(EXP,?) ---------------------------------------- (4) BOUNDS(EXP, INF)