Stateful.State_machineA sequential state machine.
module Counter : Stateful.State_machine with type state = int ref = struct
type state = int ref
let add tc n =
n := !n + draw ~label:"by" tc (integers ~min_value:1 ~max_value:10 ())
;;
let rules = [ Stateful.Rule.create ~name:"add" ~step:add () ]
let invariants =
[ Stateful.Invariant.create ~name:"small" ~inv:(fun _tc n -> assert (!n < 100)) ()
]
;;
end