Combinators for bi-directional tree transformations: a linguistic approach to the view update problem

We propose a novel approach to the view-update problem for tree-structured data: a domain-specific programming language in which all expressions denote bidirectional transformations on trees. In one direction, these transformations---dubbed lenses---map a concrete tree into a simplified abstract view; in the other, they map a modified abstract view, together with the original concrete tree, to a correspondingly modified concrete tree. Our design emphasizes both robustness and ease of use, guaranteeing strong well-behavedness and totality properties for well-typed lenses. We begin by identifying a natural space of well-behaved bidirectional transformations over arbitrary structures, studying definedness and continuity in this setting. We then instantiate this semantic framework in the form of a collection of lens combinators that can be assembled to describe bidirectional transformations on trees. These combinators include familiar constructs from functional programming (composition, mapping, projection, conditionals, recursion) together with some novel primitives for manipulating trees (splitting, pruning, merging, etc.). We illustrate the expressiveness of these combinators by developing a number of bidirectional list-processing transformations as derived forms. An extended example shows how our combinators can be used to define a lens that translates between a native HTML representation of browser bookmarks and a generic abstract bookmark format.

[1]  Serge Abiteboul,et al.  Correspondence and translation for heterogeneous data , 1997, Theor. Comput. Sci..

[2]  Henry G. Baker,et al.  NREVERSAL of Fortune - The Thermodynamics of Garbage Collection , 1992, IWMM.

[3]  Keishi Tajima,et al.  A polymorphic calculus for views and object sharing (extended abstract) , 1994, PODS '94.

[4]  Paolo Atzeni,et al.  MDM: a multiple-data model tool for the management of heterogeneous database schemes , 1997, SIGMOD '97.

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

[6]  Serge Abiteboul,et al.  A logical view of structured files , 1998, The VLDB Journal.

[7]  Markus Tresch,et al.  Updatable Views in Object-Oriented Databases , 1991, DOOD.

[8]  H. J. Pels,et al.  An introduction to database systems, sixth edition , 1997 .

[9]  S. Boag,et al.  XQuery 1.0 : An XML query language, W3C Working Draft 12 November 2003 , 2003 .

[10]  Frank Wm. Tompa,et al.  Understanding the implications of view update policies , 1985, Algorithmica.

[11]  Georg Gottlob,et al.  Properties and update semantics of consistent views , 1988, TODS.

[12]  Shin-Cheng Mu,et al.  A programmable editor for developing structured documents based on bidirectional transformations , 2004, PEPM '04.

[13]  Serge Abiteboul,et al.  Correspondence and Translation for Heterogeneous Data , 1997, ICDT.

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

[15]  Shin-Cheng Mu,et al.  An Injective Language for Reversible Computation , 2004, MPC.

[16]  Serge Abiteboul,et al.  Incremental Maintenance for Materialized Views over Semistructured Data , 1998, VLDB.

[17]  Paolo Atzeni,et al.  Management of Multiple Models in an Extensible Database Design Tool , 1996, EDBT.

[18]  Umeshwar Dayal,et al.  On the correct translation of update operations on relational views , 1982, TODS.

[19]  Sharath Pankanti,et al.  Creating and Maintaining Databases , 2004 .

[20]  Susan B. Davidson,et al.  On the updatability of XML views over relational databases , 2003, WebDB.

[21]  Stéphane Bressan,et al.  Introduction to Database Systems , 2005 .

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

[23]  Lawrence A. Rowe,et al.  Data abstraction, views and updates in RIGEL , 1979, SIGMOD '79.

[24]  Gio Wiederhold,et al.  Updating relational databases through object-based views , 1991, SIGMOD '91.

[25]  Stephen J. Hegner,et al.  Foundations of Canonical Update Support for Closed Database Views , 1990, ICDT.

[26]  Laura M. Haas,et al.  The Clio project: managing heterogeneity , 2001, SGMD.

[27]  John McCarthy,et al.  The Inversion of Functions Defined by Turing Machines , 1956 .

[28]  Robert Glück,et al.  The Universal Resolving Algorithm: Inverse Computation in a Functional Language , 2000, MPC.

[29]  Robert Glück,et al.  Principles of Inverse Computation and the Universal Resolving Algorithm , 2002, The Essence of Computation.

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

[31]  Edsger W. Dijkstra,et al.  Program Inversion , 1978, Program Construction.

[32]  FosterJ. Nathan,et al.  Combinators for bi-directional tree transformations , 2005 .

[33]  Vanessa Braganholo,et al.  UPDATING RELATIONAL DATABASES THROUGH XML VIEWS , 2001 .

[34]  Glynn Winskel,et al.  The formal semantics of programming languages - an introduction , 1993, Foundation of computing series.

[35]  FosterJ. Nathan,et al.  Combinators for bidirectional tree transformations , 2007 .

[36]  Michael Johnson,et al.  View updates in a semantic data modelling paradigm , 2001, Proceedings 12th Australasian Database Conference. ADC 2001.

[37]  Joachim Niehren,et al.  Feature Automata and Recognizable Sets of Feature Trees , 1993, TAPSOFT.

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

[39]  Alon Y. Halevy,et al.  Updating XML , 2001, SIGMOD '01.

[40]  Charles H. Bennett,et al.  Logical reversibility of computation , 1973 .

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

[42]  Benjamin C. Pierce,et al.  What's in Unison? A Formal Specification and Reference Implementation of a File Synchronizer , 2004 .

[43]  Jens Lechtenbörger,et al.  The impact of the constant complement approach towards view updating , 2003, PODS.

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

[45]  Frank J. Oles,et al.  Type Algebras, Functor Categories, and Block Structure , 1986 .

[46]  S. Cosmadakis TRANSLATING UPDATES OF RELATIONAL DATA BASE VIEWS , 1983 .

[47]  Satoshi Matsuoka,et al.  A general framework for Bi-directional translation between abstract and pictorial data , 1991, UIST '91.

[48]  Yoshifumi Masunaga,et al.  A Relational Database View Update Translation Mechanism , 1984, VLDB.

[49]  Arthur M. Keller,et al.  Algorithms for translating view updates to database updates for views involving selections, projections, and joins , 1985, PODS.

[50]  Philip Wadler,et al.  Views: a way for pattern matching to cohabit with data abstraction , 1987, POPL '87.

[51]  Martin Hofmann,et al.  Positive subtyping , 1995, POPL '95.

[52]  R. Landauer,et al.  Irreversibility and heat generation in the computing process , 1961, IBM J. Res. Dev..

[53]  C. J. Date An introduction to database systems (7. ed.) , 1999 .

[54]  Satoshi Matsuoka,et al.  A general framework for bidirectional translation between abstract and pictorial data , 1992, TOIS.