/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.koat /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(?, O(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(1, max(29 + -108 * Arg_0 + 27 * Arg_1, 2 + -54 * Arg_0 + 54 * Arg_1, 29, 29 + -108 * Arg_0 + 54 * Arg_1)). (0) CpxIntTrs (1) Koat2 Proof [FINISHED, 124 ms] (2) BOUNDS(1, max(29 + -108 * Arg_0 + 27 * Arg_1, 2 + -54 * Arg_0 + 54 * Arg_1, 29, 29 + -108 * Arg_0 + 54 * Arg_1)) (3) Loat Proof [FINISHED, 234 ms] (4) BOUNDS(1, INF) (5) Koat Proof [FINISHED, 317 ms] (6) BOUNDS(1, 1) ---------------------------------------- (0) Obligation: Complexity Int TRS consisting of the following rules: l0(A, B) -> Com_1(l1(A, B)) :|: TRUE l1(A, B) -> Com_1(l1(A + A, B + B + B)) :|: B + B + B + B >= A && A >= B && A >= 1 && B >= 1 The start-symbols are:[l0_2] ---------------------------------------- (1) Koat2 Proof (FINISHED) YES( ?, 2+27*max([1, max([1+Arg_1+-4*Arg_0, max([1+-4*Arg_0+2*Arg_1, -2*Arg_0+2*Arg_1])])]) {O(n)}) Initial Complexity Problem: Start: l0 Program_Vars: Arg_0, Arg_1 Temp_Vars: Locations: l0, l1 Transitions: 0: l0->l1 1: l1->l1 Timebounds: Overall timebound: 2+27*max([1, max([1+Arg_1+-4*Arg_0, max([1+-4*Arg_0+2*Arg_1, -2*Arg_0+2*Arg_1])])]) {O(n)} 0: l0->l1: 1 {O(1)} 1: l1->l1: 1+27*max([1, max([1+Arg_1+-4*Arg_0, max([1+-4*Arg_0+2*Arg_1, -2*Arg_0+2*Arg_1])])]) {O(n)} Costbounds: Overall costbound: 2+27*max([1, max([1+Arg_1+-4*Arg_0, max([1+-4*Arg_0+2*Arg_1, -2*Arg_0+2*Arg_1])])]) {O(n)} 0: l0->l1: 1 {O(1)} 1: l1->l1: 1+27*max([1, max([1+Arg_1+-4*Arg_0, max([1+-4*Arg_0+2*Arg_1, -2*Arg_0+2*Arg_1])])]) {O(n)} Sizebounds: `Lower: 0: l0->l1, Arg_0: Arg_0 {O(n)} 0: l0->l1, Arg_1: Arg_1 {O(n)} 1: l1->l1, Arg_0: 3 {O(1)} 1: l1->l1, Arg_1: 2 {O(1)} `Upper: 0: l0->l1, Arg_0: Arg_0 {O(n)} 0: l0->l1, Arg_1: Arg_1 {O(n)} 1: l1->l1, Arg_0: 3^(1+27*max([1, max([1+Arg_1+-4*Arg_0, max([1+-4*Arg_0+2*Arg_1, -2*Arg_0+2*Arg_1])])]))*max([0, Arg_0]) {O(EXP)} 1: l1->l1, Arg_1: 2^(1+27*max([1, max([1+Arg_1+-4*Arg_0, max([1+-4*Arg_0+2*Arg_1, -2*Arg_0+2*Arg_1])])]))*max([0, Arg_1]) {O(EXP)} ---------------------------------------- (2) BOUNDS(1, max(29 + -108 * Arg_0 + 27 * Arg_1, 2 + -54 * Arg_0 + 54 * Arg_1, 29, 29 + -108 * Arg_0 + 54 * Arg_1)) ---------------------------------------- (3) Loat Proof (FINISHED) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: l0 0: l0 -> l1 : [], cost: 1 1: l1 -> l1 : A'=3*A, B'=2*B, [ 4*A>=B && B>=A && B>=1 && A>=1 ], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 0: l0 -> l1 : [], cost: 1 ### Simplification by acceleration and chaining ### Accelerating simple loops of location 1. Accelerating the following rules: 1: l1 -> l1 : A'=3*A, B'=2*B, [ 4*A>=B && B>=A && B>=1 ], cost: 1 Found no metering function for rule 1. Removing the simple loops:. Accelerated all simple loops using metering functions (where possible): Start location: l0 0: l0 -> l1 : [], cost: 1 1: l1 -> l1 : A'=3*A, B'=2*B, [ 4*A>=B && B>=A && B>=1 ], cost: 1 Chained accelerated rules (with incoming rules): Start location: l0 0: l0 -> l1 : [], cost: 1 2: l0 -> l1 : A'=3*A, B'=2*B, [ 4*A>=B && B>=A && B>=1 ], cost: 2 Removed unreachable locations (and leaf rules with constant cost): Start location: l0 ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: l0 Obtained the following overall complexity (w.r.t. the length of the input n): Complexity: Constant Cpx degree: 0 Solved cost: 1 Rule cost: 1 Rule guard: [] WORST_CASE(Omega(1),?) ---------------------------------------- (4) BOUNDS(1, INF) ---------------------------------------- (5) Koat Proof (FINISHED) YES(?, 5) Initial complexity problem: 1: T: (Comp: ?, Cost: 1) l0(Ar_0, Ar_1) -> Com_1(l1(Ar_0, Ar_1)) (Comp: ?, Cost: 1) l1(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(l0(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) l0(Ar_0, Ar_1) -> Com_1(l1(Ar_0, Ar_1)) (Comp: ?, Cost: 1) l1(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(l0(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 By chaining the transition l0(Ar_0, Ar_1) -> Com_1(l1(Ar_0, Ar_1)) with all transitions in problem 2, the following new transition is obtained: l0(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 ] We thus obtain the following problem: 3: T: (Comp: 1, Cost: 2) l0(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 ] (Comp: ?, Cost: 1) l1(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(l0(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 By chaining the transition l0(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 ] with all transitions in problem 3, the following new transition is obtained: l0(Ar_0, Ar_1) -> Com_1(l1(9*Ar_0, 4*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 /\ 12*Ar_0 >= 2*Ar_1 /\ 2*Ar_1 >= 3*Ar_0 /\ 2*Ar_1 >= 1 /\ 3*Ar_0 >= 1 ] We thus obtain the following problem: 4: T: (Comp: 1, Cost: 3) l0(Ar_0, Ar_1) -> Com_1(l1(9*Ar_0, 4*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 /\ 12*Ar_0 >= 2*Ar_1 /\ 2*Ar_1 >= 3*Ar_0 /\ 2*Ar_1 >= 1 /\ 3*Ar_0 >= 1 ] (Comp: ?, Cost: 1) l1(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0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Ar_1 >= 1 /\ 9*Ar_0 >= 1 /\ 108*Ar_0 >= 8*Ar_1 /\ 8*Ar_1 >= 27*Ar_0 /\ 8*Ar_1 >= 1 /\ 27*Ar_0 >= 1 ] (Comp: ?, Cost: 1) l1(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(l0(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 Testing for reachability in the complexity graph removes the following transition from problem 6: l1(Ar_0, Ar_1) -> Com_1(l1(3*Ar_0, 2*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 ] We thus obtain the following problem: 7: T: (Comp: 1, Cost: 5) l0(Ar_0, Ar_1) -> Com_1(l1(81*Ar_0, 16*Ar_1)) [ 4*Ar_0 >= Ar_1 /\ Ar_1 >= Ar_0 /\ Ar_1 >= 1 /\ Ar_0 >= 1 /\ 12*Ar_0 >= 2*Ar_1 /\ 2*Ar_1 >= 3*Ar_0 /\ 2*Ar_1 >= 1 /\ 3*Ar_0 >= 1 /\ 36*Ar_0 >= 4*Ar_1 /\ 4*Ar_1 >= 9*Ar_0 /\ 4*Ar_1 >= 1 /\ 9*Ar_0 >= 1 /\ 108*Ar_0 >= 8*Ar_1 /\ 8*Ar_1 >= 27*Ar_0 /\ 8*Ar_1 >= 1 /\ 27*Ar_0 >= 1 ] (Comp: 1, Cost: 0) koat_start(Ar_0, Ar_1) -> Com_1(l0(Ar_0, Ar_1)) [ 0 <= 0 ] start location: koat_start leaf cost: 0 Complexity upper bound 5 Time: 0.372 sec (SMT: 0.346 sec) ---------------------------------------- (6) BOUNDS(1, 1)