S<sub>YNTH</sub>BX: an Example-guided Synthesizer for Bidirectional Programs on Relations

Bach Nguyen Trong,Kanae Tsushima,Zhenjiang Hu
DOI: https://doi.org/10.2197/ipsjjip.32.471
2024-01-01
Journal of Information Processing
Abstract:Bidirectional transformations between different representations of related information appear frequently in many different areas like databases, software engineering, and programming languages. A bidirectional program expressing a bidirectional transformation includes a pair of programs - a get that defines a view over a source and a put that translates view updates to source updates - and provides strong guarantees about the well-behavedness of the get and the put. It is known to be challenging to develop bidirectional programs that are both well-behaved and practically useful. In this paper, we propose an approach to synthesizing well-behaved and practical bidirectional programs on relations from user-provided examples and data schemas. We start by synthesizing a get and decomposing it into a set of simple and atomic geta whose corresponding puta exists and thus reduce the synthesis of (get, put) into sub-synthesis of (geta, puta). Then, we solve each sub-synthesis task with a set of well-designed templates and combine all results to form the final bidirectional program. We have implemented our approach in a framework called SYNTHBX and evaluated it on a benchmark suite of 56 tasks from three sources. SYNTHBX successfully synthesizes well-behaved bidirectional programs for 52 tasks, with an average synthesis time of 19 seconds per task and within 3 seconds each for 37 of them, which shows practical usefulness of our approach.
What problem does this paper attempt to address?