Introduction
SAPLE — the Symbolic Algebraic Process Logic Engine — is a general formal verification framework. You describe a system — a protocol, a concurrent algorithm, a state machine, a controller — as process equations over a shared state, state the properties it must have, and SAPLE checks them with three complementary techniques:
- Structural matching of behavior signatures (patterns) against the system's behavior.
- Symbolic and concrete execution of the model's paths, with data flow and path conditions on bit-vector models.
- SMT constraint solving with Z3 to decide properties and pattern constraints, rule out infeasible paths and produce concrete witnesses.
The framework consists of a specification language (SPL), a parser, an algebraic core, an analyzer, two front ends for machine code, and a CLI binary called saple.
What SPL models#
An SPL file describes a concurrent system with these declarations:
- Schemas — shared typed state and invariants.
- Transitions — guarded, atomic state updates.
- Agents — process equations over those transitions.
- Systems — composition of agents, initial state and properties to verify.
- Patterns — top-level declarations, separate from the system: behavior signatures (a sequence of actions plus a constraint) that the analyzer looks for in the system's behavior.
What SAPLE checks#
The example specifications cover:
- Deadlock freedom, mutual exclusion and progress as declared properties (dining philosophers; none is reported violated, under the same
Philosopher(i).fieldlimitation). - A cache protocol (MESI): its
dataRacepattern matches; its coherence properties are checked, but they cannot yet tell the caches apart (a known limitation ofCache(i).fieldin expressions), and its schema invariants are not checked. - A consensus protocol: the property that the block counter stays non-negative (
BlockNumber >= 0), under the sameNode(i).fieldlimitation in its guards. - Security analysis as one application: vulnerability patterns in models of a packet parser, a network stack, a token contract and a stack copy loop (integer overflow, buffer overflow, use-after-free, reentrancy).
Front ends#
Besides hand-written SPL, SAPLE analyzes machine code through two front ends, mainly for security analysis:
- Intel x86-64 Model (
--arch x86-64) — a static Intel-syntax listing of one function on bit-vector semantics, every path checked against the x86 pattern library. - AArch64 Model (
--arch aarch64) — a trace-v1 recording of one run; each pattern match is VERIFIED, OBSERVED, UNKNOWN or REFUTED.
How SAPLE differs from a model checker#
Traditional model checkers (SPIN, NuSMV, TLA+) explore reachable states of an explicit state machine. SAPLE works at the level of process equations: behaviors are algebraic terms (prefix ., choice +, parallel ||, iteration *), and analysis proceeds by structural rewriting plus targeted SMT queries. The result is a framework that scales to long traces while preserving algebraic clarity.