; NO-TERMINATION BOUNDARY fixture. An LLM-natural shape: a "tick"
; event loop that never exits (no non-recur branch). Per the
; loop-recur spec this MUST `ail check` AND `ail build` cleanly —
; AILang makes no termination claim. BUILD-ONLY: by design this
; binary never returns, so it is never executed.
(module loop_recur_5_event_loop_noterm
  (fn run_forever
    (doc "Infinite event loop. Two binders: tick counter and a running parity flag. No branch ever exits via a non-recur term.")
    (type (fn-type (params) (ret (own (con Int)))))
    (params)
    (body
      (loop (tick (con Int) 0) (parity (con Int) 0)
        (if (app eq (app % tick 2) 0)
            (recur (app + tick 1) 1)
            (recur (app + tick 1) 0)))))
  (fn main
    (type (fn-type (params) (ret (own (con Unit))) (effects IO)))
    (params)
    (body (app print (app run_forever)))))
