Synthesizing Formal Semantics from Executable Interpreters (Video, OOPSLA 2024)
Jiangyi Liu, Charlie Murphy, Anvay Grover, Keith J.C. Johnson, Thomas Reps, and Loris D’Antoni
(University of Wisconsin-Madison, USA; University of Wisconsin-Madison, USA; University of Wisconsin-Madison, USA; University of Wisconsin-Madison, USA; University of Wisconsin-Madison, USA; University of California at San Diego, USA)
Abstract: Program verification and synthesis frameworks that allow one to customize the language in which one is interested typically require the user to provide a formally defined semantics for the language.
Because writing a formal semantics can be a daunting and error-prone task, this requirement stands in the way of such frameworks being adopted by non-expert users.
We present an algorithm that can automatically synthesize inductively defined syntax-directed semantics when given (i) a grammar describing the syntax of a language and (ii) an executable (closed-box) interpreter for computing the semantics of programs in the language of the grammar.
Our algorithm synthesizes the semantics in the form of Constrained-Horn Clauses (CHCs), a natural, extensible, and formal logical framework for specifying inductively defined relations that has recently received widespread adoption in program verification and synthesis.
The key innovation of our synthesis algorithm is a Counterexample-Guided Synthesis (CEGIS) approach that breaks the hard problem of synthesizing a set of constrained Horn clauses into small, tractable expression-synthesis problems that can be dispatched to existing SyGuS synthesizers.
Our tool Synantic synthesized inductively-defined formal semantics from 14 interpreters for languages used in program-synthesis applications.
When synthesizing formal semantics for one of our benchmarks, Synantic unveiled an inconsistency in the semantics computed by the interpreter for a language of regular expressions; fixing the inconsistency resulted in a more efficient semantics and, for some cases, in a 1.2x speedup for a synthesizer solving synthesis problems over such a language.
Article: https://doi.org/10.1145/3689724
Supplementary archive: https://doi.org/10.5281/zenodo.13368062 (Badges: Artifacts Available, Artifacts Evaluated — Functional, Results Reproduced)
ORCID: https://orcid.org/0000-0001-6525-4659, https://orcid.org/0000-0003-4813-7578, https://orcid.org/0009-0003-4820-3560, https://orcid.org/0000-0002-3766-5204, https://orcid.org/0000-0002-5676-9949, https://orcid.org/0000-0001-9625-4037
Video Tags: SemGuS, SyGuS, Semantics, SMT, Program Synthesis, oopslab24main-p208-p, doi:10.1145/3689724, doi:10.5281/zenodo.13368062, orcid:0000-0001-6525-4659, orcid:0000-0003-4813-7578, orcid:0009-0003-4820-3560, orcid:0000-0002-3766-5204, orcid:0000-0002-5676-9949, orcid:0000-0001-9625-4037, Artifacts Available, Artifacts Evaluated — Functional, Results Reproduced
Presentation at the OOPSLA 2024 conference, October 20–25, 2024, https://2024.splashcon.org/track/spla...
Sponsored by ACM SIGPLAN,
Информация по комментариям в разработке