~/talk

Proving Python code correct with Nagini

Talkat Swiss Python Summit 2023 · on Thursday, 2023-09-21· [python]
links:none on file
slides:none on file

Nagini verifies Python by running mypy, encoding typed code into the Viper intermediate language, and discharging assertions with an SMT solver (Z3). Examples include catching a division by zero missed by types, encoding caller preconditions via requires/ensures calls, and proving a summation by adding a loop invariant; a quicksort example checks element multiset preservation and ordering. Limitations: unsupported dynamic features, heavy annotation and verification cost, counterexamples returned, and runtime spec calls are evaluated but are no-ops (removable for production).

AI-written summary · about

  1. 0:00Introduction and speaker introduction
  2. 2:32Why formal verification beyond types
  3. 5:41Preventing runtime errors with preconditions
  4. 7:49Writing expressive specifications
  5. 8:31Proving correctness with postconditions
  6. 10:21Loop invariants and termination proofs
  7. 12:32Nagini architecture and Viper encoding
  8. 15:52Case study: Verifying quicksort
  9. 18:19Counterexamples and debugging
  10. 19:48Supported and unsupported Python features
  11. 21:12Limitations and performance issues
  12. 22:59Complexity of specifications
  13. 24:01Future plans and open source
  14. 25:05Q&A: Handling unknown inputs
  15. 26:08Q&A: Viper language clarification
  16. 27:12Q&A: Production use and performance
  17. 28:18Q&A: What is an SMT solver?
  18. 29:40Q&A: Integration with testing tools
  19. 31:07Q&A: Python vs Rust/Go verification
  20. 32:09Q&A: Runtime behavior of contracts
  21. 33:12Q&A: Integration with mypy
  22. 34:39Q&A: Non-invasive Nagini version
  23. 36:24Closing remarks
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.