Skip to content

microsoft/verus-proof-synthesis

Repository files navigation

Verus Proof Synthesis

This repository contains code and artifacts for automated Verus proof synthesis using LLM-based approaches. It includes two proof synthesis systems and two benchmark suites.

πŸ† View the Leaderboard β€” Compare proof synthesis systems on our benchmarks!


οΏ½ Repository Contents

System Description Benchmark
AutoVerus Proof synthesis for small algorithmic code Verus-Bench (150 tasks)
VeruSAGE Proof synthesis for code in large system projects VeruSAGE-Bench (849 tasks)

AutoVerus AutoVerus

AutoVerus uses a three-phase approach to generate formal proofs for Rust programs:

  1. Inference - Generate initial proof candidates using few-shot examples
  2. Refinement - Refine promising candidates with targeted improvements
  3. Repair - Debug and fix remaining verification errors

AutoVerus Framework

Quick Start

cd autoverus
python main.py --input <input_file.rs> --output <output_file.rs> --config config.json

πŸ‘‰ AutoVerus Documentation


VeruSAGE VeruSAGE

VeruSAGE is an LLM-powered agentic framework that excels at complex systems verification with an observation-reasoning-action loop.

VeruSAGE Framework

Quick Start

cd verusage
python main.py --config config.json --input your_file.rs --output repaired_file.rs

πŸ‘‰ VeruSAGE Documentation


πŸ“Š Benchmarks

Verus-Bench

150 algorithm-level verification tasks from classic CS problems.

Source Tasks Description
CloverBench 11 Classic CS examples
MBPP 78 Formal specification problems
Diffy 38 Array/loop programs
Misc 23 Verus tutorial examples

πŸ‘‰ Verus-Bench README

VeruSAGE-Bench

849 repository-level verification tasks from real-world systems projects.

Project Tasks Domain
Anvil (AL) 104 Distributed Systems
Anvil-Advanced (AC) 63 Distributed Systems
IronKV (IR) 118 Key-Value Store
Memory Allocator (MA) 89 Systems
Node Replication (NO) 29 Distributed Systems
NRKernel (NR) 204 OS Kernel
ATMO (OS) 157 Microkernel
Storage (ST) 63 Storage Systems
Vest (VE) 22 Serialization

πŸ‘‰ VeruSAGE-Bench README


πŸš€ Installation

Docker (Recommended)

docker build -t verus-proof-synthesis .
docker run -it verus-proof-synthesis

Local Setup

Prerequisites:

  • Python 3.10+
  • Verus (see version requirements below)
  • OpenAI or Azure OpenAI API key
# Clone repository
git clone https://github.com/microsoft/verus-proof-synthesis.git
cd verus-proof-synthesis

# Install dependencies
pip install -r requirements.txt

# Set API key
export OPENAI_API_KEY=<your-openai-api-key>

Verus Installation:

git clone https://github.com/verus-lang/verus.git
cd verus
git checkout 33269ac6a0ea33a08109eefe5016c1fdd0ce9fbd  # For Verus-Bench
# git checkout ddc66116aa7a844a9e19cc50922fe85c84b8b4a5  # For VeruSAGE-Bench
./tools/get-z3.sh && source tools/activate
vargo build --release

πŸ“ Directory Structure

verus-proof-synthesis/
β”œβ”€β”€ autoverus/          # AutoVerus implementation
β”‚   β”œβ”€β”€ main.py         # Single-file proof generation
β”‚   β”œβ”€β”€ verify.py       # Batch benchmarking tool
β”‚   └── examples/       # Few-shot training examples
β”œβ”€β”€ verusage/           # VeruSAGE implementation
β”‚   β”œβ”€β”€ main.py         # Single-file repair
β”‚   β”œβ”€β”€ run_batch.py    # Batch processing
β”‚   └── agents/         # Agent framework
β”œβ”€β”€ benchmarks/
β”‚   β”œβ”€β”€ Verus-Bench/    # 150 algorithm tasks
β”‚   └── VeruSAGE-Bench/ # 849 systems tasks
β”œβ”€β”€ utils/lynette/      # Verus parser for proof synthesis
└── generated/          # Pre-generated proof results

πŸ“š Further Reading


Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.


Citation

If you find this work useful, please consider citing:

@article{autoverus,
  title={AutoVerus: Automated Proof Generation for Rust Code},
  author={Chenyuan Yang and Xuheng Li and Md Rakib Hossain Misu and Jianan Yao and Weidong Cui and Yeyun Gong and Chris Hawblitzel and Shuvendu K. Lahiri and Jacob R. Lorch and Shuai Lu and Fan Yang and Ziqiao Zhou and Shan Lu},
  journal={Proceedings of the ACM on Programming Languages},
  volume={9},
  number={OOPSLA2},
  year={2025},
  publisher={ACM New York, NY, USA}
}

@misc{verusage,
  title={VeruSAGE: A Study of Agent-Based Verification for Rust Systems},
  author={Chenyuan Yang and Natalie Neamtu and Chris Hawblitzel and Jacob R. Lorch and Shan Lu},
  year={2025},
  eprint={2512.18436},
  archivePrefix={arXiv},
  primaryClass={cs.OS},
  url={https://arxiv.org/abs/2512.18436},
}

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5