This repository contains modules for automatic verification of Verus code.
- ViewInferenceModule: Generates a View function for a data structure, which is a mathematical abstraction used in specifications.
- ViewRefinementModule: Improves an existing View function to make it more suitable as an abstraction.
- InvInferenceModule: Generates an inv function that captures all necessary invariants of a data structure.
There are two ways to run the system:
This requires valid API keys for OpenAI or other LLM providers:
./run.shThis uses a dummy implementation that returns placeholder responses:
./disable_llm_run.shConfiguration is stored in src/configs/config-verusagent.json. Key settings:
example_path: Path to the examples directoryaoai_api_key: Your API key(s) for LLM accessaoai_generation_model: The model to use for code generation
src/modules/: Contains the module implementationssrc/prompts/: Contains templates for promptssrc/configs/: Contains configuration filesexamples/: Contains example Verus code (input) and their solutions (output)output/: Where results are savedtests/: Contains test Verus files
When running the system, it will:
- Generate a View function from the input code
- Refine the View function for better abstraction
- Generate an inv function to capture data structure invariants
- Save all intermediate and final results in the output directory