On Modelling Heap Invariants for Type Systems in Dafny
summary
Claims that a middle-level heap model can express ownership-style invariants and that Dafny can both encode and check them. Builds a prototype ~500 lines of Dafny encoding Dala-style categories (local, immutable, isolated (ISO) objects), enforces ISO reference-count ≤ 1, and validates examples like free objects and borrow-like patterns. Verification mostly works but is intermittent and sometimes opaque; some parts would be easier in Lean, while Dafny gives runnable, readable specs.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 0:21Key takeaways
- 1:03Rust memory model challenges
- 3:56Rust linked list restrictions
- 5:44Heap model concept
- 7:51Dafny for heap invariants
- 9:15Syntax pitfalls
- 10:42Semantics in heap modeling
- 11:03Dafny heap model demo
- 14:15Dala heap model
- 16:02Mutable vs isolated objects
- 18:30Islands in heap models
- 20:58Dafny free objects demo
- 23:47Dafny advantages and limits
- 25:55Dafny error messages
- 26:17Q&A
