WORST_CASE(Omega(1),?) ### Pre-processing the ITS problem ### Initial linear ITS problem Start location: __init 0: f1_0_main_ConstantStackPush -> f108_0_add_GT : arg1'=arg1P_1, arg2'=arg2P_1, arg3'=arg3P_1, [ 0==arg1P_1 && 0==arg2P_1 && 0==arg3P_1 ], cost: 1 1: f108_0_add_GT -> f108_0_add_GT : arg1'=arg1P_2, arg2'=arg2P_2, arg3'=arg3P_2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 && arg1+arg2==arg1P_2 && 1+arg2==arg2P_2 && 1+arg2==arg3P_2 ], cost: 1 2: f108_0_add_GT -> f208_0_add_GT : arg1'=arg1P_3, arg2'=arg2P_3, arg3'=arg3P_3, [ arg2>1000 && arg2==arg3 && 0==arg1P_3 && 0==arg2P_3 && 0==arg3P_3 ], cost: 1 3: f208_0_add_GT -> f208_0_add_GT : arg1'=arg1P_4, arg2'=arg2P_4, arg3'=arg3P_4, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 && arg1+arg2==arg1P_4 && 2+arg2==arg2P_4 && 2+arg2==arg3P_4 ], cost: 1 4: f208_0_add_GT -> f311_0_add_GT : arg1'=arg1P_5, arg2'=arg2P_5, arg3'=arg3P_5, [ arg2>1000 && arg2==arg3 && 0==arg1P_5 && 0==arg2P_5 && 0==arg3P_5 ], cost: 1 5: f311_0_add_GT -> f311_0_add_GT : arg1'=arg1P_6, arg2'=arg2P_6, arg3'=arg3P_6, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 && arg1+arg2==arg1P_6 && 3+arg2==arg2P_6 && 3+arg2==arg3P_6 ], cost: 1 6: __init -> f1_0_main_ConstantStackPush : arg1'=arg1P_7, arg2'=arg2P_7, arg3'=arg3P_7, [], cost: 1 Checking for constant complexity: The following rule is satisfiable with cost >= 1, yielding constant complexity: 6: __init -> f1_0_main_ConstantStackPush : arg1'=arg1P_7, arg2'=arg2P_7, arg3'=arg3P_7, [], cost: 1 Simplified all rules, resulting in: Start location: __init 0: f1_0_main_ConstantStackPush -> f108_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [], cost: 1 1: f108_0_add_GT -> f108_0_add_GT : arg1'=arg1+arg2, arg2'=1+arg2, arg3'=1+arg2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 ], cost: 1 2: f108_0_add_GT -> f208_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [ arg2>1000 && arg2==arg3 ], cost: 1 3: f208_0_add_GT -> f208_0_add_GT : arg1'=arg1+arg2, arg2'=2+arg2, arg3'=2+arg2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 ], cost: 1 4: f208_0_add_GT -> f311_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [ arg2>1000 && arg2==arg3 ], cost: 1 5: f311_0_add_GT -> f311_0_add_GT : arg1'=arg1+arg2, arg2'=3+arg2, arg3'=3+arg2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 ], cost: 1 6: __init -> f1_0_main_ConstantStackPush : arg1'=arg1P_7, arg2'=arg2P_7, arg3'=arg3P_7, [], cost: 1 ### Simplification by acceleration and chaining ### Accelerating simple loops of location 1. Accelerating the following rules: 1: f108_0_add_GT -> f108_0_add_GT : arg1'=arg1+arg2, arg2'=1+arg2, arg3'=1+arg2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 ], cost: 1 Accelerated rule 1 with metering function 1001-arg2, yielding the new rule 7. Removing the simple loops: 1. Accelerating simple loops of location 2. Accelerating the following rules: 3: f208_0_add_GT -> f208_0_add_GT : arg1'=arg1+arg2, arg2'=2+arg2, arg3'=2+arg2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 ], cost: 1 Accelerated rule 3 with metering function meter (where 2*meter==1000-arg2), yielding the new rule 8. Removing the simple loops: 3. Accelerating simple loops of location 3. Accelerating the following rules: 5: f311_0_add_GT -> f311_0_add_GT : arg1'=arg1+arg2, arg2'=3+arg2, arg3'=3+arg2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 ], cost: 1 Accelerated rule 5 with metering function meter_1 (where 3*meter_1==1000-arg2), yielding the new rule 9. Removing the simple loops: 5. Accelerated all simple loops using metering functions (where possible): Start location: __init 0: f1_0_main_ConstantStackPush -> f108_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [], cost: 1 2: f108_0_add_GT -> f208_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [ arg2>1000 && arg2==arg3 ], cost: 1 7: f108_0_add_GT -> f108_0_add_GT : arg1'=-1001/2+1/2*(-1001+arg2)^2-arg2*(-1001+arg2)+arg1+1/2*arg2, arg2'=1001, arg3'=1001, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 ], cost: 1001-arg2 4: f208_0_add_GT -> f311_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [ arg2>1000 && arg2==arg3 ], cost: 1 8: f208_0_add_GT -> f208_0_add_GT : arg1'=-meter+arg1+meter^2+meter*arg2, arg2'=2*meter+arg2, arg3'=2*meter+arg2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 && 2*meter==1000-arg2 && meter>=1 ], cost: meter 9: f311_0_add_GT -> f311_0_add_GT : arg1'=-3/2*meter_1+meter_1*arg2+arg1+3/2*meter_1^2, arg2'=3*meter_1+arg2, arg3'=3*meter_1+arg2, [ arg2>-1 && arg1>-1 && arg2<1001 && arg2==arg3 && 3*meter_1==1000-arg2 && meter_1>=1 ], cost: meter_1 6: __init -> f1_0_main_ConstantStackPush : arg1'=arg1P_7, arg2'=arg2P_7, arg3'=arg3P_7, [], cost: 1 Chained accelerated rules (with incoming rules): Start location: __init 0: f1_0_main_ConstantStackPush -> f108_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [], cost: 1 10: f1_0_main_ConstantStackPush -> f108_0_add_GT : arg1'=500500, arg2'=1001, arg3'=1001, [], cost: 1002 2: f108_0_add_GT -> f208_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [ arg2>1000 && arg2==arg3 ], cost: 1 11: f108_0_add_GT -> f208_0_add_GT : arg1'=249500, arg2'=1000, arg3'=1000, [ arg2>1000 && arg2==arg3 ], cost: 501 4: f208_0_add_GT -> f311_0_add_GT : arg1'=0, arg2'=0, arg3'=0, [ arg2>1000 && arg2==arg3 ], cost: 1 6: __init -> f1_0_main_ConstantStackPush : arg1'=arg1P_7, arg2'=arg2P_7, arg3'=arg3P_7, [], cost: 1 Removed unreachable locations (and leaf rules with constant cost): Start location: __init ### Computing asymptotic complexity ### Fully simplified ITS problem Start location: __init 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),?)