// Commentary: // // Here is an example of a model that deadlocks. The interface has a // bye event in the !idle state to avoid the interface from deadlocking // due to the world event not occurring since it is optional. Because // the optional world is not guaranteed to occur and component does not // accept or use the bye event on either port this model has a potential // deadlock. // // Code: interface ihelloworld { in void hello(); in void bye(); out void world(); behavior { bool idle = true; [idle] on hello: idle = false; [!idle] { on bye: idle = true; on optional: {idle = true; world;} } } } component deadlock { provides ihelloworld h; requires ihelloworld w; behavior { on h.hello(): w.hello(); on w.world(): {} } }