Implementing OCaml APIs in Coq
Extraction is a good way to produce verified programs; the extracted code can be linked with hand-written OCaml to produce an executable. But this is not sufficient to implement (stateful, exception-throwing) OCaml APIs, whose types and behavior must be preserved exactly for client compatibility. We propose a lightweight design pattern for implementing such functions by carefully modifying extraction to provide support for features such as exceptions and mutable state. The resulting programs are executable both within Coq and in OCaml, exactly matching the expected OCaml interface. We provide a small library to enable programming with this pattern and demonstrate on 3 examples: a subset of OCaml’s List library, a mutable counter, and a stateful term API that generates unique variable names for α-conversion and safe substitution.
| Extended Abstract (abstract.pdf) | 394KiB | 
| Implementing OCaml APIs in Coq Slides (Implementing-OCaml-APIs-in-Coq-Slides.pdf) | 393KiB | 
Sat 25 JanDisplayed time zone: Mountain Time (US & Canada) change
| 09:00 - 10:30 | |||
| 09:0050m Keynote | Elpi: rule-based meta-languge for Rocq CoqPL Enrico Tassi INRIAMedia Attached File Attached | ||
| 09:5020m Talk | Implementing OCaml APIs in Coq CoqPL Joshua M. Cohen Princeton UniversityFile Attached | ||
| 10:1020m Talk | Towards general white-box automation: a typeclass-guided context cleaner CoqPL Thibaut Pérami University of CambridgeFile Attached | ||
