A Rust implementation for parsing, typechecking, lowering, and verifying Silver/Viper programs.
This repository is a research and verification toolchain: it reads .vpr files, builds an AST, resolves identifiers and globals, typechecks declarations, lowers them to an internal VMIR representation, and then runs a custom verification pipeline.
The project is centered around the verification of permission-based logic and proof obligations, with support for a broad set of Viper features and a corpus of regression tests and performance baselines.
Helium was initially developed by Jakub Adam Trzykowski.
- Parses Silver/Viper source files
- Resolves names and global declarations
- Typechecks the parsed program
- Translates the typed program to VMIR
- Verifies method/function/predicate proof obligations
- Tracks acceptance, rejection, and unsupported constructs through test cases
- Maintains deterministic performance baselines for verifier regressions
src/lib.rs– crate entry pointsrc/pipeline.rs– end-to-end parse → typecheck → translate → verify pipelinesrc/viper/– parser, AST, typechecker, and Viper-specific logicsrc/translate/– lowering from typed Viper to VMIRsrc/vmir/– intermediate representation used by the verifiersrc/verify/– verification engine and rule logicsrc/bin/– command-line tools:parse.rs– parse a file and dump the ASTtypecheck.rs– run the preprocessing/typechecking pipelinetranslate.rs– lower a program to VMIRverify.rs– verify a Viper file and print results
tests/cases/– curated test corpuspassing/– cases that are expected to verifyfailing/– cases that are expected to be rejectedknown_limitations/– tracked incompletenessesunsupported/– unsupported constructs that must be reported cleanly
benchmarks/– benchmark suites and baseline snapshots (seebenchmarks/README.md)bench/– the benchmark runner (a separate workspace member): times rustc, Helium and Silicon per file, extracts Rust and Viper shape metrics, writes one JSON per runtools/bench/–run.py/backfill.pyrecord runs on thebenchmarksbranch;site/is the GitHub Pages site that plots themvendor/egg/– theegge-graph library, as a submodule of the fork JonasAlaif/egg (branchhelium), patched in through[patch.crates-io]Cargo.toml– Rust project configurationrust-toolchain.toml– pins the nightly toolchain
This project requires the nightly Rust toolchain:
rustup toolchain install nightlyThe repository pins that toolchain in rust-toolchain.toml.
egg is a git submodule, so fetch it before the first build (or clone with --recursive):
git submodule update --init
cargo buildcargo run --bin parse -- tests/cases/passing/field.vprcargo run --bin typecheck -- tests/cases/passing/field.vprcargo run --bin verify -- tests/cases/passing/field.vprUseful option:
cargo run --bin verify -- --breakdown tests/cases/passing/field.vprThis prints the verification status of each member and, with --breakdown, the slowest verification steps and rule timings.
For tools, --json prints one JSON object instead (statuses, phase timings, per-member times, all verifier counters, peak memory, the build's git commit), and --viper-metrics prints shape metrics of the parsed program without verifying:
cargo run --release --bin verify -- --json tests/cases/passing/field.vpr
cargo run --release --bin verify -- --viper-metrics tests/cases/passing/field.vprPer commit, tools/bench/run.py records how long Helium takes on every benchmark file next to rustc and Viper's Silicon, the verifier's cost counters, and each program's shape, on the benchmarks branch; its GitHub Pages site shows trends, commit-against-commit comparisons, scaling fits and metric correlations. See benchmarks/README.md.
- Add or update a
.vprcase intests/cases/. - Run the relevant test set:
cargo test --test suite -- --nocapture- If a verification change intentionally affects performance, refresh the baselines:
UPDATE_PERF_BASELINE=1 cargo test --test perf_regression- Review the generated diff before committing the updated baseline files.
The project includes a focused test harness for correctness and cost regression:
cargo test --test suite
cargo test --test perf_regressionThese cover:
- accepted programs verifying successfully
- rejected programs being rejected consistently
- known limitations staying tracked
- unsupported constructs being surfaced as unsupported instead of crashing the pipeline
- deterministic verification-cost changes being caught by benchmark baselines
- This is not a standard end-user product crate; it is a verifier implementation and research tool.
- The codebase intentionally uses nightly-only Rust features and is built around a custom verification pipeline rather than a stable public API.
- For support and design context, the source comments and the regression corpus are the most useful reference points.
The verifier reports one result per unit in the file, with statuses such as:
OK– verified successfullyFAIL– proof obligation not dischargedUNSUPPORTED– construct is not implementedERROR– typecheck/translation rejected the unitSKIP– dependent on a rejected or failed unit
This makes it easier to diagnose whether failures are semantic, unsupported-feature-related, or caused by a dependency chain.