Skip to content

Case Studies

The following case studies showcase the use of StateWORKS in designing and specifying software with state machines. They range from simple examples to basic concepts to increasingly complex systems involving RTDB objects, multiple cooperating state machines, hierarchical control, and real-world communication protocols.

Together, these examples illustrate the main idea of StateWORKS: a system’s behavior can be precisely specified with state machines while keeping control flow separate from data flow. Complex applications can be broken down into smaller, more manageable state machines, and their behavior and interaction can be designed and tested directly in this process.

To explore and test these examples, download and install StateWORKS Studio on your computer.

The microwave oven is a simple example that introduces RTDB objects and their control functions. The case study shows how timers, parameters, and switch points can simplify a state machine and how an initially simple solution can be refined when the requirements are examined more closely.

Read article

The Calculator is a conceptual example showing how context-dependent control can be separated from data processing. It illustrates the StateWORKS approach to partitioning control and data flow and shows why explicit states can be preferable to flags and complicated conditional logic.

Read article

The Dining Philosophers is a classic computer-science problem often used to discuss synchronization issues like deadlock and starvation. This case study instead shows a working solution: five state machines represent the philosophers and shared XDA objects represent the forks, illustrating how independent state machines can coordinate over shared resources without a hierarchy.

Read article

The Gas Control example demonstrates a hierarchical system of state machines. Five state machines control the gas inlets and chamber pressure: a Master Gas state machine coordinates three Flow state machines and a Press state machine. The Master and its Slaves communicate using a command-state interface, which shows how complex control problems can be split into smaller, more manageable parts.

Read article

This case study demonstrates the design and implementation of an industrial control system using the RTDB run-time system. It illustrates the strict partition between data and control flow and shows how the designer can concentrate first on the behavior of the control system while filtering essential control factors from irrelevant details.

Read article

A railway crossing signal demonstrates a control system with several cooperating state machines. The design addresses not only the normal sequence of events but also unusual, erroneous, and potentially unsafe situations. The control task is divided into smaller, manageable parts that function together to provide the correct signaling behavior.

Read article

This case study demonstrates how StateWORKS can be applied to a real communication protocol. It shows how explicit states can replace flags and counters used to represent hidden state, resulting in a formal description of the failover behavior that can be implemented as specified.

Read article

A traffic light is a simple control problem that illustrates why state machines are an effective way to model system behavior. This case study contrasts the StateWORKS approach with a complex UML statechart solution and shows how events, input conditions, timers, and states can be used to create a complete and comprehensible controller.

Read article