Calculating with lenses: optimising bidirectional transformations

This paper presents an equational calculus to reason about bidirectional transformations specified in the point-free style. In particular, it focuses on the so-called lenses as a bidirectional idiom, and shows that many standard laws characterising point-free combinators and recursion patterns are also valid in that setting. A key result is that uniqueness also holds for bidirectional folds and unfolds, thus unleashing the power of fusion as a program optimisation technique. A rewriting system for automatic lens optimisation is also presented, to prove the usefulness of the proposed calculus.

[1]  Koen Claessen,et al.  QuickCheck: a lightweight tool for random testing of Haskell programs , 2011, SIGP.

[2]  Ralf Lämmel,et al.  Typed generic traversal with term rewriting strategies , 2002, J. Log. Algebraic Methods Program..

[3]  Simon Peyton Jones,et al.  Towards open type functions for Haskell , 2007 .

[4]  Dongxi Liu,et al.  Bidirectional interpretation of XQuery , 2007, PEPM '07.

[5]  Tobias Nipkow,et al.  Term rewriting and all that , 1998 .

[6]  Joost Visser,et al.  Coupled schema transformation and data conversion for XML and SQL , 2007 .

[7]  Simon Peyton Jones,et al.  Playing by the rules: rewriting as a practical optimisation technique in GHC , 2001 .

[8]  Kazutaka Matsuda,et al.  Bidirectionalizing graph transformations , 2010, ICFP '10.

[9]  S-C. Mu,et al.  An algebraic approach to bidirectional updating , 2004 .

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

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

[13]  Joost Visser,et al.  Transformation of structure-shy programs with application to XPath queries and strategic functions , 2011, Sci. Comput. Program..

[14]  José Nuno Oliveira,et al.  Type-Safe Two-Level Data Transformation , 2006, FM.

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

[16]  Simon L. Peyton Jones,et al.  Simple unification-based type inference for GADTs , 2006, ICFP '06.

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

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

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

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

[21]  Benjamin C. Pierce,et al.  Relational lenses: a language for updatable views , 2006, PODS '06.

[22]  Tim Sheard,et al.  A fold for all seasons , 1993, FPCA '93.

[23]  Alcino Cunha,et al.  Generic Point-free Lenses , 2010, MPC.

[24]  Zinovy Diskin,et al.  Algebraic Models for Bidirectional Model Synchronization , 2008, MoDELS.

[25]  Joost Visser,et al.  Strongly Typed Rewriting For Coupled Software Transformation , 2007, Electron. Notes Theor. Comput. Sci..

[26]  Soichiro Hidaka,et al.  Towards a compositional approach to model transformation for software development , 2009, SAC '09.

[27]  Alcino Cunha,et al.  Algebraic Specialization of Generic Functions for Recursive Types , 2011, Electron. Notes Theor. Comput. Sci..

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

[29]  Shin-Cheng Mu,et al.  An Algebraic Approach to Bi-directional Updating , 2004, APLAS.

[30]  Alexander Egyed Automated abstraction of class diagrams , 2002, TSEM.

[31]  Jorge Sousa Pinto,et al.  Point-free Program Transformation , 2005, Fundam. Informaticae.