Embedded supervisory control of discrete-event systems