let kill ?log t = match state t with | #State.killable_state as c -> Some (with_history t (`Killing (State.to_history ?log c))) | other -> None