Trying to load file: main.koat Initial Control flow graph problem: Start location: f0 0: f0 -> f4 : A'=0, [], cost: 1 1: f4 -> f7 : C'=1+A, [ B>=1+A ], cost: 1 6: f4 -> f19 : [ A>=B ], cost: 1 5: f7 -> f4 : A'=1+A, [ C>=B ], cost: 1 2: f7 -> f7 : C'=1+C, D'=0, [ B>=1+C ], cost: 1 3: f7 -> f7 : B'=-1+B, D'=free, [ B>=1+C && 0>=1+free ], cost: 1 4: f7 -> f7 : B'=-1+B, D'=free_1, [ B>=1+C && free_1>=1 ], cost: 1 Simplified the transitions: Start location: f0 0: f0 -> f4 : A'=0, [], cost: 1 1: f4 -> f7 : C'=1+A, [ B>=1+A ], cost: 1 5: f7 -> f4 : A'=1+A, [ C>=B ], cost: 1 2: f7 -> f7 : C'=1+C, D'=0, [ B>=1+C ], cost: 1 3: f7 -> f7 : B'=-1+B, D'=free, [ B>=1+C && 0>=1+free ], cost: 1 4: f7 -> f7 : B'=-1+B, D'=free_1, [ B>=1+C && free_1>=1 ], cost: 1 Eliminating 3 self-loops for location f7 Self-Loop 2 has the metering function: B-C, resulting in the new transition 7. Self-Loop 3 has the metering function: B-C, resulting in the new transition 8. Self-Loop 4 has the metering function: B-C, resulting in the new transition 9. Removing the self-loops: 2 3 4. Removed all Self-loops using metering functions (where possible): Start location: f0 0: f0 -> f4 : A'=0, [], cost: 1 1: f4 -> f7 : C'=1+A, [ B>=1+A ], cost: 1 7: f7 -> [4] : C'=B, D'=0, [ B>=1+C ], cost: B-C 8: f7 -> [4] : B'=C, D'=free, [ B>=1+C && 0>=1+free ], cost: B-C 9: f7 -> [4] : B'=C, D'=free_1, [ B>=1+C && free_1>=1 ], cost: B-C 5: [4] -> f4 : A'=1+A, [ C>=B ], cost: 1 Applied chaining over branches and pruning: Start location: f0 0: f0 -> f4 : A'=0, [], cost: 1 10: f4 -> [4] : C'=B, D'=0, [ B>=1+A && B>=2+A ], cost: B-A 11: f4 -> [4] : B'=1+A, C'=1+A, D'=free, [ B>=1+A && B>=2+A && 0>=1+free ], cost: B-A 12: f4 -> [4] : B'=1+A, C'=1+A, D'=free_1, [ B>=1+A && B>=2+A && free_1>=1 ], cost: B-A 5: [4] -> f4 : A'=1+A, [ C>=B ], cost: 1 Applied chaining over branches and pruning: Start location: f0 0: f0 -> f4 : A'=0, [], cost: 1 13: f4 -> f4 : A'=1+A, C'=B, D'=0, [ B>=1+A && B>=2+A && B>=B ], cost: 1+B-A 14: f4 -> f4 : A'=1+A, B'=1+A, C'=1+A, D'=free, [ B>=1+A && B>=2+A && 0>=1+free && 1+A>=1+A ], cost: 1+B-A 15: f4 -> f4 : A'=1+A, B'=1+A, C'=1+A, D'=free_1, [ B>=1+A && B>=2+A && free_1>=1 && 1+A>=1+A ], cost: 1+B-A Eliminating 3 self-loops for location f4 Self-Loop 13 has the metering function: -1+B-A, resulting in the new transition 16. Removing the self-loops: 13 14 15. Adding an epsilon transition (to model nonexecution of the loops): 19. Removed all Self-loops using metering functions (where possible): Start location: f0 0: f0 -> f4 : A'=0, [], cost: 1 16: f4 -> [5] : A'=-1+B, C'=B, D'=0, [ B>=2+A ], cost: -3/2+3/2*B+B*(-1+B-A)-1/2*(-1+B-A)^2-3/2*A-(-1+B-A)*A 17: f4 -> [5] : A'=1+A, B'=1+A, C'=1+A, D'=free, [ B>=2+A && 0>=1+free ], cost: 1+B-A 18: f4 -> [5] : A'=1+A, B'=1+A, C'=1+A, D'=free_1, [ B>=2+A && free_1>=1 ], cost: 1+B-A 19: f4 -> [5] : [], cost: 0 Applied chaining over branches and pruning: Start location: f0 20: f0 -> [5] : A'=-1+B, C'=B, D'=0, [ B>=2 ], cost: -1/2-1/2*(-1+B)^2+3/2*B+B*(-1+B) 21: f0 -> [5] : A'=1, B'=1, C'=1, D'=free, [ B>=2 && 0>=1+free ], cost: 2+B 22: f0 -> [5] : A'=1, B'=1, C'=1, D'=free_1, [ B>=2 && free_1>=1 ], cost: 2+B Final control flow graph problem, now checking costs for infinitely many models: Start location: f0 20: f0 -> [5] : A'=-1+B, C'=B, D'=0, [ B>=2 ], cost: -1/2-1/2*(-1+B)^2+3/2*B+B*(-1+B) 21: f0 -> [5] : A'=1, B'=1, C'=1, D'=free, [ B>=2 && 0>=1+free ], cost: 2+B 22: f0 -> [5] : A'=1, B'=1, C'=1, D'=free_1, [ B>=2 && free_1>=1 ], cost: 2+B Computing complexity for remaining 3 transitions. Found configuration with infinitely models for cost: -1/2-1/2*(-1+B)^2+3/2*B+B*(-1+B) and guard: B>=2: B: Pos Found new complexity n^2, because: Found infinity configuration. The final runtime is determined by this resulting transition: Final Guard: B>=2 Final Cost: -1/2-1/2*(-1+B)^2+3/2*B+B*(-1+B) Obtained the following complexity w.r.t. the length of the input n: Complexity class: n^2 Complexity value: 2 WORST_CASE(Omega(n^2),?)