Trying to load file: main.koat Initial Control flow graph problem: Start location: f1 1: f0 -> f0 : C'=-1+C, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 ], cost: 1 2: f0 -> f0 : A'=-1+A, C'=free_4, D'=free_5, E'=free_3, [ 0>=1+free_3 && A>=1 ], cost: 1 3: f0 -> f0 : A'=-1+A, C'=free_7, D'=free_8, E'=free_6, [ free_6>=1 && A>=1 ], cost: 1 0: f0 -> f2 : B'=free, [ 0>=A ], cost: 1 4: f1 -> f0 : [], cost: 1 Simplified the transitions: Start location: f1 1: f0 -> f0 : C'=-1+C, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 ], cost: 1 2: f0 -> f0 : A'=-1+A, C'=free_4, D'=free_5, E'=free_3, [ 0>=1+free_3 && A>=1 ], cost: 1 3: f0 -> f0 : A'=-1+A, C'=free_7, D'=free_8, E'=free_6, [ free_6>=1 && A>=1 ], cost: 1 4: f1 -> f0 : [], cost: 1 Eliminating 3 self-loops for location f0 Self-Loop 1 has the metering function: -2+C, resulting in the new transition 5. Self-Loop 2 has the metering function: A, resulting in the new transition 6. Self-Loop 3 has the metering function: A, resulting in the new transition 7. Found this metering function when nesting loops: -1+A, and nested parallel self-loops 2 (outer loop) and 5 (inner loop), obtaining the new transitions: 8, 9. Found this metering function when nesting loops: -1+A, and nested parallel self-loops 3 (outer loop) and 5 (inner loop), obtaining the new transitions: 10, 11. Removing the self-loops: 1 2 3. Removed all Self-loops using metering functions (where possible): Start location: f1 5: f0 -> [3] : C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 ], cost: -2+C 6: f0 -> [3] : A'=0, C'=free_4, D'=free_5, E'=free_3, [ 0>=1+free_3 && A>=1 ], cost: A 7: f0 -> [3] : A'=0, C'=free_7, D'=free_8, E'=free_6, [ free_6>=1 && A>=1 ], cost: A 8: f0 -> [3] : A'=1, C'=2, D'=free_2, E'=0, F'=free_1, [ 0>=1+free_3 && A>=1 && -1+A>=1 && free_4>=3 ], cost: 1+free_4*(-1+A)-A 9: f0 -> [3] : A'=1, C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 && 0>=1+free_3 && A>=1 && -1+A>=1 && free_4>=3 ], cost: -1+free_4*(-1+A)+C-A 10: f0 -> [3] : A'=1, C'=2, D'=free_2, E'=0, F'=free_1, [ free_6>=1 && A>=1 && -1+A>=1 && free_7>=3 ], cost: 1+free_7*(-1+A)-A 11: f0 -> [3] : A'=1, C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 && free_6>=1 && A>=1 && -1+A>=1 && free_7>=3 ], cost: -1+free_7*(-1+A)+C-A 4: f1 -> f0 : [], cost: 1 Applied chaining over branches and pruning: Start location: f1 12: f1 -> [3] : C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 ], cost: -1+C 13: f1 -> [3] : A'=0, C'=free_4, D'=free_5, E'=free_3, [ 0>=1+free_3 && A>=1 ], cost: 1+A 14: f1 -> [3] : A'=0, C'=free_7, D'=free_8, E'=free_6, [ free_6>=1 && A>=1 ], cost: 1+A 16: f1 -> [3] : A'=1, C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 && 0>=1+free_3 && A>=1 && -1+A>=1 && free_4>=3 ], cost: free_4*(-1+A)+C-A 18: f1 -> [3] : A'=1, C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 && free_6>=1 && A>=1 && -1+A>=1 && free_7>=3 ], cost: free_7*(-1+A)+C-A Final control flow graph problem, now checking costs for infinitely many models: Start location: f1 12: f1 -> [3] : C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 ], cost: -1+C 13: f1 -> [3] : A'=0, C'=free_4, D'=free_5, E'=free_3, [ 0>=1+free_3 && A>=1 ], cost: 1+A 14: f1 -> [3] : A'=0, C'=free_7, D'=free_8, E'=free_6, [ free_6>=1 && A>=1 ], cost: 1+A 16: f1 -> [3] : A'=1, C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 && 0>=1+free_3 && A>=1 && -1+A>=1 && free_4>=3 ], cost: free_4*(-1+A)+C-A 18: f1 -> [3] : A'=1, C'=2, D'=free_2, E'=0, F'=free_1, [ A>=1 && C>=3 && free_6>=1 && A>=1 && -1+A>=1 && free_7>=3 ], cost: free_7*(-1+A)+C-A Computing complexity for remaining 5 transitions. Found configuration with infinitely models for cost: -1+C and guard: A>=1 && C>=3: C: Pos, A: Pos Found new complexity n^1, because: Found infinity configuration. Found configuration with infinitely models for cost: free_4*(-1+A)+C-A and guard: A>=1 && C>=3 && 0>=1+free_3 && A>=1 && -1+A>=1 && free_4>=3: free_4: Const, C: Pos, free_3: Neg, A: Const Found configuration with infinitely models for cost: free_7*(-1+A)+C-A and guard: A>=1 && C>=3 && free_6>=1 && A>=1 && -1+A>=1 && free_7>=3: free_7: Const, C: Pos, free_6: Pos, A: Const The final runtime is determined by this resulting transition: Final Guard: A>=1 && C>=3 Final Cost: -1+C Obtained the following complexity w.r.t. the length of the input n: Complexity class: n^1 Complexity value: 1 WORST_CASE(Omega(n^1),?)