Trying to load file: main.koat Initial Control flow graph problem: Start location: f0 0: f0 -> f1 : C'=2, [ A>=0 && 3>=A && 3>=B && B>=0 ], cost: 1 1: f1 -> f1 : B'=1+B, D'=1+B, [ C+A>=1+2*B && 0>=2 ], cost: 1 2: f1 -> f1 : B'=1+B, D'=1+B, [ C+A>=1+2*B ], cost: 1 3: f1 -> f1 : B'=-1+B, D'=-1+B, [ 2*B>=2+C+A ], cost: 1 4: f1 -> f1 : B'=-1+B, D'=-1+B, [ 2*B>=2+C+A && 0>=2 ], cost: 1 5: f1 -> f1 : D'=B, [ 0>=1 && 2*B>=C+A && 1+C+A>=2*B ], cost: 1 6: f1 -> f1 : D'=B, [ 0>=1 && 2*B>=C+A && 1+C+A>=2*B ], cost: 1 Removing duplicate transition: 5. Simplified the transitions: Start location: f0 0: f0 -> f1 : C'=2, [ A>=0 && 3>=A && 3>=B && B>=0 ], cost: 1 1: f1 -> f1 : B'=1+B, D'=1+B, [ 0>=2 ], cost: 1 2: f1 -> f1 : B'=1+B, D'=1+B, [ C+A>=1+2*B ], cost: 1 3: f1 -> f1 : B'=-1+B, D'=-1+B, [ 2*B>=2+C+A ], cost: 1 4: f1 -> f1 : B'=-1+B, D'=-1+B, [ 0>=2 ], cost: 1 6: f1 -> f1 : D'=B, [ 0>=1 ], cost: 1 Eliminating 5 self-loops for location f1 Self-Loop 1 has unbounded runtime, resulting in the new transition 7. Self-Loop 2 has the metering function: meter, resulting in the new transition 8. Self-Loop 3 has the metering function: meter_1, resulting in the new transition 9. Self-Loop 4 has unbounded runtime, resulting in the new transition 10. Self-Loop 6 has unbounded runtime, resulting in the new transition 11. Removing the self-loops: 1 2 3 4 6. Removing duplicate transition: 7. Removed all Self-loops using metering functions (where possible): Start location: f0 0: f0 -> f1 : C'=2, [ A>=0 && 3>=A && 3>=B && B>=0 ], cost: 1 8: f1 -> [2] : B'=meter+B, D'=meter+B, [ C+A>=1+2*B && 2*meter==-2*B+C+A ], cost: meter 9: f1 -> [2] : B'=-meter_1+B, D'=-meter_1+B, [ 2*B>=2+C+A && 2*meter_1==-1+2*B-C-A ], cost: meter_1 10: f1 -> [2] : [ 0>=2 ], cost: INF 11: f1 -> [2] : [ 0>=1 ], cost: INF Applied chaining over branches and pruning: Start location: f0 12: f0 -> [2] : B'=meter+B, C'=2, D'=meter+B, [ A>=0 && 3>=A && 3>=B && B>=0 && 2+A>=1+2*B && 2*meter==2-2*B+A ], cost: 1+meter 13: f0 -> [2] : B'=-meter_1+B, C'=2, D'=-meter_1+B, [ A>=0 && 3>=A && 3>=B && B>=0 && 2*B>=4+A && 2*meter_1==-3+2*B-A ], cost: 1+meter_1 Final control flow graph problem, now checking costs for infinitely many models: Start location: f0 12: f0 -> [2] : B'=meter+B, C'=2, D'=meter+B, [ A>=0 && 3>=A && 3>=B && B>=0 && 2+A>=1+2*B && 2*meter==2-2*B+A ], cost: 1+meter 13: f0 -> [2] : B'=-meter_1+B, C'=2, D'=-meter_1+B, [ A>=0 && 3>=A && 3>=B && B>=0 && 2*B>=4+A && 2*meter_1==-3+2*B-A ], cost: 1+meter_1 Computing complexity for remaining 2 transitions. Found configuration with infinitely models for cost: 1+meter and guard: A>=0 && 3>=A && 3>=B && B>=0 && 2+A>=1+2*B && 2*meter==2-2*B+A: meter: Const, B: Const, A: Both Found new complexity const, because: Found infinity configuration. Found configuration with infinitely models for cost: 1+meter_1 and guard: A>=0 && 3>=A && 3>=B && B>=0 && 2*B>=4+A && 2*meter_1==-3+2*B-A: meter_1: Const, B: Const, A: Both The final runtime is determined by this resulting transition: Final Guard: A>=0 && 3>=A && 3>=B && B>=0 && 2+A>=1+2*B && 2*meter==2-2*B+A Final Cost: 2 Obtained the following complexity w.r.t. the length of the input n: Complexity class: const Complexity value: 0 WORST_CASE(Omega(1),?)