Skip to content

Glossary Behavior & verification

What is a state machine?

A state machine models behavior as a set of states and the transitions between them, each fired by an event and optionally limited by a guard.

Also called finite-state machine, FSM.

State machine

A state machine describes how a system behaves over time as a set of states, such as off, standby, operating and fault, and the transitions between them. A transition is fired by a trigger event, can be limited by a guard condition, and can carry an action. One state is initial, and a machine may have final states where a run ends.

Why it matters

Many failures in physical systems are mode problems: a command arriving in a state that doesn't expect it, a fault with no way to recover, a mode that can be entered but never left. A state machine makes those cases visible and checkable before anything is built.

How it goes wrong

  • Modeling normal operation and leaving out faults and recovery
  • States that nothing reaches, or that nothing leaves
  • Two transitions from one state on the same event, with no guard to choose between them

In Cairn

Any node in Cairn, from the system to a single part, can have its own state machine. The Behavior lens shows it as a diagram laid out in steps from the initial state, a transition table and a state × event matrix, and flags unreachable states, dead ends, final states with exits and transitions that compete for one event. A simulator lets you step through it by hand. States and transitions are added by hand, or proposed by the Behavior specialist through Change Review.

Questions

When is a state machine worth drawing?
When a system has modes: start-up and shutdown, standby, fault handling, degraded operation or mission phases. If what the system does depends on what happened before, a state machine helps.
What is a guard?
A condition that must be true for a transition to fire. It lets two transitions on the same event lead to different states.

See it on your own system.

Describe what you are building and Cairn interviews you, then builds the first model with you.