/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, 40 ms] (2) BOUNDS(1, EXP) (3) Loat Proof [FINISHED, 407 ms] (4) BOUNDS(EXP, INF) ---------------------------------------- (0) Obligation: Complexity Int TRS consisting of the following rules: f(A, B, C) -> Com_1(g(A, 1, 0)) :|: TRUE g(A, B, C) -> Com_1(g1(A - 1, B, B)) :|: A > 0 g1(A, B, C) -> Com_1(g(A, C + B, C)) :|: TRUE g(A, B, C) -> Com_1(h(A, B, C)) :|: A <= 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, Ar_2) + 2*Ar_2 + 2) Initial complexity problem: 1: T: (Comp: ?, Cost: 1) f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 0, Ar_2)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: ?, Cost: 1) g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2)) (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 - 1, Ar_1, Ar_2)) [ Ar_0 >= 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, 0, Ar_2)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: ?, Cost: 1) g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2)) (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 - 1, Ar_1, Ar_2)) [ Ar_0 >= 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(g1) = 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, 0, Ar_2)) (Comp: ?, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: ?, Cost: 1) g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2)) (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 - 1, Ar_1, Ar_2)) [ Ar_0 >= 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(g1) = 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(g1(Ar_0, Ar_0, 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, 0, Ar_2)) (Comp: Ar_2, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: ?, Cost: 1) g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2)) (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 - 1, Ar_1, Ar_2)) [ Ar_0 >= 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 4 produces the following problem: 5: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 0, Ar_2)) (Comp: Ar_2, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: Ar_2, Cost: 1) g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2)) (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 - 1, Ar_1, Ar_2)) [ Ar_0 >= 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_1 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 - 1, Ar_1, Ar_2)) [ Ar_0 >= 1 ]", 0-0) = pow(2, Ar_2) S("h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0 - 1, Ar_1, Ar_2)) [ Ar_0 >= 1 ]", 0-1) = pow(2, Ar_2) S("h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0 - 1, Ar_1, Ar_2)) [ Ar_0 >= 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, Ar_2) S("g(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0, Ar_1, Ar_2)) [ 0 >= Ar_2 ]", 0-1) = pow(2, Ar_2) 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("g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2))", 0-0) = pow(2, Ar_2) S("g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2))", 0-1) = pow(2, Ar_2) S("g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2))", 0-2) = Ar_2 S("g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ]", 0-0) = pow(2, Ar_2) S("g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ]", 0-1) = pow(2, Ar_2) S("g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ]", 0-2) = Ar_2 S("f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 0, Ar_2))", 0-0) = 1 S("f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 0, Ar_2))", 0-1) = 0 S("f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 0, Ar_2))", 0-2) = Ar_2 orients the transitions h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0 - 1, Ar_1, Ar_2)) [ Ar_0 >= 1 ] weakly and the transition h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0 - 1, Ar_1, Ar_2)) [ Ar_0 >= 1 ] strictly and produces the following problem: 6: T: (Comp: 1, Cost: 1) f(Ar_0, Ar_1, Ar_2) -> Com_1(g(1, 0, Ar_2)) (Comp: Ar_2, Cost: 1) g(Ar_0, Ar_1, Ar_2) -> Com_1(g1(Ar_0, Ar_0, Ar_2 - 1)) [ Ar_2 >= 1 ] (Comp: Ar_2, Cost: 1) g1(Ar_0, Ar_1, Ar_2) -> Com_1(g(Ar_1 + Ar_0, Ar_1, Ar_2)) (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, Ar_2), Cost: 1) h(Ar_0, Ar_1, Ar_2) -> Com_1(h(Ar_0 - 1, Ar_1, Ar_2)) [ Ar_0 >= 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, Ar_2) + 2*Ar_2 + 2 Time: 0.084 sec (SMT: 0.073 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'=0, [], cost: 1 1: g -> g1 : B'=A, C'=-1+C, [ C>=1 ], cost: 1 3: g -> h : [ 0>=C ], cost: 1 2: g1 -> g : A'=A+B, [], cost: 1 4: 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, B'=0, [], cost: 1 ### Simplification by acceleration and chaining ### Accelerating simple loops of location 3. Accelerating the following rules: 4: h -> h : A'=-1+A, [ A>=1 ], cost: 1 Accelerated rule 4 with metering function A, yielding the new rule 5. Removing the simple loops: 4. Accelerated all simple loops using metering functions (where possible): Start location: f 0: f -> g : A'=1, B'=0, [], cost: 1 1: g -> g1 : B'=A, C'=-1+C, [ C>=1 ], cost: 1 3: g -> h : [ 0>=C ], cost: 1 2: g1 -> g : A'=A+B, [], cost: 1 5: h -> h : A'=0, [ A>=1 ], cost: A Chained accelerated rules (with incoming rules): Start location: f 0: f -> g : A'=1, B'=0, [], cost: 1 1: g -> g1 : B'=A, C'=-1+C, [ C>=1 ], cost: 1 3: g -> h : [ 0>=C ], cost: 1 6: g -> h : A'=0, [ 0>=C && A>=1 ], cost: 1+A 2: g1 -> g : A'=A+B, [], cost: 1 Removed unreachable locations (and leaf rules with constant cost): Start location: f 0: f -> g : A'=1, B'=0, [], cost: 1 1: g -> g1 : B'=A, C'=-1+C, [ C>=1 ], cost: 1 6: g -> h : A'=0, [ 0>=C && A>=1 ], cost: 1+A 2: g1 -> g : A'=A+B, [], cost: 1 Eliminated locations (on linear paths): Start location: f 0: f -> g : A'=1, B'=0, [], cost: 1 6: g -> h : A'=0, [ 0>=C && A>=1 ], cost: 1+A 7: g -> g : A'=2*A, B'=A, C'=-1+C, [ C>=1 ], cost: 2 Accelerating simple loops of location 1. Accelerating the following rules: 7: g -> g : A'=2*A, B'=A, C'=-1+C, [ C>=1 ], cost: 2 Accelerated rule 7 with metering function C, yielding the new rule 8. Removing the simple loops: 7. Accelerated all simple loops using metering functions (where possible): Start location: f 0: f -> g : A'=1, B'=0, [], cost: 1 6: g -> h : A'=0, [ 0>=C && A>=1 ], cost: 1+A 8: g -> g : A'=A*2^C, B'=1/2*A*2^C, C'=0, [ C>=1 ], cost: 2*C Chained accelerated rules (with incoming rules): Start location: f 0: f -> g : A'=1, B'=0, [], cost: 1 9: f -> g : A'=2^C, B'=1/2*2^C, C'=0, [ C>=1 ], cost: 1+2*C 6: g -> h : A'=0, [ 0>=C && A>=1 ], cost: 1+A Eliminated locations (on tree-shaped paths): Start location: f 10: f -> h : A'=0, B'=0, [ 0>=C ], cost: 3 11: f -> h : A'=0, B'=1/2*2^C, C'=0, [ C>=1 && 2^C>=1 ], cost: 2+2*C+2^C Applied pruning (of leafs and parallel rules): Start location: f 11: f -> h : A'=0, B'=1/2*2^C, C'=0, [ C>=1 && 2^C>=1 ], cost: 2+2*C+2^C ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: f 11: f -> h : A'=0, B'=1/2*2^C, C'=0, [ C>=1 && 2^C>=1 ], cost: 2+2*C+2^C Computing asymptotic complexity for rule 11 Solved the limit problem by the following transformations: Created initial limit problem: C (+/+!), 2+2*C+2^C (+), 2^C (+/+!) [not solved] applying transformation rule (E), replacing 2+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+2*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+2*n Rule cost: 2+2*C+2^C Rule guard: [ C>=1 && 2^C>=1 ] WORST_CASE(EXP,?) ---------------------------------------- (4) BOUNDS(EXP, INF)