Trying to load file: main.koat Initial Control flow graph problem: Start location: evalfstart 0: evalfstart -> evalfentryin : [], cost: 1 1: evalfentryin -> evalfbb3in : A'=B, B'=A, [], cost: 1 2: evalfbb3in -> evalfbbin : [ B>=1 && 254>=B ], cost: 1 3: evalfbb3in -> evalfreturnin : [ 0>=B ], cost: 1 4: evalfbb3in -> evalfreturnin : [ B>=255 ], cost: 1 5: evalfbbin -> evalfbb1in : [ 0>=1+A ], cost: 1 6: evalfbbin -> evalfbb1in : [ A>=1 ], cost: 1 7: evalfbbin -> evalfbb2in : [ A==0 ], cost: 1 10: evalfreturnin -> evalfstop : [], cost: 1 8: evalfbb1in -> evalfbb3in : B'=1+B, [], cost: 1 9: evalfbb2in -> evalfbb3in : B'=-1+B, [], cost: 1 Simplified the transitions: Start location: evalfstart 0: evalfstart -> evalfentryin : [], cost: 1 1: evalfentryin -> evalfbb3in : A'=B, B'=A, [], cost: 1 2: evalfbb3in -> evalfbbin : [ B>=1 && 254>=B ], cost: 1 5: evalfbbin -> evalfbb1in : [ 0>=1+A ], cost: 1 6: evalfbbin -> evalfbb1in : [ A>=1 ], cost: 1 7: evalfbbin -> evalfbb2in : [ A==0 ], cost: 1 8: evalfbb1in -> evalfbb3in : B'=1+B, [], cost: 1 9: evalfbb2in -> evalfbb3in : B'=-1+B, [], cost: 1 Applied simple chaining: Start location: evalfstart 0: evalfstart -> evalfbb3in : A'=B, B'=A, [], cost: 2 2: evalfbb3in -> evalfbbin : [ B>=1 && 254>=B ], cost: 1 7: evalfbbin -> evalfbb3in : B'=-1+B, [ A==0 ], cost: 2 5: evalfbbin -> evalfbb1in : [ 0>=1+A ], cost: 1 6: evalfbbin -> evalfbb1in : [ A>=1 ], cost: 1 8: evalfbb1in -> evalfbb3in : B'=1+B, [], cost: 1 Applied chaining over branches and pruning: Start location: evalfstart 0: evalfstart -> evalfbb3in : A'=B, B'=A, [], cost: 2 11: evalfbb3in -> evalfbb3in : B'=-1+B, [ B>=1 && 254>=B && A==0 ], cost: 3 12: evalfbb3in -> evalfbb1in : [ B>=1 && 254>=B && 0>=1+A ], cost: 2 13: evalfbb3in -> evalfbb1in : [ B>=1 && 254>=B && A>=1 ], cost: 2 8: evalfbb1in -> evalfbb3in : B'=1+B, [], cost: 1 Eliminating 1 self-loops for location evalfbb3in Self-Loop 11 has the metering function: B, resulting in the new transition 14. Removing the self-loops: 11. Removed all Self-loops using metering functions (where possible): Start location: evalfstart 0: evalfstart -> evalfbb3in : A'=B, B'=A, [], cost: 2 14: evalfbb3in -> [8] : B'=0, [ B>=1 && 254>=B && A==0 ], cost: 3*B 8: evalfbb1in -> evalfbb3in : B'=1+B, [], cost: 1 12: [8] -> evalfbb1in : [ B>=1 && 254>=B && 0>=1+A ], cost: 2 13: [8] -> evalfbb1in : [ B>=1 && 254>=B && A>=1 ], cost: 2 Applied chaining over branches and pruning: Start location: evalfstart 0: evalfstart -> evalfbb3in : A'=B, B'=A, [], cost: 2 15: evalfbb3in -> [9] : B'=0, [ B>=1 && 254>=B && A==0 ], cost: 3*B 16: evalfbb3in -> [10] : B'=0, [ B>=1 && 254>=B && A==0 ], cost: 3*B Applied chaining over branches and pruning: Start location: evalfstart 17: evalfstart -> [9] : A'=B, B'=0, [ A>=1 && 254>=A && B==0 ], cost: 2+3*A 18: evalfstart -> [10] : A'=B, B'=0, [ A>=1 && 254>=A && B==0 ], cost: 2+3*A Final control flow graph problem, now checking costs for infinitely many models: Start location: evalfstart 17: evalfstart -> [9] : A'=B, B'=0, [ A>=1 && 254>=A && B==0 ], cost: 2+3*A 18: evalfstart -> [10] : A'=B, B'=0, [ A>=1 && 254>=A && B==0 ], cost: 2+3*A Computing complexity for remaining 2 transitions. Found configuration with infinitely models for cost: 2+3*A and guard: A>=1 && 254>=A && B==0: B: Both, A: Const Found new complexity const, because: Found infinity configuration. Found configuration with infinitely models for cost: 2+3*A and guard: A>=1 && 254>=A && B==0: B: Both, A: Const The final runtime is determined by this resulting transition: Final Guard: A>=1 && 254>=A && B==0 Final Cost: 677 Obtained the following complexity w.r.t. the length of the input n: Complexity class: const Complexity value: 0 WORST_CASE(Omega(1),?)