CLI Tools

The saple binary has nine subcommands:

SubcommandPurpose
parseParse an SPL specification and print a declaration summary
analyzeAnalyze an SPL model or a front-end input: properties and patterns
translateTranslate an x86-64 listing or an AArch64 trace into SPL
composeCompose patterns into chain patterns and close the set under composition
harnessRun the verification harness against a fixture corpus
tracePostmortem tools for .sable-trace/ run directories
model, match, testPlaceholders: they print a status line and do no analysis yet
Changes in this release
  • The front ends are now --arch x86-64 (Intel x86-64 Model, bit-vector semantics) and --arch aarch64 (AArch64 Model). The former names --arch x86-64-bv and --arch trace-aarch64 still work as aliases and print note: --arch <old> is now --arch <new>.
  • Files with the .asm extension now go to the x86-64 front end.
  • An unknown --arch given to saple translate no longer falls back silently: it prints warning: no translator named `<name>`; using `<translator>` from the input's extension or content (available: …).

Global flags#

These go before or after the subcommand.

FlagDefaultDescription
--format <FORMAT>tabletable, json or dot
--verbose, -voffVerbose output
--version, --helpVersion, help (also per subcommand)

saple parse#

Parses a file and prints one line per declaration; Parsed successfully: N declarations goes to standard error. A parse error prints Parse error: line:col: … and exits 1. saple parse does not expand include lines.

Shell
saple parse examples/dining_philosophers.spl
saple parse examples/dining_philosophers.spl --ast              # the whole AST, one line
saple --format json parse examples/dining_philosophers.spl      # the summary as JSON
Output
type PhilState: 3 members
type ForkState: 2 members
transition getHungry(id)
…
agent Philosopher: 4 behaviour equations
agent Fork: 1 behaviour equations
schema DiningTable: 1 attributes
system DiningPhilosophers: 2 agents
Parsed successfully: 13 declarations

With --format json the summary is an array of { kind, name, details }; with --ast as well, an object { summary, ast }.

saple analyze#

The main command. The input is an SPL model (.spl), an x86-64 listing (with --arch x86-64) or an AArch64 trace-v1 recording. It checks the system's properties and matches every pattern of the model and the loaded libraries.

Shell
saple analyze examples/dining_philosophers.spl
saple analyze listing.txt --arch x86-64 --pattern-set=v0.6 --format=json
saple analyze chain.spl --pattern-file patterns/aarch64-trace-v0.1.spl

Input and patterns#

FlagDefaultDescription
--arch <ARCH>from the inputFront end for a non-SPL input: x86-64 or aarch64. A trace-v1 recording is recognised from its content
--input NAME=VALUEBind a concrete value to a model variable (e.g. --input packetCount=50000000); takes one or more values
--pattern-set <SET>v0.5v0.5 auto-loads patterns/generated/; v0.6 auto-loads patterns/generated-v6/ and patterns/x86-cwe-v0.6.spl (paths relative to the working directory)
--pattern-file <PATH>Apply the patterns of this file in this run (repeatable)
--no-auto-loadoffDo not auto-load the generated rules and the v0.6 library
--show-coverageoffPrint the semantic coverage manifest before the analysis

Front-end models#

FlagDefaultDescription
--path-budget <N>256x86-64 models: paths checked per pattern before the rest is reported UNKNOWN (never dropped)
--report-refutedoffAArch64 trace models: also report REFUTED candidates
--trace-timeout-ms <MS>10000AArch64 trace models: solver time per query; 0 makes every query UNKNOWN (not unlimited)

Engine#

FlagDefaultDescription
--traceoffShow the detailed execution trace (state changes, preconditions, property checks)
--extract-rulesoffExtract reusable rules from findings into patterns/generated/
--export <PATH>Export the rule database as JSON
--threads <N>0 (auto)Number of threads
--memory-budget-mb <N>512Memory budget for caches (MB)
--max-memo-entries <N>10000Entries of the path memo
--no-cacheoffDisable caching (SPL parse cache, …)
--solver-pool-size <N>0 (auto)Solver pool size
--parallel-depth-threshold <N>10Depth threshold for parallel path exploration
--stl-laws <LIST>allComma-separated STL-Calculus laws to apply: sec, epac, arcc, eige, ecga, gsa, rusi; epac also governs the exploration-time path reduction
--stl-budget <N>200Solver-query budget of the STL normalisation phase
--pure-substrateoffDisable every STL law, the normalisation phase and the path reduction (findings are identical)

Run capture#

FlagDefaultDescription
--trace-out <DIR|auto>Capture a structured trace to a run directory; auto uses .sable-trace/<id>/. The exit status is then always 0
--trace-detail <LEVEL>mediumcoarse, medium or fine
--no-pretty-traceoffSuppress the pretty-printed trace even with --verbose/--trace
--run-id <ID>generatedOverride the run id

saple translate#

Translates a front-end input into SPL. Without -o the SPL goes to standard output (as JSON with --format json).

Shell
saple translate listing.txt --arch x86-64 -o listing.spl
saple translate run.json --arch aarch64 -o run.spl          # also writes run.trace.json
saple translate run.json --arch aarch64 --check
FlagDescription
--arch <ARCH>Required. auto picks the front end from the input's extension or content; otherwise x86-64 (Intel x86-64 Model) or aarch64 (AArch64 Model)
-o, --output <PATH>Write the SPL to a file (for aarch64, the sidecar <name>.trace.json beside it)
--symbolic-input <IN>aarch64: an input the model leaves free: X0..X30, SP, NZCV or mem:0x<addr>:<len> (repeatable; added to the trace's metadata.symbolic_inputs)
--checkaarch64: replay the trace, print the summary, mismatches and pc-continuity breaks, and exit non-zero on any mismatch or break; writes nothing unless -o is given
--trust-flags, --no-trust-flagsNo effect on a trace-v1 recording

saple compose#

Closes a set of patterns under composition (a pattern followed by another into one chain pattern) and writes the composites as an ordinary pattern file plus an optional JSON sidecar with provenance and statistics. Apply the result with saple analyze … --pattern-file.

Shell
saple compose --rules patterns/aarch64-trace-v0.1.spl --out composed.spl --json composed.json
FlagDefaultDescription
--rules <PATH>requiredPattern files (or models) whose pattern declarations seed the closure; repeatable
--out <PATH>requiredOutput pattern file
--json <PATH>JSON sidecar with provenance and statistics
--max-sig-len <N>6Longest composite signature, in steps
--budget <N>2000Solver-query budget for the whole closure
--min-strength <S>reachableWeakest composition strength kept: reachable or implied
--schema <PATH>Model whose schema supplies attribute widths for bare literals

saple harness#

Runs the verification harness against a fixture corpus (default tests/corpus) and exits with its status.

FlagDefaultDescription
[CORPUS]tests/corpusCorpus root
--filter <S>…Run fixtures whose path contains any of the substrings
--unit-only, --integration-onlyoffRestrict the fixture kind
--parallel <N>0 (auto)Parallel workers
--verbose-failuresoffPrint the full annotated replay of each failed fixture
--keep-tracesoffKeep the captured trace in each fixture's directory

saple trace#

Postmortem tools for the run directories that saple analyze --trace-out writes under .sable-trace/:

Shell
saple trace replay <RUN_ID>       # pretty-print the events of a run
saple trace inspect <RUN_ID>      # print the manifest and summary
saple trace prune --older-than <DAYS> --keep-last <N>
saple trace compress <RUN_ID>     # gzip events.jsonl in place

saple model, saple match, saple test#

These subcommands parse their arguments (model --mode forward|backward --max-steps 100, match --pattern <PATH>, test --coverage transition|state|path) and print a status line, infrastructure ready, end-to-end pipeline pending. They do no analysis today; use saple analyze.

↑ ↓ to moveEnter to openEsc to close