TY - JOUR
T1 - Formal Semantics and Program Logics for a Fragment of OCaml
AU - Seassau, Remy
AU - Yoon, Irene
AU - Madiot, Jean Marie
AU - Pottier, François
N1 - Publisher Copyright:
© 2025 Copyright held by the owner/author(s).
PY - 2025/8/5
Y1 - 2025/8/5
N2 - This paper makes a first step towards a formal definition of OCaml and a foundational program verification environment for OCaml. We present a formal definition of OLang, a nontrivial sequential fragment of OCaml, which includes first-class functions, ordinary and extensible algebraic data types, pattern matching, references, exceptions, and effect handlers. We define the dynamic semantics of OLang as a monadic interpreter. This interpreter runs atop a custom monad where computations are internally represented as trees of operations and equipped with a small-step semantics. We define two program logics for OLang. A stateless Hoare Logic allows reasoning about so-called “pure” programs; an Iris-based Separation Logic allows reasoning about arbitrary programs. We present the construction of the two logics as well as some examples of their use.
AB - This paper makes a first step towards a formal definition of OCaml and a foundational program verification environment for OCaml. We present a formal definition of OLang, a nontrivial sequential fragment of OCaml, which includes first-class functions, ordinary and extensible algebraic data types, pattern matching, references, exceptions, and effect handlers. We define the dynamic semantics of OLang as a monadic interpreter. This interpreter runs atop a custom monad where computations are internally represented as trees of operations and equipped with a small-step semantics. We define two program logics for OLang. A stateless Hoare Logic allows reasoning about so-called “pure” programs; an Iris-based Separation Logic allows reasoning about arbitrary programs. We present the construction of the two logics as well as some examples of their use.
KW - monadic interpreters
KW - operational semantics
KW - separation logic
UR - https://www.scopus.com/pages/publications/105012539543
U2 - 10.1145/3747509
DO - 10.1145/3747509
M3 - Article
AN - SCOPUS:105012539543
SN - 2475-1421
VL - 9
SP - 128
EP - 159
JO - Proceedings of the ACM on Programming Languages
JF - Proceedings of the ACM on Programming Languages
IS - ICFP
ER -