Proving correctness #
Start with the mathematical result you want, then connect it to the implementation. The correctness interface includes safety and termination, but asks for no time budget. A separate complexity proof can reuse the same invariants.
Source-level proofs #
Start with the proof view that matches the program. A total mathematical model supports ordinary Lean equations; mutation uses contracts about mathematical contents and the actual endpoint heaps. Both views describe the same declared implementation.
- Source semantics and proof views
- Programs over input and output sequences
- Represented data and collection contracts
- Proving linked-list programs
- Mutable state, scratch scopes and calls
- Persistent sessions
- Reusable current inputs
- Space bounds
- Expected resources
- Source loops and recursion
- Connecting source proofs to RAM
Direct word-RAM proofs #
The direct RAM language remains available for backend work and explicitly low-level implementations. These chapters use its word arithmetic, representations and source contracts:
- Direct word-RAM contracts and execution
- Mathematical models for word-RAM programs
- Direct word-RAM proof automation and composition
Related chapters #
- Getting started: declarations and executable entry points.
- Working with data: representations, aliasing and memory frames.
- Proving complexity: separate bounds for the same execution.
- Execution backend: machine assumptions and counting boundaries.
- Development: builds and module organization.