Skip to main content

Spin

Spin is an explicit-state model checker. The backend transforms a case into Promela, Spin's input language.

Install​

Install Spin and gcc, and put both spin and gcc on PATH. Spin compiles every search with gcc.

Verdicts​

Spin computes with 32-bit integers and havocs an integer only among candidate values, so it is under-approximating: a portfolio trusts a trace it finds, not a proof, and a Spin portfolio reports a proof as Inconclusive. Spin's integers wrap without notice, so the backend refuses integers and arithmetic that may leave 32 bits, and a trace it finds never passes through a wrapped value.

Time​

Spin realizes the wait before every main step as a whole delay, as Theta does, so a trace it finds is a run of the model whether or not every clock test is closed.

What the backend refuses​

The backend answers Not supported, naming each construct, or the variable it concerns, and its source line, when a case holds one of these:

  • Variables of type real, string, or any: Promela has integer, boolean, and mtype variables only.
  • For-operations: the Promela transformation has no loop.
  • Real literals: Promela has no real numbers.
  • String literals: Promela has no strings.
  • Array literals: the backend receives arrays split into one variable per slot and has no form for an array value.
  • Array indexing: the backend receives arrays split into one variable per slot and has no form for indexing.
  • Non-boolean if-then-else inside a property: an LTL formula has no conditional expression, and only a boolean one can be rewritten into logic.
  • Unbounded integer variables: the property depends on a variable without a static bound, such as a counter without a guard like if (counter < 10) { counter := counter + 1 }.
  • Integer variables beyond the 32-bit range: the property depends on a variable whose static bound exceeds it.
  • Arithmetic that may leave the 32-bit range: the property depends on the arithmetic.
  • Clocks that a whole delay may carry beyond the 32-bit range: a step adds up to one more than the largest clock bound to every clock, so every clock bound must stay below 230 - 1.