Commands

text
tanny <COMMAND>

Commands:
  check      Check every model in the files and directories given
  translate  Print the TLA+ a model is checked as
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

tanny check#

Check every Model(...) found in the supplied Python files and directories:

bash
tanny check [OPTIONS] <PATHS>...
Option Default Description
<PATHS>... (required) One or more Python files or directories to scan.
--root <DIR> (none) Directory searched for absolute imports before each file's own package root. Repeat to pass multiple roots; searched in the order given.
-m, --model <NAME> (all models) Check only models whose variable name equals <NAME>. Repeat to select multiple models.
--json false Print verdicts and top-level diagnostics as JSON to stdout instead of human-readable text.
-q, --quiet false Suppress PASS lines in human-readable text output (no effect with --json).
--workers <N> 1 Number of worker processes expanding states in each check.

Examples:

bash
# Check an entire directory of specifications
tanny check examples/

# Resolve imports from src/ while checking specs under tests/specs/
tanny check --root src/ tests/specs/

# Check two specific models quietly with 4 workers
tanny check -q --workers 4 -m spec_model -m impl_model examples/die_hard.py

# Produce JSON for downstream tooling
tanny check --json examples/

tanny translate#

Emit the generated TLA⁺ modules and Main.cfg configuration for a single model:

bash
tanny translate [--root <DIR>] <PATH> <MODEL>
Argument / Option Description
<PATH> Python file defining the model.
<MODEL> Variable name of the Model(...) to translate.
--root <DIR> Directory searched for absolute imports before the file's own package root. May be repeated.

tanny translate writes each module (Main.tla, plus any refined abstract specification modules) and Main.cfg to stdout separated by TLA⁺ comments (\* Main.tla, \* Main.cfg). If the model is not found or has frontend or translation errors, diagnostics are written to stderr and tanny exits with status 2.

Note that the emitted Main.tla extends the built-in Py prelude module (crates/tanny-translate/src/Py.tla), which defines Python-compatible operators (PyDiv, PyMod, PyIx, PySlice, etc.).