Skip to main content

CLI Workflow

Every verification capability documented in this section is reachable from the command line. This page is the single reference: every flag, every subcommand, every interaction between them.

If you're new to the Verum CLI, read Tooling → CLI first for the overall command set. This page assumes you know how to run verum and focuses on the verification subset.


1. Command overview

The CLI entry points that touch verification:

CommandPurposeCovered here?
verum checkType-check only (no code-gen, optionally refinement check).§2
verum verifyFull verification; the flagship command.§3, §4
verum analyzeStatic analysis suite (escape, context, refinement coverage).§5
verum smt-statsTelemetry dump from the session statistics cache.§6
verum smt-infoSMT backend linkage / version / capability report.§7
verum auditTrusted-boundary enumeration (framework axioms, admits, kernel rules).§8
verum extractCurry-Howard program extraction from constructive proofs into Verum/OCaml/Lean/Coq.Program extraction
verum exportProof-certificate export to external provers (Lean / Coq / Dedukti / Metamath).Proof export

Every flag, subcommand, and output format described in this document is part of the shipping CLI surface.


2. verum check — type-check with optional refinement

verum check [FILE] [OPTIONS]

Flags

FlagDefaultEffect
--strictoffAlso invoke SMT for refinement obligations. Fast strategy.
--verboseoffPrint per-module timing and cache hits.
--no-stdliboffSkip stdlib compilation (for compiler debugging).

Exit codes

CodeMeaning
0Type-check passed; if --strict, all refinement obligations discharged.
1Type error.
2--strict refinement proof failure.

check is ~10-100× faster than verify because it skips the full verification pipeline (SMT invoked only for refinements when --strict). Use it in CI fast loops.


3. verum verify — flagship verification

verum verify [TARGET] [OPTIONS]

TARGET can be a file, a directory (recursively verified), or a project root.

Mode flags (layer 1: VerificationLevel)

FlagMaps toMeaning
--mode runtimeRuntimeNo SMT; compile runtime assertions. (check is usually better.)
--mode staticStatic (default)SMT; fail build on unprovable obligations.
--mode proofProofSMT + kernel replay; emit certificates to target/proofs/.
--mode cubicalcubical kernel rulesEnable HComp / Transp / Glue / PathTy kernel rules for path-type reasoning.
--mode dependentΠ/Σ tacticsEnable dependent-type tactics over Π / Σ / Inductive types.

Strategy flags (layer 2: VerifyStrategy)

FlagMaps toTimeoutExtras
--strategy fastFast3 sStatic encoding only.
--strategy static (default)Static30 sSingle solver call.
--strategy formalFormal60 sFull tactic library.
--strategy thoroughThorough300 sPortfolio race (multiple SMT backends).
--strategy certifiedCertified300 sPortfolio + kernel replay + cross-validation.
--strategy synthesizeSynthesize600 sthe SMT backend SyGuS body synthesis (requires synth-fun in the obligation).

Solver selection

FlagMeaning
--solver autoCapability-router decides (default).
--solver smt-backendForce the SMT backend for every obligation.
--solver smt-backendForce the SMT backend for every obligation.
--solver portfolioParallel race, first unsat wins.
--solver capabilityExplicit capability-router invocation (diagnostic).

Timeout and budget

FlagMeaning
--timeout 60Per-obligation timeout (seconds). Overrides strategy default.
--budget 5mTotal time budget for the entire verify run.
--budget-policy {fail,skip}What happens when budget exhausts.

Counterexamples

See also Counterexamples.

FlagMeaning
--counterexample {none,minimal,standard,full,json}Per-failure counterexample verbosity.
--minimize-timeout 30Delta-debugging budget per counterexample.

Profiling

FlagMeaning
--profileEmit per-function time to stderr.
--show-costsEmit theory-taxonomy cost per obligation.
--profile-obligationPer-obligation breakdown table (slowest 10 obligations, time-ms + share-%). Implies --profile.

Export

FlagMeaning
verum export --to lean -o PATHLean 4 statement-only certificates (axiom / theorem … := sorry).
verum export --to coq -o PATHCoq statement-only certificates (Axiom / Theorem … Admitted.).
verum export --to dedukti -o PATHNeutral exchange-format name : type. statements.
verum export --to metamath -o PATHMetamath $a / $p … $= ? $. scaffold.
verum export-proofs --to FMTAlias for verum export --to FMT.

Cross-tool re-check runs weekly via the cert-interop.yml GitHub Actions workflow — exports all four formats, pipes them through lean4 / coqc / dkcheck / mmverify.py, and posts a Markdown matrix summary.

Comparison and interactive modes

FlagMeaning
--compare-modesRun Fast/Static/Formal/Thorough side-by-side; report deltas.
--interactiveEnter REPL after first failure; use help for commands.

Ladder dispatch (--ladder)

Routes every @verify(strategy) annotation in the project through the typed 13-strategy ladder dispatcher (verum_verification::ladder_dispatch::DefaultLadderDispatcher).

FlagMeaning
--ladderShort-circuit standard verify and emit per-theorem ladder verdicts.
--ladder-format plain|jsonOutput format (default plain).

Per-theorem verdicts:

  • Closed — kernel accepted at the requested strategy.
  • Open — kernel rejected; cites a concrete failure reason.
  • DispatchPending — strategy is annotated but the V0 dispatcher has no backend yet (advisory; non-fatal exit).
  • Timeout — strategy timed out at its budget (hard failure).

Exit code is non-zero only on Open / Timeout — DispatchPending is expected for the 11 strategies still in the current framework ramp-up (Fast, Formal, Proof, Thorough, Reliable, Certified, CoherentStatic, CoherentRuntime, Coherent, ComplexityTyped, Synthesize). V0 only implements Runtime + Static end-to-end; the typed-acknowledgement contract is what the ladder gives you today.

Plain output:

Ladder dispatch — per-theorem @verify(strategy) verdicts

Theorem / lemma / corollary Strategy Verdict Detail
───────────────────────────────── ────────────────── ────────────────── ────────────────────
ring_add_comm formal dispatch_pending V1: portfolio SMT (multiple SMT backends)
cbgr_check_runtime runtime closed runtime-assertion: cbgr_check_runtime (CBGR check fires at call site) (0ms)

Verdict totals:
closed 2
open 0
dispatch_pending 8
timeout 0
total 10

Files: 14 scanned, 14 parsed, 0 skipped

JSON shape:

{
"schema_version": 1,
"theorem_count": 10,
"totals": { "closed": 2, "open": 0, "dispatch_pending": 8, "timeout": 0 },
"files": { "scanned": 14, "parsed": 14, "skipped": 0 },
"theorems": [
{ "kind": "theorem", "name": "ring_add_comm",
"file": "src/algebra.vr", "strategy": "formal",
"verdict": "dispatch_pending",
"detail": "V1: portfolio SMT (multiple SMT backends) via verum_smt::backend_switcher" }
]
}

The ν-monotonicity invariant (along the monotone backbone, the Implemented strategies form a downward-closed initial segment) is enforced at audit time via verum_verification::ladder_dispatch::verify_monotonicity.

Closure-cache incremental verification (--closure-cache)

Per-theorem verdict cache. Theorem proofs whose closure-hash + Ok-verdict are already cached are skipped without invoking the SMT/kernel re-check.

FlagMeaning
--closure-cacheOpt in to the cache (default off).
--closure-cache-root PATHOverride the default <input.parent>/target/.verum_cache/closure-hashes/. Implies --closure-cache.

The verify run's summary line includes hit/miss telemetry:

Theorem verification: 142/142 verified, 0 failed, 0 axioms (search: 142 attempts, 142 hits)
Closure cache: 138 hit(s), 4 miss(es), 97.2% hit-ratio

Cache key includes verum_kernel::VVA_VERSION — any kernel-rule edit invalidates ALL cached entries unconditionally. See Tooling → Incremental cache for the full reference (storage layout, JSON schema, distributed CI patterns, trait surface).

Debug flags

FlagMeaning
--dump-smt DIRDump every solver query as DIR/<prefix>-<NNNNN>.smt2.
--check-smt-formula FILERe-check a raw SMT-LIB 2 file through the current solver — short-circuits the Verum pipeline.
--solver-protocolStream [→]-/[←]-prefixed solver commands + verdicts to stderr.
--lsp-modeEmit one JSON diagnostic per line on stdout (LSP-consumable).
--profile-obligationPer-obligation timing breakdown under the main profile report.
--diff GIT_REFLimit verification to .vr files changed since GIT_REF.
--interactive-tacticDrop into a per-goal tactic console instead of the whole-program REPL.
--verify-profile NAMEApply a [verify.profiles.<name>] block from verum.toml.
--smt-proof-preferencesmt-backend — backend to prefer for proof export.

The three SMT debug flags speak to env-var side channels (VERUM_DUMP_SMT_DIR, VERUM_SOLVER_PROTOCOL) that the solver backends consume at their assert / check_sat boundaries. VERUM_LSP_MODE=1 is the env-var equivalent of --lsp-mode for non-CLI callers.

Exit codes

CodeMeaning
0All obligations discharged (or all failures soft-fell to runtime, if configured).
1Type error.
2At least one obligation failed (error-level policy).
3Budget exceeded.
4Solver crash / backend unavailable.

4. Typical invocations

4.1 CI fast loop

verum check --strict

Just type-check, invoke SMT only for refinements, 3s timeout each.

4.2 Pre-commit full proof

verum verify --mode static --strategy formal --timeout 60 \
--counterexample=minimal --export target/verify-ci.json

Every refinement + ensures clause proven; short counterexamples on failure; JSON export for dashboard.

4.3 Release-grade certification

verum verify --mode proof --strategy certified \
--export-proofs target/proofs/ \
--budget 30m \
--profile --show-costs

Full kernel replay, portfolio race, cross-validation, certificates written for archival. Budget-capped.

4.4 Targeted debug

verum verify --mode static --strategy thorough \
core/math/arith.vr::safe_div \
--counterexample=full --interactive

Single obligation, maximum detail, drop into interactive explorer on failure.

4.5 Migration audit

verum verify --compare-modes core/

For every obligation in core/, run Fast / Static / Formal / Thorough and report timing deltas — useful for deciding what level to fix a given file at.


5. verum analyze — static analysis suite

verum analyze [OPTIONS]

Separate from the SMT verification path; these checks run on the typed AST and CBGR reachability graph.

FlagDefaultEffect
--escapeonCBGR tier-promotion escape analysis.
--contextonContext-system usage (missing using [...], unused ctx).
--refinementonRefinement coverage ("which functions have refinements, which don't").
--lifetimeonLifetime-graph acyclicity.
--alloffEnable every sub-analysis.
--jsonoffJSON output.

analyze is complementary to verify. verify proves what you wrote; analyze reports what you could write to get better guarantees.


6. verum smt-stats — telemetry

verum smt-stats [OPTIONS]

Reads from the session statistics cache at target/smt_stats.json. Useful after a CI run to see where time went.

FlagEffect
--jsonJSON output.
--resetClear the cache.
--top NTop N slowest obligations.
--by-theoryGroup by theory taxonomy.

Sample output:

SMT statistics — session 2026-04-24 11:32:17
Total obligations: 4,821
Total time: 18m 42s
Cache hits: 2,314 (48%)

By theory:
LIA 1,822 avg 11 ms
nonlinear arith 412 avg 187 ms
strings 83 avg 402 ms
bitvector 301 avg 9 ms
arrays + LIA 645 avg 24 ms
quantifiers (FMF) 89 avg 1,201 ms
mixed theories 152 avg 88 ms

By backend:
smt-backend 3,945 (82%) avg 18 ms
smt-backend 612 (13%) avg 142 ms
portfolio 264 (5%) avg 98 ms

Top 5 slowest:
1. core/math/real.vr::integral_convergence 12,400 ms
2. core/math/linalg.vr::eigen_decomp 8,920 ms
3. ...

7. verum smt-info — backend diagnostics

verum smt-info [OPTIONS]

Prints linked solver versions, available theories, tactics, and build configuration.

FlagEffect
--jsonJSON output.

Use this when reporting bugs — solver version is the single most important piece of context.


8. verum audit — trusted-boundary enumeration

verum audit [OPTIONS]
FlagEffect
--framework-axiomsList all @framework-tagged axioms reachable from public API.
--admitsList all admit / sorry uses.
--kernel-rulesList the 18 primitive kernel rules (for audit).
--cone MODULERestrict to the transitive dependency cone of a module.
--format {plain,json}Output format.
--since GIT_REFDiff mode: show framework deps added since a git ref.

Example:

verum audit --framework-axioms --cone core.math --format json | jq .

Emits JSON listing every framework axiom used transitively in core.math, with citations and framework IDs. Useful for supply-chain review.


9. Configuration file reference

verum.toml at project root sets defaults. Any CLI flag can be overridden at the file level with #[verify(attr = value)] at the top of the file, or at the declaration level with #[verify(...)] on the decl.

[verify]
mode = "static"
strategy = "formal"
timeout = 60
counterexample = "standard"
budget = "10m"

[verify.profiles.release]
mode = "proof"
strategy = "certified"
timeout = 300
counterexample = "full"
budget = "30m"
export-proofs = "target/release/proofs/"

[verify.exclude]
paths = [ "tests/fixtures/**" ]

verum verify --profile release picks the release override block; CLI flags on top of that override individual settings.


10. Interoperability

10.1 Exit-code contract

All verum verify / verum check runs respect the exit-code contract in §3. CI scripts should distinguish exit 1 (user type error, cannot proceed) from exit 2 (proof failed, may be known flaky) from exit 3 (budget exhausted, retry with more budget).

10.2 JSON schema stability

--json output has a schema version ("schema_version": 1). The schema is stable; inspect the emitted structure by running verum verify --json on a small project. A consolidated reference lives under docs/architecture/ alongside the other tooling schemas.

10.3 LSP

The LSP server runs verify --mode static --strategy fast --counterexample=minimal --json behind the scenes for in-editor diagnostics. Users can tune the LSP verification mode in editor settings without touching verum.toml.


11. Troubleshooting quick table

SymptomFirst thing to try
"Solver timeout"--strategy thorough or --timeout 120
"Solver returned unknown"--solver portfolio (race multiple SMT backends)
"Counterexample not minimal"--minimize-timeout 60
"Verification is slow"verum smt-stats → pick the theory bucket that dominates
"Proof works locally, fails in CI"verum smt-info both sides; check solver version drift
"Failure diagnostic is cryptic"--counterexample=full --interactive
"Framework-axiom count rising"verum audit --framework-axioms --since HEAD~50
"Certificates absent after --mode proof"Ensure target/proofs/ exists; confirm --strategy certified

12. See also