Synthesis of Semantic Actions in Attribute Grammars

08/14/2022
by   Pankaj Kumar Kalita, et al.
0

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, PANINI, 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 PANINI scales well with the number of actions to be synthesized and the size of the context-free grammar, significantly outperforming simple baselines.

READ FULL TEXT

page 1

page 10

research
07/22/2018

Generating an ATL Model Checker using an Attribute Grammar

In this paper we present the attribute grammars as a formal approach for...
research
02/25/2023

Absynthe: Abstract Interpretation-Guided Synthesis

Synthesis tools have seen significant success in recent times. However, ...
research
08/24/2020

Semantic View Synthesis

We tackle a new problem of semantic view synthesis – generating free-vie...
research
01/25/2022

Semantic Code Classification for Automated Machine Learning

A range of applications for automatic machine learning need the generati...
research
05/20/2022

Neuro-Symbolic Regex Synthesis Framework via Neural Example Splitting

Due to the practical importance of regular expressions (regexes, for sho...
research
06/28/2016

Technical Report: Towards a Universal Code Formatter through Machine Learning

There are many declarative frameworks that allow us to implement code fo...

Please sign up or login with your details

Forgot password? Click here to reset