Oriel — AI & technology worth noticing, every day.

Ship Your Interpreter

Web page · https://basis.ai/blog/ship-your-interpreters

First seen by Oriel on .

AI summary

Basis used LLMs and Lean to generate formal semantics for a WHILE language and prove that its compiled RISC-V interpreter agrees with those semantics for every program.

  • The experiment covered an extended WHILE language with integers, strings, closures, loops, runtime errors, and a 1,855-line C interpreter.
  • The endToEnd_refinement theorem establishes equivalent outputs for terminating programs and excludes semantic outputs when the compiled interpreter diverges.
  • Proof obligations exposed implementation details that tests missed, including 64-bit wrapping, distinct rendering rules, abrupt for-loop initialization, and 63-byte closure-name truncation.
  • The binary contained 25,336 RISC-V instructions, including the C compiler’s output, newlib, and dlmalloc, so the theorem covers those components.
  • LLMs wrote the semantics, proofs, and C-library lemmas, while separation logic was needed to reason about memory and allocator behavior.

#formal verification #lean #risc-v #programming languages

Generated by gpt-5.6-sol. Check the original for details.

Aliases

SourceExternal IDURL
Hacker News50160440https://www.basis.ai/blog/ship-your-interpreters/ Read discussion
Lobstersrtd5gqhttps://www.basis.ai/blog/ship-your-interpreters/ Read discussion