Affiliation:
1. University of Pennsylvania, USA
2. Princeton University, USA
3. Tufts University, USA
Abstract
Quotient lenses
are bidirectional transformations whose correctness laws are “loosened” by specified equivalence relations, allowing inessential details in concrete data formats to be suppressed. For example, a programmer could use a quotient lens to define a transformation that ignores the order of fields in XML data, so that two XML files with the same fields but in different orders would be considered the same, allowing a single, simple program to handle them both. Building on a recently published algorithm for synthesizing plain bijective lenses from high-level specifications, we show how to synthesize bijective quotient lenses in three steps. First, we introduce
quotient regular expressions
(QREs), annotated regular expressions that conveniently mark inessential aspects of string data formats; each QRE specifies, simulteneously, a regular language and an equivalence relation on it. Second, we introduce
QRE lenses
, i.e., lenses mapping between QREs. Our key technical result is a proof that every QRE lens can be transformed into a functionally equivalent lens that canonizes source and target data just at the “edges” and that uses a bijective lens to map between the respective canonical elements; no internal canonization occurs in a lens in this normal form. Third, we leverage this normalization theorem to
synthesize
QRE lenses from a pair of QREs and example input-output pairs, reusing earlier work on synthesizing plain bijective lenses. We have implemented QREs and QRE lens synthesis as an extension to the bidirectional programming language Boomerang. We evaluate the effectiveness of our approach by synthesizing QRE lenses between various real-world data formats in the Optician benchmark suite.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference27 articles.
1. Lennart Augustsson. 2004. {Haskell} Announcing Djinn version 2004-12-11 a coding wizard. Mailing List. http: //www.haskell.org/pipermail/haskell/2005-December/017055.html . Lennart Augustsson. 2004. {Haskell} Announcing Djinn version 2004-12-11 a coding wizard. Mailing List. http: //www.haskell.org/pipermail/haskell/2005-December/017055.html .
2. Boomerang
3. Dual syntax for XML languages
4. FLUX
5. The Essence of Form Abstraction
Cited by
7 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Synbit: synthesizing bidirectional programs using unidirectional sketches;Formal Methods in System Design;2022-12
2. Towards Automatic Synthesis of View Update Programs on Relations;Communications in Computer and Information Science;2022
3. Synbit: synthesizing bidirectional programs using unidirectional sketches;Proceedings of the ACM on Programming Languages;2021-10-20
4. Analogy-making as a Core primitive in the software engineering toolbox;Proceedings of the 2020 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software;2020-11-17
5. The Geometry of Syntax and Semantics for Directed File Transformations;2020 IEEE Security and Privacy Workshops (SPW);2020-05