Synthesis of Semantic Actions in Attribute Grammars

Attribute grammars allow the association of semantic actions to the production rules in context-free grammars, providing a simple yet effective formalism to define the semantics of a language. However, drafting the semantic actions can be tricky and a large drain on developer time. In this work, we...

Celý popis

Uložené v:
Podrobná bibliografia
Vydané v:2022 Formal Methods in Computer-Aided Design (FMCAD) s. 304 - 314
Hlavní autori: Kalita, Pankaj Kumar, Kumar, Miriyala Jeevan, Roy, Subhajit
Médium: Konferenčný príspevok..
Jazyk:English
Vydavateľské údaje: FMCAD Association and authors 18.10.2022
Predmet:
ISSN:2708-7824
On-line prístup:Získať plný text
Tagy: Pridať tag
Žiadne tagy, Buďte prvý, kto otaguje tento záznam!
Popis
Shrnutí:Attribute grammars allow the association of semantic actions to the production rules in context-free grammars, providing a simple yet effective formalism to define the semantics of a language. However, drafting the semantic actions can be tricky and a large drain on developer time. In this work, we propose a synthesis methodology to automatically infer the semantic actions from a set of examples associating strings to their meanings. We also propose a new coverage metric, derivation coverage. We use it to build a sampler to effectively and automatically draw strings to drive the synthesis engine. We build our ideas into our tool, PĀNINI, and empirically evaluate it on twelve benchmarks, including a forward differentiation engine, an interpreter over a subset of Java bytecode, and a mini-compiler for C language to two-address code. Our results show that PĀNINI scales well with the number of actions to be synthesized and the size of the context-free grammar, significantly outperforming simple baselines.
ISSN:2708-7824
DOI:10.34727/2022/isbn.978-3-85448-053-2_37