Semantic bidirectionalization revisited

A bidirectional transformation is a pair of mappings between source and view data objects, one in each direction. When the view is modified, the source is updated accordingly with respect to some laws. Over the years, a lot of effort has been made to offer better language support for programming such transformations, essentially allowing the programmers to construct one mapping of the pair and have the other automatically generated. As an alternative to creating specialized new languages, one can try to analyse and transform programs written in general purpose languages, and ``bidirectionalize" them. Among others, a technique termed as semantic bidirectionalization stands out in term of user-friendliness. The unidirectional program can be written using arbitrary language constructs, as long as the function is polymorphic and the language constructs respect parametricity. The free theorem that follows from the polymorphic type of the program allows a kind of forensic examination of the transformation, determining its effect without examining its implementation. This is convenient, in the sense that the programmer is not restricted to using a particular syntax; but it does require the transformation to be polymorphic. In this paper, we revisit the idea of semantic bidirectionalization and reveal the elegant principles behind the current state-of-the-art techniques. Guided by the findings, we derive much simpler implementations that scale easily.

[1]  Krzysztof Czarnecki,et al.  From State- to Delta-Based Bidirectional Model Transformations: the Asymmetric Case , 2011, J. Object Technol..

[2]  Martin Hofmann,et al.  Edit lenses , 2012, POPL '12.

[3]  Meng Wang,et al.  Bidirectionalization for free with runtime recording: or, a light-weight approach to the view-update problem , 2013, PPDP.

[4]  Peyton Jones,et al.  Haskell 98 language and libraries : the revised report , 2003 .

[5]  Nicolas Spyratos,et al.  Update semantics of relational views , 1981, TODS.

[6]  Meng Wang,et al.  Enhancing semantic bidirectionalization via shape bidirectionalizer plug-ins , 2013, J. Funct. Program..

[7]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[8]  Benjamin C. Pierce,et al.  Combinators for bi-directional tree transformations: a linguistic approach to the view update problem , 2005, POPL '05.

[9]  Perdita Stevens,et al.  Bidirectional model transformations in QVT: semantic issues and open questions , 2007, MODELS'07.

[10]  Benjamin C. Pierce,et al.  Boomerang: resourceful lenses for string data , 2008, POPL '08.

[11]  Benjamin C. Pierce,et al.  Quotient lenses , 2008, ICFP 2008.

[12]  Benjamin C. Pierce,et al.  Updatable Security Views , 2009, 2009 22nd IEEE Computer Security Foundations Symposium.

[13]  Benjamin C. Pierce,et al.  Matching lenses: alignment and view update , 2010, ICFP '10.

[14]  Ralf Lämmel,et al.  Bidirectional Transformations: A Cross-Discipline Perspective , 2009, ICMT@TOOLS.

[15]  Kazutaka Matsuda,et al.  Three Complementary Approaches to Bidirectional Programming , 2010, SSGIP.

[16]  Joseph E. Stoy Proceedings of the fourth international conference on Functional programming languages and computer architecture , 1989 .

[17]  Kazutaka Matsuda,et al.  Bidirectionalization transformation based on automatic derivation of view complement functions , 2007, ICFP '07.

[18]  Martin Hofmann,et al.  Symmetric lenses , 2011, POPL '11.

[19]  Meng Wang,et al.  Combining syntactic and semantic bidirectionalization , 2010, ICFP '10.

[20]  Janis Voigtländer Bidirectionalization for free! (Pearl) , 2009, POPL '09.

[21]  Meng Wang,et al.  Incremental updates for efficient bidirectional transformations , 2011, ICFP '11.