node f(x : bool) returns (o : int)
let
  automaton
    state A
      do o = 0 fby (o + 1);
      unless x then B
        
    state B
      do o = 1 fby (2 * o);
      until x then A
  end
tel