Supervisory control of finite state machines