pub trait CodeGenerator: Send + Sync {
// Required methods
fn generate(
&self,
program: &ProgramModel,
invariants: &[Invariant],
) -> Result<GenerationOutput>;
fn chain(&self) -> &str;
}Expand description
Generates instrumented code with invariant checks.
Implementations inject assertions after state mutations.
Required Methods§
Sourcefn generate(
&self,
program: &ProgramModel,
invariants: &[Invariant],
) -> Result<GenerationOutput>
fn generate( &self, program: &ProgramModel, invariants: &[Invariant], ) -> Result<GenerationOutput>
Generate instrumented code.
§Errors
Returns an error if:
- Invariant expressions reference undefined state
- Type mismatches are detected
- Code generation fails