Trying to load file: main.koat Initial Control flow graph problem: Start location: evalfstart 0: evalfstart -> evalfentryin : [], cost: 1 1: evalfentryin -> evalfbb3in : C'=0, D'=0, [ A>=1 && B>=1+A ], cost: 1 2: evalfbb3in -> evalfreturnin : [ D>=B ], cost: 1 3: evalfbb3in -> evalfbb4in : [ B>=1+D ], cost: 1 11: evalfreturnin -> evalfstop : [], cost: 1 6: evalfbb4in -> evalfreturnin : [], cost: 1 4: evalfbb4in -> evalfbbin : [ 0>=1+free ], cost: 1 5: evalfbb4in -> evalfbbin : [ free_1>=1 ], cost: 1 7: evalfbbin -> evalfbb1in : [ A>=1+C ], cost: 1 8: evalfbbin -> evalfbb2in : [ C>=A ], cost: 1 9: evalfbb1in -> evalfbb3in : C'=1+C, [], cost: 1 10: evalfbb2in -> evalfbb3in : C'=0, D'=1+D, [], cost: 1 Removing duplicate transition: 4. Simplified the transitions: Start location: evalfstart 0: evalfstart -> evalfentryin : [], cost: 1 1: evalfentryin -> evalfbb3in : C'=0, D'=0, [ A>=1 && B>=1+A ], cost: 1 3: evalfbb3in -> evalfbb4in : [ B>=1+D ], cost: 1 5: evalfbb4in -> evalfbbin : [], cost: 1 7: evalfbbin -> evalfbb1in : [ A>=1+C ], cost: 1 8: evalfbbin -> evalfbb2in : [ C>=A ], cost: 1 9: evalfbb1in -> evalfbb3in : C'=1+C, [], cost: 1 10: evalfbb2in -> evalfbb3in : C'=0, D'=1+D, [], cost: 1 Applied simple chaining: Start location: evalfstart 0: evalfstart -> evalfbb3in : C'=0, D'=0, [ A>=1 && B>=1+A ], cost: 2 3: evalfbb3in -> evalfbbin : [ B>=1+D ], cost: 2 7: evalfbbin -> evalfbb3in : C'=1+C, [ A>=1+C ], cost: 2 8: evalfbbin -> evalfbb3in : C'=0, D'=1+D, [ C>=A ], cost: 2 Applied chaining over branches and pruning: Start location: evalfstart 0: evalfstart -> evalfbb3in : C'=0, D'=0, [ A>=1 && B>=1+A ], cost: 2 12: evalfbb3in -> evalfbb3in : C'=1+C, [ B>=1+D && A>=1+C ], cost: 4 13: evalfbb3in -> evalfbb3in : C'=0, D'=1+D, [ B>=1+D && C>=A ], cost: 4 Eliminating 2 self-loops for location evalfbb3in Self-Loop 12 has the metering function: -C+A, resulting in the new transition 14. Found this metering function when nesting loops: -1+B-D, and nested parallel self-loops 15 (outer loop) and 14 (inner loop), obtaining the new transitions: 16, 17. Found this metering function when nesting loops: -1-C+A, Removing the self-loops: 12 13 15. Adding an epsilon transition (to model nonexecution of the loops): 18. Removed all Self-loops using metering functions (where possible): Start location: evalfstart 0: evalfstart -> evalfbb3in : C'=0, D'=0, [ A>=1 && B>=1+A ], cost: 2 14: evalfbb3in -> [9] : C'=A, [ B>=1+D && A>=1+C ], cost: -4*C+4*A 16: evalfbb3in -> [9] : C'=A, D'=-1+B, [ B>=1+D && C>=A && B>=2+D && A>=1 ], cost: -4+4*B+4*(-1+B-D)*A-4*D 17: evalfbb3in -> [9] : C'=A, D'=-1+B, [ B>=1+D && A>=1+C && B>=1+D && A>=A && B>=2+D && A>=1 ], cost: -4+4*B+4*(-1+B-D)*A-4*C-4*D+4*A 18: evalfbb3in -> [9] : [], cost: 0 Applied chaining over branches and pruning: Start location: evalfstart 19: evalfstart -> [9] : C'=A, D'=0, [ A>=1 && B>=1+A && B>=1 && A>=1 ], cost: 2+4*A 20: evalfstart -> [9] : C'=A, D'=-1+B, [ A>=1 && B>=1+A && B>=1 && A>=1 && B>=1 && A>=A && B>=2 && A>=1 ], cost: -2+4*(-1+B)*A+4*B+4*A Final control flow graph problem, now checking costs for infinitely many models: Start location: evalfstart 19: evalfstart -> [9] : C'=A, D'=0, [ A>=1 && B>=1+A && B>=1 && A>=1 ], cost: 2+4*A 20: evalfstart -> [9] : C'=A, D'=-1+B, [ A>=1 && B>=1+A && B>=1 && A>=1 && B>=1 && A>=A && B>=2 && A>=1 ], cost: -2+4*(-1+B)*A+4*B+4*A Computing complexity for remaining 2 transitions. Found configuration with infinitely models for cost: 2+4*A and guard: A>=1 && B>=1+A && B>=1 && A>=1: B: Pos, A: Pos, where: B > A Found new complexity n^1, because: Found infinity configuration. Found configuration with infinitely models for cost: -2+4*(-1+B)*A+4*B+4*A and guard: A>=1 && B>=1+A && B>=1 && A>=1 && B>=1 && A>=A && B>=2 && A>=1: B: Pos, A: Pos, where: B > A Found new complexity n^2, because: Found infinity configuration. The final runtime is determined by this resulting transition: Final Guard: A>=1 && B>=1+A && B>=1 && A>=1 && B>=1 && A>=A && B>=2 && A>=1 Final Cost: -2+4*(-1+B)*A+4*B+4*A 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),?)