Composing Least-change Lenses

Non-trivial bidirectional transformations (BXs) are inherently ambiguous, as there are in general many different ways to consistently translate an update from one side to the other. Existing BX languages and frameworks typically satisfy fundamental first principles which ensure acceptable and stable (well-behaved) translation. Unfortunately, these give little insight about how a particular update translation is chosen among the myriad possible. From the user perspective, such unpredictability may hinder the adoption of BX frameworks. The problem can be remedied by imposing a “principle of least change” which, in a state-based framework, amounts to translating each update in a way such that its result is as close as possible to the original state, according to some distance measure. Starting by formalizing such BXs focusing on the particular framework of lenses, this paper discusses whether such least-change lenses can be defined by composition, an essential construct of BX frameworks. For sequential composition, two (dual) update translation alternatives are presented: a classical deterministic one and a nondeterministic. A key ingredient of the approach is the elegant formalization of the main concepts in relation algebra, which exposes several similarities and dualities.

[1]  Hartmut Ehrig,et al.  Correctness of model synchronization based on triple graph grammars , 2011, MODELS'11.

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

[3]  Alcino Cunha,et al.  Relations as Executable Specifications: Taming Partiality and Non-determinism Using Invariants , 2012, RAMICS.

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

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

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

[7]  Lambert Meertens,et al.  Designing Constraint Maintainers for User Interaction , 1998 .

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

[9]  Antonio Cicchetti,et al.  JTL: A Bidirectional and Change Propagating Transformation Language , 2010, SLE.

[10]  Tobias Nipkow,et al.  Isabelle/HOL , 2002, Lecture Notes in Computer Science.

[11]  M. F.,et al.  Bibliography , 1985, Experimental Gerontology.

[12]  Benjamin C. Pierce,et al.  Bidirectional programming languages , 2009 .

[13]  Alcino Cunha,et al.  Implementing QVT-R Bidirectional Model Transformations Using Alloy , 2013, FASE.

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

[15]  Stephen J. Hegner,et al.  An Order-Based Theory of Updates for Closed Database Views , 2004, Annals of Mathematics and Artificial Intelligence.

[16]  Arthur M. Keller,et al.  Choosing a View Update Translator by Dialog at View Definition Time , 1986, VLDB.

[17]  Daniel Jackson,et al.  Software Abstractions - Logic, Language, and Analysis , 2006 .

[18]  Hugo Pacheco,et al.  Bidirectional data transformation by calculation , 2012 .

[19]  Jeffrey D. Ullman,et al.  On complementary and independent mappings on databases , 1984, SIGMOD '84.

[20]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

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

[22]  Michael Johnson,et al.  Algebras and Update Strategies , 2010, J. Univers. Comput. Sci..

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

[24]  Sanjeev Khanna,et al.  Edinburgh Research Explorer On the Propagation of Deletions and Annotations through Views , 2013 .

[25]  James A. Larson,et al.  Updating relational views using knowledge at view definition and view update time , 1991, Inf. Syst..