Skip to content
You are reading the documentation of the development version (main branch): it may describe changes that are not released yet. Current documentation: 2026.10. Other versions: 2026.09 (extended documentation), 2026.09 (as released)

Executables Reference

All executables are built with dune build from inside alvie/code/ and run from the alvie/code/ directory unless a --tmpdir or --sancus path says otherwise. ALVIE in your browser runs most of them with nothing to install: see In the browser.

alvie gathers the tools of this page under one command:

CommandSame asDoes
alvie learnlearn.exeLearns a model
alvie comparefa.exeCompares the four models of an experiment
alvie execexec.exeRuns a sequence of inputs on the simulator
alvie pbtpbt.exeProperty-based testing of two attacker specifications
alvie property inclusion M1 M2Checks that every trace of M1 is one of M2, or prints one that is not
alvie property equivalence M1 M2Checks that two models have the same traces, or prints one of a single model
alvie property formula M -f F.mcfChecks that a model satisfies an mCRL2 modal μ-calculus formula
alvie plugin check [DIR]Checks the files of a plugin (by default plugins/sancus, which alvie is built with) and prints a summary, or every problem with its place
alvie plugin schemas OUTWrites the JSON Schemas of the plugin files and of the plugin’s values to OUT
alvie plugin new NAME [--external]Makes a plugin from the template: native, or external in Python (see the Plugin Author Guide)
alvie plugin types DIR OUT.pyWrites the Python constructors of the observations of the plugin in DIR
alvie external DIR ...The commands of ALVIE/Core on the external plugin in DIR (see the protocol)
alvie vaultlink learn|compare|replay|serveALVIE/VaultLink: models of services that speak a line-based text protocol, over TCP or in memory (see the ALVIE/VaultLink Reference)
alvie tiny ...The commands of ALVIE/Core on Tiny, the reference platform (see below)
alvie sancus conformance, fixtures, execThe same commands on Sancus: the conformance of the simulator, and the fixtures of plugins/sancus
alvie sancus-fpga ...The commands of ALVIE/Core on Sancus-FPGA: Sancus on an openMSP430/Sancus board (see Running on an FPGA)
Terminal window
_build/default/bin/alvie.exe learn --att-spec ... --encl-spec ... --res model.dot --tmpdir /tmp/alvie --sancus ../../sancus-core-gap --oracle pac
_build/default/bin/alvie.exe plugin check

learn.exe, fa.exe, exec.exe and pbt.exe are the same commands under their former names. They remain for one release, for the scripts and tools that call them (alvie-ui runs bin/learn.exe and reads its output, which does not change), and the sections below describe them by these names.

The options of the backend (--sancus, --commit, --sancus-master-key, --tmpdir, --keep-repeated-reentries) come from the configuration parameters of plugins/sancus/alvie-plugin.yaml: their names, types, defaults and help are those of the manifest.

alvie property checks the other properties of the catalogue of ALVIE/Core (version 1) on learned models. Noninterference, the fourth, is alvie compare. Like alvie compare, it sees the models as the attacker does: through the view of plugins/sancus/view.yaml, with hidden outputs silent (τ in traces). Only formula needs mCRL2.

Terminal window
_build/default/bin/alvie.exe property equivalence ../../results/264f135-b7-enclave-complete-0-0.01-0.01-int.dot ../../results/264f135-b7-enclave-complete-1-0.01-0.01-int.dot
_build/default/bin/alvie.exe property formula model.dot --formula my-property.mcf
OptionDefaultMeaning
--tmpdir/tmp/alvieDirectory for the files given to mCRL2 (formula, or ALVIE_MCRL2=1)
--formula, -fThe formula (formula only)
--debugDebug-level logging, and keep the files of mCRL2; the command prints where they are

In a formula, the actions are the labels of the model, input/Output(fields), made into mCRL2 identifiers: every character other than a letter or a digit becomes _. With --debug, actions.txt, next to the model given to mCRL2, lists each action and its label.

The exit status is 0 when the property holds and 4 when it does not; when it does not, the output gives a trace that shows it (except for a formula). A mistake in the command or the files (a missing model, a model of a newer format, a formula that mCRL2 rejects) exits with 2 and a message.

ALVIE/Core has the same commands for every plugin: alvie tiny ... for Tiny, alvie-NAME ... for a native plugin made with alvie plugin new, and alvie external DIR ... for an external one (alvie external plugins/tiny-py ... for Tiny in Python). Their options include those of the plugin’s manifest: --mitigation for Tiny. The Tiny tutorial uses each of them.

CommandDoes
learn --spec F --res M.dotLearns a model of the backend under the spec (several --spec for a spec in several files)
compare --m1 A --m2 B --secrets s1,s2 --witnesses W.dotNoninterference: the witnesses that tell apart two models that differ only in the secret
property inclusion|equivalence|formulaThe other properties, as alvie property below
exec --spec F --inputs FILERuns the atoms of FILE (one per line, as a spec writes them; a line that starts with # is a comment) and prints what each observes
conformance --spec FChecks that the backend keeps the contract of Core, on random tests of the spec
fixtures [NAME ...]Learns and compares the plugin’s fixtures, and checks their verdicts

Options of learn (and of exec and conformance where they apply):

OptionDefaultMeaning
--secret VThe value of the secret ? in the spec; needed when the spec has one
--variant NAMEA variant of the system from the manifest, such as no-interrupts
--oraclepacpac, with --epsilon and --delta (0.01 each) and --round-limit; randomwalk, with --test-count (500) and --reset-probability (0.05); wmethod, with --extra-states (1) and --max-tests (no limit); or exhaustive
--seed N0The seed of the random choices: learning is deterministic for a seed
--debugDebug-level logging

Options of compare: --m1-baseline and --m2-baseline (models of a baseline variant, whose witnesses do not count), --tmpdir (for mCRL2 with ALVIE_MCRL2=1, default /tmp/alvie) and --cex-limit. Options of conformance: --tests (50), --length (30) and --seed; of fixtures: --dir (another directory of fixtures) and --out (the models and witnesses, default /tmp/alvie/fixtures).

The models of these commands are of the generic form: their inputs are atoms and their outputs observations, as the plugin files declare them; they do not contain the inputs that the spec does not allow. compare, property and fixtures refuse a model of another plugin.

compare, property, conformance and fixtures exit with 0 when the check passes and 4 when it does not. A mistake in the command or its files exits with 2; errors that the command-line parser finds (an unknown option, a value of the wrong type, a missing option) exit with 1.

On Sancus, alvie learn and alvie compare stay the commands of experiments, with the Sancus model files; alvie sancus has the commands that check the plugin. The simulator takes a few minutes for each model of a fixture.

alvie sancus-fpga has all the commands, on the board. Its options are those of plugins/sancus-fpga/alvie-plugin.yaml: --sancus, --commit (required: the commit of the image on the board), --fpga-port (default /dev/ttyUSB1), --sancus-master-key, --tmpdir and --keep-repeated-reentries. It uses the specs, inputs and observations of ALVIE/Sancus, and its models have the inputs and outputs of the models of learn.exe: alvie sancus-fpga compare finds their witnesses (fa.exe refuses them, as models of another plugin), and alvie-model-compare compares them with the simulator’s.

Learned models are Graphviz .dot files whose first line says what made them:

// alvie-model format 1; plugin sancus 2026.10; core 1

Models without this line come from earlier versions; they read the same. A model of a later format is refused with a message: it needs a newer ALVIE, and so is a model of another plugin.


1. learn.exe — Learn a Mealy machine model

Section titled “1. learn.exe — Learn a Mealy machine model”

Purpose: Runs the L# active automata learning algorithm against a Sancus Verilog simulation. Produces a .dot file representing the learned Mealy machine: the attacker’s observable behavior of the enclave. This is the main experiment driver.

FlagDescription
--att-spec <file>Path to attacker specification (.atdl file)
--encl-spec <file>Path to enclave specification (.etdl file)
--res <file>Output .dot file path for the learned model
--tmpdir <dir>Directory for temporary Verilog simulation files
--sancus <dir>Path to the Sancus simulator root
FlagDefaultDescription
--oracle <mode>pacQuery oracle mode: randomwalk, pac, exhaustive, or wmethod
--commit <sha>ef753b6Label or git commit of the Sancus version to check
--secret <value>absentSecret substituted into the enclave specification; required when the spec contains ?
--epsilon <float>0.01PAC error bound, used only by pac
--delta <float>0.01PAC confidence parameter, used only by pac
--pac-bound <int>1Included in --report output only; does not limit the current PAC oracle
--step-limit <int>500Max steps for a random-walk equivalence query
--round-limit <int>unlimitedMax rounds for a PAC equivalence query
--reset-probability <float>0.05Random-walk probability of restarting the current path
--extra-states <int>1W-method: the number of states that the system may have beyond the model
--max-tests <int>unlimitedW-method: the maximum number of tests of an equivalence query; a limit removes the guarantee
--bad-probability <float>0.20Probability of generating an input not driven by the specification
--ignore-interruptsfalseTreat interrupts as invisible (collapse interrupt outputs)
--keep-repeated-reentriesfalseDo not identify a segment of execution between two enclave re-entries with an identical one immediately before it (see Choosing Learner Settings); learning may not finish when an enclave can be resumed repeatedly
--sancus-master-key <hex>(default key)Master key passed to the Sancus simulator
--dryfalseDry run: set up the simulator but do not learn
--reportfalsePrint a line of learning statistics on stderr (see the log output reference)
--debugfalseEnable debug-level logging
--infofalseEnable info-level logging: one line per equivalence-query round and one per counterexample (see the log output reference)
VariableEffect
ALVIE_SIM_CACHEDirectory where compiled simulators are kept and reused (default: simv-cache inside --tmpdir); 0 always compiles. Also used by exec.exe and pbt.exe
ALVIE_PROFILEWith 1, print on stderr, at the end of the run, the time spent in each part of the learner and of the simulator; SIGUSR1 prints it during the run
ALVIE_CHECK_APARTWith 1, check every answer of the learner’s caches against a computation from scratch, and stop at the first difference. Very slow: for testing changes to the learner
ALVIE_FULL_TRACEWith 1, the simulator dumps every signal instead of the top level of the testbench (useful to inspect the VCD files); used when the simulator is compiled
ALVIE_ASMWith toolchain, the programs of the steps are built by msp430-as and msp430-ld, as before; by default ALVIE’s assembler builds them (the first build of a --tmpdir still uses the toolchain, which prepares it)
ALVIE_MCRL2With 1, comparisons ask mCRL2 (ltscompare and tracepp) for the traces that one model has and the other does not, as before; with check, ALVIE asks both and warns when they differ. By default ALVIE checks the inclusion itself
ALVIE_DUMP_PROGRAMSA directory where the simulator writes every program it builds, with its configuration: the input of tt_asm_golden record
OCAMLRUNPARAMGarbage collector settings; when it is set, learn.exe does not apply its own

A Mealy machine in .dot format is written to --res. Each edge is labelled input / output, where inputs and outputs use the symbolic alphabet defined in the specifications. See the Log and Output Reference for output token meanings.

Terminal window
cd alvie/code
_build/default/bin/learn.exe \
--att-spec ../../spec-lib/example/attacker.atdl \
--encl-spec ../../spec-lib/example/enclave.etdl \
--oracle randomwalk \
--secret 0 \
--step-limit 100 \
--res /tmp/example-s0.dot \
--tmpdir /tmp/alvie-example-s0 \
--sancus "$PWD/../../sancus-core-gap" \
--info

This learns a model for the example attack with secret=0 using random-walk equivalence queries, writing the result to /tmp/example-s0.dot.

learn.exe, fa.exe, and pbt.exe validate their input files and output directories before running a simulator, model comparison, or property-based test. learn.exe also validates the oracle, relevant numeric options, Sancus checkout, and secret placeholder before simulator setup. It exits with status 2 for those user-correctable errors. An incomplete simulator run exits with status 3 and must not be interpreted as a learned model or security result. For an unexpected failure, rerun with --debug and file a bug report with the command and sanitized diagnostics.


2. fa.exe — Find flow-analysis (NI) violations between two models

Section titled “2. fa.exe — Find flow-analysis (NI) violations between two models”

Purpose: Takes two interrupt-enabled .dot Mealy machines and optionally their two no-interrupt counterparts. It checks the inclusion of the traces that the attacker sees, in both directions, to find distinguishing traces. Supplying the no-interrupt models removes witnesses that already exist without interrupt scheduling.

FlagDefaultDescription
--m1-int <file>(required)secret=0 model, interrupt variant (.dot)
--m2-int <file>(required)secret=1 model, interrupt variant (.dot)
--m1-nint <file>optionalsecret=0 no-interrupt model (.dot)
--m2-nint <file>optionalsecret=1 no-interrupt model (.dot)
--witness-file-basename <base>(required)Output path prefix; produces <base>_int.dot
--tmpdir <dir>(required)Directory for intermediate mCRL2 files (only with ALVIE_MCRL2=1)
--cex-limit <int>unlimitedStops the search after the round that finds this many witnesses, in each of the two directions. One round can find several witnesses, so the result can have more.
--secrets <s1>,<s2>from the model namesThe values of the secret in the first and the second model. By default they are read from the names <commit>-<attacker>-<enclave>-<secret>-<eps>-<delta>[-int|-nint].dot. The comparison ignores them in the victim’s code, so that the two runs of a witness run “the same code”.
--debugfalseEnable debug-level logging

<witness-file-basename>_int.dot — a .dot graph whose paths are distinguishing traces (attack witnesses). If no counterexample exists, the file contains one state and no transitions. The tool prints the number of violations only with --debug. See Reading and Checking a Witness for how to read the graph.

Terminal window
cd alvie/code
_build/default/bin/fa.exe \
--m1-int /tmp/example-orig-s0-int.dot \
--m2-int /tmp/example-orig-s1-int.dot \
--m1-nint /tmp/example-orig-s0-nint.dot \
--m2-nint /tmp/example-orig-s1-nint.dot \
--witness-file-basename /tmp/example-orig-witness \
--tmpdir /tmp/alvie-fa \
--cex-limit 3

Produces /tmp/example-orig-witness_int.dot containing up to 3 distinguishing attack traces. Add --debug to print the number of flow-analysis violations (=== Results: found N FA violations.).


3. exec.exe — Replay an input sequence (debugging tool)

Section titled “3. exec.exe — Replay an input sequence (debugging tool)”

Purpose: Developer/debugging utility. Sets up the Sancus simulator exactly like learn.exe but, instead of learning, replays the input sequence stored in --sexp-input and prints the observed outputs. It is useful for manually inspecting the simulator’s response to a specific trace without running the full learner.

Same setup flags as learn.exe (minus oracle/learning flags):

FlagDescription
--sexp-input <file>Required S-expression file containing the raw input sequence to replay
--att-spec <file>Attacker specification (.atdl)
--encl-spec <file>Enclave specification (.etdl)
--tmpdir <dir>Temp directory for simulation files
--sancus <dir>Path to Sancus simulator root
--commit <sha>Simulator git commit to use
--secret <0|1>Secret value
--ignore-interruptsCollapse interrupt outputs
--sancus-master-key <hex>Master key
--debugDebug logging

Prints one line per step to stdout: the input sent and the output received from the simulator.

Terminal window
cd alvie/code
cat > /tmp/alvie-trace.sexp <<'EOF'
((IAttacker(CCreateEncl(enc_s enc_e data_s data_e)))
(IAttacker(CJmpIn enc_s))
(IEnclave(CInst I_NOP)))
EOF
_build/default/bin/exec.exe \
--sexp-input /tmp/alvie-trace.sexp \
--att-spec ../../spec-lib/example/attacker.atdl \
--encl-spec ../../spec-lib/example/enclave.etdl \
--secret 1 \
--tmpdir /tmp/alvie-exec \
--sancus "$PWD/../../sancus-core-gap" \
--debug

4. pbt.exe — Property-based reset-equivalence testing

Section titled “4. pbt.exe — Property-based reset-equivalence testing”

Purpose: Uses QCheck to generate two input traces without learning a Mealy machine. The first trace follows --att-spec1. The second follows --att-spec2 while reusing the first trace’s enclave actions. It runs both traces on the selected simulator configuration and checks whether they agree on the occurrence of a reset.

pbt.exe does not substitute secret values or compare the complete attacker-visible output. It is therefore a focused randomized reset-equivalence smoke test, not a replacement for learn.exe followed by fa.exe.

FlagDefaultDescription
--att-spec1 <file>(required)Attacker spec for the first run (.atdl)
--att-spec2 <file>(required)Attacker spec for the second run (.atdl)
--encl-spec <file>(required)Enclave specification (.etdl)
--test-count <int>500Number of generated property tests to run
--step-limit <int>deprecatedCompatibility alias for --test-count
--tmpdir <dir>(required)Temp directory
--sancus <dir>(required)Sancus simulator root
--commit <sha>ef753b6Simulator git commit
--sancus-master-key <hex>(default)Master key
--debugfalseDebug logging
--infofalseInfo logging

QCheck test results are printed to stdout. On failure, the reported pair of traces differs in whether execution resets.

Terminal window
cd alvie/code
_build/default/bin/pbt.exe \
--att-spec1 ../../spec-lib/example/attacker.atdl \
--att-spec2 ../../spec-lib/example/attacker.atdl \
--encl-spec ../../spec-lib/example/enclave.etdl \
--tmpdir /tmp/alvie-pbt \
--sancus "$PWD/../../sancus-core-gap" \
--test-count 50 \
--info

ALVIE in your browser runs the commands of this page in its terminals and tutorials, with the same options and outputs, from the root of its files (the repository root):

AvailableNot available
learn.exe, fa.exe, exec.exe (also as _build/default/bin/...), and alvie learn, compare, execpbt.exe
alvie sancus ... on the simulators of the eight commits of the experiments (ef753b6, e8cf011, 3170d5d, 6475709, 3636536, d54f031, 264f135, bf89c0b), built with the key cafe; --sancus and --tmpdir may be left outOther commits or keys of Sancus, and the FPGA board (alvie sancus-fpga)
alvie tiny ...alvie property formula: it needs mCRL2
alvie vaultlink ... on the services in memory (--service)--target host:port and serve: a page cannot open TCP connections
The scripts learn_example.sh, learn_one.sh, learn_one_nospecial.sh, learn_all.sh, check_example.sh, check_one.sh, check_all.shEnvironment variables such as ALVIE_JOBS: a script runs up to four commands at once

The models are the same as those of the native ALVIE: learning is deterministic, and CI checks it. See ALVIE in Your Browser.

ExecutablePurposeNeeds simulatorNeeds mCRL2Output
learn.exeLearn Mealy machine via L#YesNo.dot model
fa.exeFind NI violations between two modelsNoNo.dot witness graph
exec.exeReplay an input trace (debug)YesNostdout trace
pbt.exeRandom NI testing (no model)YesNoQCheck report