Translates OCaml programs to Coq for formal verification of properties like invariants and absence of failures.
coq-of-ocaml is a tool that translates OCaml programs into similar-looking Coq code, enabling formal verification of complex properties such as invariant preservation, absence of assert failures, and backward compatibility. It is designed for large-scale verification, as demonstrated by its use in verifying the Tezos cryptocurrency protocol, covering 80% of files across 100,000 lines of OCaml.
OCaml developers working on large-scale, purely functional or monadic programs who need to formally verify critical properties, such as those in cryptocurrency protocols or other high-assurance systems.
Developers choose coq-of-ocaml for its ability to handle multi-file projects via Merlin integration, produce stable Coq code without generated variable names for proof maintenance, and support incremental verification akin to test suites after code changes.
Formal verification for OCaml, with Rocq
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Successfully applied to verify 100,000 lines of OCaml in Tezos, covering 80% of files, demonstrating its capability for extensive codebases.
Generates Coq code without synthetic variable names, ensuring that proofs remain maintainable and less prone to breakage over time.
Integrates with Merlin to handle multi-file dependencies, making it practical for real-world OCaml projects with complex structures.
Allows re-running translations after code changes to keep proofs up-to-date, similar to continuous integration for tests.
Only supports purely functional and monadic OCaml code; side-effects outside monads and object-oriented features are explicitly unsupported, limiting its applicability.
Advanced OCaml features like GADTs and polymorphic variants have only partial support, with known issues such as axiom-free compilation still being worked on.
Requires a compiled OCaml project with Merlin configuration, which can add complexity for teams not already using compatible build systems like dune.