Trying to load file: main.koat Initial Control flow graph problem: Start location: evalfstart 0: evalfstart -> evalfentryin : [], cost: 1 1: evalfentryin -> evalfbb4in : A'=B, B'=A, [], cost: 1 2: evalfbb4in -> evalfbb2in : C'=A, [ B>=1 ], cost: 1 3: evalfbb4in -> evalfreturnin : [ 0>=B ], cost: 1 4: evalfbb2in -> evalfbb1in : [ C>=1 ], cost: 1 5: evalfbb2in -> evalfbb3in : [ 0>=C ], cost: 1 8: evalfreturnin -> evalfstop : [], cost: 1 6: evalfbb1in -> evalfbb2in : C'=-1+C, [], cost: 1 7: evalfbb3in -> evalfbb4in : B'=-1+B, [], cost: 1 Simplified the transitions: Start location: evalfstart 0: evalfstart -> evalfentryin : [], cost: 1 1: evalfentryin -> evalfbb4in : A'=B, B'=A, [], cost: 1 2: evalfbb4in -> evalfbb2in : C'=A, [ B>=1 ], cost: 1 4: evalfbb2in -> evalfbb1in : [ C>=1 ], cost: 1 5: evalfbb2in -> evalfbb3in : [ 0>=C ], cost: 1 6: evalfbb1in -> evalfbb2in : C'=-1+C, [], cost: 1 7: evalfbb3in -> evalfbb4in : B'=-1+B, [], cost: 1 Applied simple chaining: Start location: evalfstart 0: evalfstart -> evalfbb4in : A'=B, B'=A, [], cost: 2 2: evalfbb4in -> evalfbb2in : C'=A, [ B>=1 ], cost: 1 5: evalfbb2in -> evalfbb4in : B'=-1+B, [ 0>=C ], cost: 2 4: evalfbb2in -> evalfbb2in : C'=-1+C, [ C>=1 ], cost: 2 Eliminating 1 self-loops for location evalfbb2in Self-Loop 4 has the metering function: C, resulting in the new transition 9. Removing the self-loops: 4. Removed all Self-loops using metering functions (where possible): Start location: evalfstart 0: evalfstart -> evalfbb4in : A'=B, B'=A, [], cost: 2 2: evalfbb4in -> evalfbb2in : C'=A, [ B>=1 ], cost: 1 9: evalfbb2in -> [8] : C'=0, [ C>=1 ], cost: 2*C 5: [8] -> evalfbb4in : B'=-1+B, [ 0>=C ], cost: 2 Applied simple chaining: Start location: evalfstart 0: evalfstart -> evalfbb4in : A'=B, B'=A, [], cost: 2 2: evalfbb4in -> evalfbb4in : B'=-1+B, C'=0, [ B>=1 && A>=1 && 0>=0 ], cost: 3+2*A Eliminating 1 self-loops for location evalfbb4in Self-Loop 2 has the metering function: B, resulting in the new transition 10. Removing the self-loops: 2. Removed all Self-loops using metering functions (where possible): Start location: evalfstart 0: evalfstart -> evalfbb4in : A'=B, B'=A, [], cost: 2 10: evalfbb4in -> [9] : B'=0, C'=0, [ B>=1 && A>=1 ], cost: 3*B+2*B*A Applied simple chaining: Start location: evalfstart 0: evalfstart -> [9] : A'=B, B'=0, C'=0, [ A>=1 && B>=1 ], cost: 2+2*B*A+3*A Final control flow graph problem, now checking costs for infinitely many models: Start location: evalfstart 0: evalfstart -> [9] : A'=B, B'=0, C'=0, [ A>=1 && B>=1 ], cost: 2+2*B*A+3*A Computing complexity for remaining 1 transitions. Found configuration with infinitely models for cost: 2+2*B*A+3*A and guard: A>=1 && B>=1: B: Pos, A: Pos Found new complexity n^2, because: Found infinity configuration. The final runtime is determined by this resulting transition: Final Guard: A>=1 && B>=1 Final Cost: 2+2*B*A+3*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),?)