ExTLA.Spec.PredicateError exception (ExTLA v0.6.0)

Copy Markdown View Source

Raised when a predicate — invariant, terminal, action_property, or a state predicate inside a temporal — evaluates to something other than true or false.

Elixir's and/or return their last operand, so n >= 0 and status evaluates to status, and a checker that tests the result for truthiness counts every non-nil, non-false value as "holds". A predicate that checks nothing would then report green — the shape Design Principle 6 forbids. The compiled predicate passes its result through boolean!/3 instead, so every consumer (the checker, trace replay, coverage, the ledger) gets the same refusal, naming the declaration and the value it returned.

Summary

Functions

The predicate's result, if it is a boolean; otherwise raise naming the declaration it came from.

Functions

boolean!(result, module, declaration)

The predicate's result, if it is a boolean; otherwise raise naming the declaration it came from.