Trying to load file: main.koat Initial Control flow graph problem: Start location: f0 0: f0 -> f2 : [ A>=1 && B>=1 ], cost: 1 1: f0 -> f2 : [ A>=1 && 0>=1+B ], cost: 1 2: f0 -> f2 : [ 0>=1+A && B>=1 ], cost: 1 3: f0 -> f2 : [ 0>=1+A && 0>=1+B ], cost: 1 4: f2 -> f2 : B'=-1+B, [ A>=B && B>=2 && A>=1 && B+A>=2 ], cost: 1 5: f2 -> f2 : B'=-1+B, [ A>=B && B>=2 && 0>=1+A && B+A>=2 ], cost: 1 6: f2 -> f2 : B'=-1+B, [ A>=B && 0>=B && A>=1 && B+A>=2 ], cost: 1 7: f2 -> f2 : B'=-1+B, [ A>=B && 0>=B && 0>=1+A && B+A>=2 ], cost: 1 8: f2 -> f2 : A'=-1+A, [ 1>=B+A && A>=1+B && A>=2 && B>=1 ], cost: 1 9: f2 -> f2 : A'=-1+A, [ 1>=B+A && A>=1+B && A>=2 && 0>=1+B ], cost: 1 10: f2 -> f2 : A'=-1+A, [ 1>=B+A && A>=1+B && 0>=A && B>=1 ], cost: 1 11: f2 -> f2 : A'=-1+A, [ 1>=B+A && A>=1+B && 0>=A && 0>=1+B ], cost: 1 12: f2 -> f2 : B'=1+B, [ B>=A && B>=0 && A>=1 && 0>=1+B+A ], cost: 1 13: f2 -> f2 : B'=1+B, [ B>=A && B>=0 && 0>=1+A && 0>=1+B+A ], cost: 1 14: f2 -> f2 : B'=1+B, [ B>=A && 0>=2+B && A>=1 && 0>=1+B+A ], cost: 1 15: f2 -> f2 : B'=1+B, [ B>=A && 0>=2+B && 0>=1+A && 0>=1+B+A ], cost: 1 16: f2 -> f2 : A'=1+A, [ B+A>=0 && B>=1+A && A>=0 && B>=1 ], cost: 1 17: f2 -> f2 : A'=1+A, [ B+A>=0 && B>=1+A && A>=0 && 0>=1+B ], cost: 1 18: f2 -> f2 : A'=1+A, [ B+A>=0 && B>=1+A && 0>=2+A && B>=1 ], cost: 1 19: f2 -> f2 : A'=1+A, [ B+A>=0 && B>=1+A && 0>=2+A && 0>=1+B ], cost: 1 Eliminating 16 self-loops for location f2 Self-Loop 4 has the metering function: -1+B, resulting in the new transition 20. Self-Loop 5 has unbounded runtime, resulting in the new transition 21. Self-Loop 6 has the metering function: -1+B+A, resulting in the new transition 22. Self-Loop 7 has unbounded runtime, resulting in the new transition 23. Self-Loop 8 has unbounded runtime, resulting in the new transition 24. Self-Loop 9 has the metering function: -1+A, resulting in the new transition 25. Self-Loop 10 has unbounded runtime, resulting in the new transition 26. Self-Loop 11 has the metering function: -B+A, resulting in the new transition 27. Self-Loop 12 has unbounded runtime, resulting in the new transition 28. Self-Loop 13 has the metering function: -B-A, resulting in the new transition 29. Self-Loop 14 has unbounded runtime, resulting in the new transition 30. Self-Loop 15 has the metering function: -1-B, resulting in the new transition 31. Self-Loop 16 has the metering function: B-A, resulting in the new transition 32. Self-Loop 17 has unbounded runtime, resulting in the new transition 33. Self-Loop 18 has the metering function: -1-A, resulting in the new transition 34. Self-Loop 19 has unbounded runtime, resulting in the new transition 35. Removing the self-loops: 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19. Removed all Self-loops using metering functions (where possible): Start location: f0 0: f0 -> f2 : [ A>=1 && B>=1 ], cost: 1 1: f0 -> f2 : [ A>=1 && 0>=1+B ], cost: 1 2: f0 -> f2 : [ 0>=1+A && B>=1 ], cost: 1 3: f0 -> f2 : [ 0>=1+A && 0>=1+B ], cost: 1 20: f2 -> [2] : B'=1, [ A>=B && B>=2 && A>=1 && B+A>=2 ], cost: -1+B 21: f2 -> [2] : [ A>=B && B>=2 && 0>=1+A && B+A>=2 ], cost: INF 22: f2 -> [2] : B'=1-A, [ A>=B && 0>=B && A>=1 && B+A>=2 ], cost: -1+B+A 23: f2 -> [2] : [ A>=B && 0>=B && 0>=1+A && B+A>=2 ], cost: INF 24: f2 -> [2] : [ 1>=B+A && A>=1+B && A>=2 && B>=1 ], cost: INF 25: f2 -> [2] : A'=1, [ 1>=B+A && A>=1+B && A>=2 && 0>=1+B ], cost: -1+A 26: f2 -> [2] : [ 1>=B+A && A>=1+B && 0>=A && B>=1 ], cost: INF 27: f2 -> [2] : A'=B, [ 1>=B+A && A>=1+B && 0>=A && 0>=1+B ], cost: -B+A 28: f2 -> [2] : [ B>=A && B>=0 && A>=1 && 0>=1+B+A ], cost: INF 29: f2 -> [2] : B'=-A, [ B>=A && B>=0 && 0>=1+A && 0>=1+B+A ], cost: -B-A 30: f2 -> [2] : [ B>=A && 0>=2+B && A>=1 && 0>=1+B+A ], cost: INF 31: f2 -> [2] : B'=-1, [ B>=A && 0>=2+B && 0>=1+A && 0>=1+B+A ], cost: -1-B 32: f2 -> [2] : A'=B, [ B+A>=0 && B>=1+A && A>=0 && B>=1 ], cost: B-A 33: f2 -> [2] : [ B+A>=0 && B>=1+A && A>=0 && 0>=1+B ], cost: INF 34: f2 -> [2] : A'=-1, [ B+A>=0 && B>=1+A && 0>=2+A && B>=1 ], cost: -1-A 35: f2 -> [2] : [ B+A>=0 && B>=1+A && 0>=2+A && 0>=1+B ], cost: INF Applied chaining over branches and pruning: Start location: f0 36: f0 -> [2] : B'=1, [ A>=1 && B>=1 && A>=B && B>=2 && A>=1 && B+A>=2 ], cost: B 37: f0 -> [2] : A'=B, [ A>=1 && B>=1 && B+A>=0 && B>=1+A && A>=0 && B>=1 ], cost: 1+B-A 40: f0 -> [2] : B'=-A, [ 0>=1+A && B>=1 && B>=A && B>=0 && 0>=1+A && 0>=1+B+A ], cost: 1-B-A 42: f0 -> [2] : A'=B, [ 0>=1+A && 0>=1+B && 1>=B+A && A>=1+B && 0>=A && 0>=1+B ], cost: 1-B+A 43: f0 -> [2] : B'=-1, [ 0>=1+A && 0>=1+B && B>=A && 0>=2+B && 0>=1+A && 0>=1+B+A ], cost: -B Final control flow graph problem, now checking costs for infinitely many models: Start location: f0 36: f0 -> [2] : B'=1, [ A>=1 && B>=1 && A>=B && B>=2 && A>=1 && B+A>=2 ], cost: B 37: f0 -> [2] : A'=B, [ A>=1 && B>=1 && B+A>=0 && B>=1+A && A>=0 && B>=1 ], cost: 1+B-A 40: f0 -> [2] : B'=-A, [ 0>=1+A && B>=1 && B>=A && B>=0 && 0>=1+A && 0>=1+B+A ], cost: 1-B-A 42: f0 -> [2] : A'=B, [ 0>=1+A && 0>=1+B && 1>=B+A && A>=1+B && 0>=A && 0>=1+B ], cost: 1-B+A 43: f0 -> [2] : B'=-1, [ 0>=1+A && 0>=1+B && B>=A && 0>=2+B && 0>=1+A && 0>=1+B+A ], cost: -B Computing complexity for remaining 5 transitions. Found configuration with infinitely models for cost: B and guard: A>=1 && B>=1 && A>=B && B>=2 && A>=1 && B+A>=2: B: Pos, A: Pos, where: A > B Found new complexity n^1, because: Found infinity configuration. The final runtime is determined by this resulting transition: Final Guard: A>=1 && B>=1 && A>=B && B>=2 && A>=1 && B+A>=2 Final Cost: B 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),?)