You are a Rust expert knowledgeable in formal methods and cryptographic protocol verification.
This repository contains two tools (don't confuse them):
cryptovampire2— current tool (main development focus): a protocol verifier for computational indistinguishability. Runs Scheme (.scm) input on thesteelinterpreter, using thegolggee-graph engine, and turns protocol specs into SMT files for Vampire/Z3/CVC5. Binary:cryptovampire2. Seeexamples/cryptovampire2/.cryptovampire— the older trace-property verifier (.ptclinput; the--exec-pred,--pairwise-find-fa, add-rewrite and-1/-2model work lives here). It compiles and works onmaster(build:cargo build --release -p cryptovampire); the binary iscryptovampire. Seeexamples/cryptovampire/.
See README.md for detailed usage and installation.
agents/cryptovampire.md is a distilled agent knowledge base: how each binary works, the CLI, the .ptcl/.scm DSLs, how the SMT output (protocoles, ; fa pairs, ; uf-cma, …) is shaped, solver practice, known traps/fixes, and the current state of the example corpus. It distinguishes v1 cryptovampire from v2 cryptovampire2 throughout. Read it before doing protocol-verification work in this repo.
Workspace crates:
cryptovampire2— Current tool version (main development focus; scheme/steel)golgge— E-graph based reasoning engine (used bycryptovampire2; can be modified)egg— Fork ofegg(do not modify)cryptovampire— Older.ptcltool (trace properties). Builds & runs onmaster(cargo build --release -p cryptovampire); most of the recent find/lemma work lives here- Supporting crates:
utils,logic_formula,cryptovampire_macros,cryptovampire_smt,quarck
- Code must compile:
cargo checkmust succeed - Minimize
cargo clippywarnings (not strictly required) - Document all new functions, traits, structs, and modules
- Maintain consistent coding style
- Dead code is acceptable during development
Verify changes with the corpus harnesses (the old crates/cryptovampire2/tests/passing/ path no longer exists — tests moved to the examples/* Makefiles):
- v2 (.scm):
makeinexamples/cryptovampire2/ - v1 (.ptcl):
makeinexamples/cryptovampire/(content-aware flag dispatch; flaky-but-correct, has 2-attempt retries)
Note: Tests may occasionally fail for non-deterministic reasons; a rerun may help.
# Check compilation
cargo check
# v2 (.scm) corpus harness
cd examples/cryptovampire2 && make
# v1 (.ptcl) corpus harness (needs Vampire/Z3/CVC5 on PATH)
cd examples/cryptovampire && make
# Enable verbose logging
RUST_LOG=trace cargo run --profile debug-optimized -- <args>- Logging: Set
RUST_LOG=tracefor detailed execution logs - Profiles: Use
--profile debug-optimizedfor development (optimized but with debug symbols) — butdebug_assertionsstay on, so any internal error hard-panics; judge provability only with--release - SMT Solvers: Requires Vampire, Z3, or CVC5 for full functionality
- Test Files: v1 models at
examples/cryptovampire/*.ptcl; v2 atexamples/cryptovampire2/*.scm
Use delimiter-validator to debug parenthising problems in scheme.
See delimiter-validator -h for the exact parameters to use.
When calling delimiter-validator -t "scheme" -v -f <file> it re-outputs the file with xx: yy->zz: <the line> where xx is the line number, yy is how deeply nested the parenthesing is at the begining of the line, and zz is the same for the end of the line.