Getting Started¶
Your First MVL Program¶
Create hello.mvl:
Run it:
The ! Console declares that this function has a console side effect. MVL tracks all effects in function signatures — nothing is hidden.
Your First Verification¶
Create positive.mvl:
fn double(x: Int where x > 0) -> Int where self > 0 {
x * 2
}
fn main() ! Console {
let result: Int = double(5);
println(result.to_string())
}
Check it:
The compiler proves at compile time that:
double(5)satisfiesx > 0(refinement type)- The return value satisfies
self > 0(return refinement) resultis always positive — no runtime check needed
Try breaking it:
error[REQ10]: refinement violated
--> positive.mvl:7:30
|
7 | let result: Int = double(-1);
| ^^ value -1 does not satisfy `x > 0`
Assurance Report¶
This generates a verification report showing which requirements were proven, how many proofs were discharged, and the evidence trail. Useful for compliance (DO-178C, IEC 61508, ISO 26262).
Next Steps¶
- The 11 Requirements — what the compiler proves
- Design Principles — why MVL is built this way
- Examples — real programs with verification