@article{cohen:2024:why3, author = {Cohen, Joshua M. and Johnson-Freyd, Philip}, title = {A Formalization of Core Why3 in Coq}, year = {2024}, issue_date = {January 2024}, publisher = {Association for Computing Machinery}, address = {New York, NY, USA}, volume = {8}, number = {POPL}, url = {https://doi.org/10.1145/3632902}, doi = {10.1145/3632902}, abstract = {Intermediate verification languages like Why3 and Boogie have made it much easier to build program verifiers, transforming the process into a logic compilation problem rather than a proof automation one. Why3 in particular implements a rich logic for program specification with polymorphism, algebraic data types, recursive functions and predicates, and inductive predicates; it translates this logic to over a dozen solvers and proof assistants. Accordingly, it serves as a backend for many tools, including Frama-C, EasyCrypt, and GNATProve for Ada SPARK. But how can we be sure that these tools are correct? The alternate foundational approach, taken by tools like VST and CakeML, provides strong guarantees by implementing the entire toolchain in a proof assistant, but these tools are harder to build and cannot directly take advantage of SMT solver automation. As a first step toward enabling automated tools with similar foundational guarantees, we give a formal semantics in Coq for the logic fragment of Why3. We show that our semantics are useful by giving a correct-by-construction natural deduction proof system for this logic, using this proof system to verify parts of Why3's standard library, and proving sound two of Why3's transformations used to convert terms and formulas into the simpler logics supported by the backend solvers.}, journal = {Proceedings of the ACM on Programming Languages}, month = jan, articleno = {60}, numpages = {30}, keywords = {Coq, First-Order Logic, Formal Semantics, Why3} }