Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Annex C. Flag reference

The command-line form is:

semi-persistent [OPTIONS] <FILE>

FILE is the required path to one Semper program.

Representation and literal model

FlagValuesDefaultEffect
--bits32, 6432Width preset, by storage word: 31-bit ids with 32-bit multiplicities, or 63-bit ids with 64-bit multiplicities. Operator and sort ids are 31-bit in both. Every operation on a count is checked: a count past the width is reported as multiplicity overflow: … with the width and its maximum. --id-bits is an alias, and either spelling accepts 31 for 32 and 63 for 64.
--cost-bits32, 64, bigbigAn optional signed cap on a cost model’s values and on the cost (extract … :cost m) reports; big sets none. Arithmetic is exact either way, and a value outside the cap is a reported error naming the operation. Each solver’s own range is checked separately, before it runs (Part V).
--push-popdiffdiffSelect scope storage. diff uses semi-persistent logs. clone is a reserved value: the argument parser rejects it, since no deep-copy backend exists, and the program exits with status 2.
--typesmachine, bignumbignumSelect comma-separated literal groups. machine,bignum enables both groups. An unknown group exits with status 1.
--proofsflagoffRecord merge justifications for proof extraction.
--dump-proofs FILEpathnoneWrite one proof-path record per e-node after execution, and report the record count on standard error. Requires --proofs.

The machine group provides i64, u64, f64, usize, String, and bool; the bignum group provides IBig, UBig, RBig, and bool.

Saturation and completion

FlagDefaultEffect
--use-naiveselectedExplicitly select full re-matching each round. Conflicts with --use-semi-naive.
--use-semi-naiveoffSelect delta-driven saturation. Conflicts with --use-naive.
--derive-ac-eqsoffStart with eager AC completion during rebuild, as (set-option :completion eager) does. A set-option in the program overrides it. Conflicts with --lazy-ac-eqs.
--lazy-ac-eqsoffStart with check completion, as (set-option :check-completion on) does: checks run goal-directed AC completion temporarily. A set-option in the program overrides it. Conflicts with --derive-ac-eqs.
--check-ac-basisoffPrint expensive reduced-basis invariant checks during eager completion. It has no effect without --derive-ac-eqs.
--count-match-stepsoffCount matching work and report match steps: N on standard error after the closing status.
--flatten-rhsoffGive an AC node a rewrite builds a flat alternative for each same-operator child kept nested because its class is used elsewhere; not for operators with :inverse.

Chapters 9 and 11 define the evaluation and completion modes.

Matching and union policies

FlagValueDefaultEffect
--runtime-schedulingflagoffChoose atom order per binding from live bucket lengths. Conflicts with --auto-scheduling.
--auto-schedulingflagoffSelect static or per-binding atom ordering for each rule and round. Conflicts with --runtime-scheduling.
--sampled-selectivityflagoffEstimate bound-key fan-out by sampling the emitter relation.
--sampler-knonnegative integer32Set emitter nodes drawn per sampled estimate. Relevant with --sampled-selectivity.
--sampler-bootstrapnonnegative integer0Set bootstrap resamples per estimate; zero disables the guard. Relevant with --sampled-selectivity.
--sampler-cvfloating-point number1.0Reject a bootstrapped estimate when its coefficient of variation exceeds this threshold. Relevant with a nonzero --sampler-bootstrap.

The parser does not enforce the three “relevant with” conditions: the value is accepted and has no effect. | --union-by | rank, size, uses, sum | rank | Choose the surviving representative by union-find rank, class size, use-list length, or size plus uses. |

These policies change operational work and representative choice, not the equalities asserted by the input program.

Help

FlagEffect
-h, --helpPrint the generated command-line help.

An unknown flag or an invalid value exits with status 2 and a usage line.

Test directives

The test harness in egraph/tests/egg_tests.rs reads directives from the first eight lines of a program. Each directive mirrors a flag; pass the flag when running the file by hand.

DirectiveValuesDefaultFlag
;; EXPECT:ok, check-failed, parse-error, sort-error, erroroknone; the expected outcome
;; MESSAGE:textnonenone; the outcome’s message must contain the text
;; WARNING:text, or nonenonenone; some warning must contain the text, one directive per warning, or no warning may be raised
;; TYPES:as --typesbignum--types
;; EVAL:naive, semi, bothboth--use-naive or --use-semi-naive
;; CHECK_AC_BASIS:onoff--check-ac-basis; the harness also asserts the invariants after a successful run
;; UNION_BY:rank, size, uses, sumrank--union-by

The harness runs every file under both the static and the runtime atom-scheduling modes, with the 32-bit preset and without proof recording.

Feature-gated diagnostics

Two environment variables affect binaries built with optional instrumentation features; they are not command-line flags:

Build feature and environmentEffect
phase-timing, EGRAPH_PHASE=1Print aggregate rebuild, indexing, matching, and application timings at exit.
phase-timing, EGRAPH_PHASE=roundsAlso print one timing line per saturation round.
seek-stats, EGRAPH_SEEK=1Print leapfrog seek-distance histograms at exit.

Without the corresponding Cargo feature, setting the environment variable has no effect.