ABSTRACT
Computing is full of situations where two different structures must be "connected" in such a way that updates to each can be propagated to the other. This is a generalization of the classical view update problem, which has been studied for decades in the database community [11, 2, 22]; more recently, related problems have attracted considerable interest in other areas, including programming languages [42, 28, 34, 39, 4, 7, 33, 16, 1, 37, 35, 47, 49] software model transformation [43, 50, 44, 45, 12, 13, 14, 24, 25, 10, 51], user interfaces [38] and system configuration [36]. See [18, 17, 10, 30] for recent surveys.
Among the fruits of this cross-pollination has been the development of a linguistic perspective on the problem. Rather than taking some view definition language as fixed (e.g., choosing some subset of relational algebra) and looking for tractable ways of "inverting" view definitions to propagate updates from view to source [9], we can directly design new bidirectional programming languages in which every expression defines a pair of functions mapping updates on one structure to updates on the other. Such structures are often called lenses [18].
The foundational theory of lenses has been studied extensively [20, 47, 26, 32, 48, 40, 15, 31, 46, 41, 21, 27], and lens-based language designs have been developed in several domains, including strings [5, 19, 3, 36], trees [18, 28, 39, 35, 29], relations [6], graphs [23], and software models [43, 50, 44, 12, 13, 14, 24, 25, 8]. These languages share some common elements with modern functional languages---in particular, they come with very expressive type systems. In other respects, they are rather novel and surprising.
This tutorial surveys recent developments in the theory of lenses and the practice of bidirectional programming languages.
- A. Alimarine, S. Smetsers, A. van Weelden, M. van Eekelen, and R. Plasmeijer. There and back again: Arrows for invertible programming. In ACM SIGPLAN Workshop on Haskell, pages 86--97, 2005. Google Scholar
Digital Library
- F. Bancilhon and N. Spyratos. Update semantics of relational views. ACM Transactions on Database Systems, 6(4):557--575, Dec. 1981. Google Scholar
Digital Library
- D. M. J. Barbosa, J. Cretin, N. Foster, M. Greenberg, and B. C. Pierce. Matching lenses: Alignment and view update. In ACM SIGPLAN International Conference on Functional Programming (ICFP), Baltimore, Maryland, Sept. 2010. Google Scholar
Digital Library
- N. Benton. Embedded interpreters. Journal of Functional Programming, 15(4):503--542, 2005. Google Scholar
Digital Library
- A. Bohannon, J. N. Foster, B. C. Pierce, A. Pilkiewicz, and A. Schmitt. Boomerang: Resourceful lenses for string data. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), San Francisco, California, Jan. 2008. Google Scholar
Digital Library
- A. Bohannon, J. A. Vaughan, and B. C. Pierce. Relational lenses: A language for updateable views. In Principles of Database Systems (PODS), 2006. Extended version available as University of Pennsylvania technical report MS-CIS-05-27. Google Scholar
Digital Library
- C. Brabrand, A. Møller, and M. I. Schwartzbach. Dual syntax for XML languages. Information Systems, 2007. To appear. Extended abstract in Database Programming Languages (DBPL) 2005. Google Scholar
Digital Library
- J. Bradfield and P. Stevens. Recursive checkonly QVT-R transformations with general when and where clauses via the modal mu calculus. In 15th International Conference on Fundamental Approaches to Software Engineering (FASE), 2012. Google Scholar
Digital Library
- P. Buneman, S. Khanna, and W.-C. Tan. On propagation of deletions and annotations through views. In ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, Madison, Wisconsin, pages 150--158, 2002. Google Scholar
Digital Library
- K. Czarnecki, J. N. Foster, Z. Hu, R. Lämmel, A. Schürr, and J. F. Terwilliger. Bidirectional transformations: A cross-discipline perspective. In R. F. Paige, editor, ICMT, volume 5563 of Lecture Notes in Computer Science, pages 260--283. Springer, 2009. Google Scholar
Digital Library
- U. Dayal and P. A. Bernstein. On the correct translation of update operations on relational views. TODS, 7(3):381--416, September 1982. Google Scholar
Digital Library
- Z. Diskin. Algebraic models for bidirectional model synchronization. In K. Czarnecki, I. Ober, J.-M. Bruel, A. Uhl, and M. Völter, editors, MoDELS, volume 5301 of Lecture Notes in Computer Science, pages 21--36. Springer, 2008. Google Scholar
Digital Library
- Z. Diskin. Algebraic models for bidirectional model synchronization. In Model Driven Engineering Languages and Systems, 11th International Conference, MoDELS, pages 21--36. Springer, 2008. Google Scholar
Digital Library
- Z. Diskin, K. Czarnecki, and M. Antkiewicz. Model-versioning-in-the-large: algebraic foundations and the tile notation. In Proceedings of the 2009 ICSE Workshop on Comparison and Versioning of Software Models, pages 7--12. IEEE Computer Society, 2009. Google Scholar
Digital Library
- Z. Diskin, Y. Xiong, K. Czarnecki, H. Ehrig, F. Hermann, and F. Orejas. From state- to delta-based bidirectional model transformations: The symmetric case. Technical Report GSDLAB-TR 2011-05-03, University of Waterloo, May 2011.Google Scholar
Cross Ref
- K. Fisher and R. Gruber. PADS: a domain-specific language for processing ad hoc data. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Chicago, IL, pages 295--304, 2005. Google Scholar
Digital Library
- J. N. Foster. Bidirectional Programming Languages. PhD thesis, University of Pennsylvania, Dec. 2009. Google Scholar
Digital Library
- J. N. Foster, M. B. Greenwald, J. T. Moore, B. C. Pierce, and A. Schmitt. Combinators for bi-directional tree transformations: A linguistic approach to the view update problem. ACM Transactions on Programming Languages and Systems, 29(3):17, May 2007. Extended abstract in Principles of Programming Languages (POPL), 2005. Google Scholar
Digital Library
- J. N. Foster, B. C. Pierce, and S. Zdancewic. Updatable security views. In IEEE Computer Security Foundations Symposium (CSF), Port Jefferson, NY, July 2009. Google Scholar
Digital Library
- J. N. Foster, A. Pilkiewicz, and B. C. Pierce. Quotient lenses. In ACM SIGPLAN International Conference on Functional Programming (ICFP), Victoria, Canada, Sept. 2008. Google Scholar
Digital Library
- J. Gibbons and M. Johnson. Relating algebraic and coalgebraic descriptions of lenses. In First International Workshop on Bidirectional Transformations (BX 2012), March 2012.Google Scholar
- G. Gottlob, P. Paolini, and R. Zicari. Properties and update semantics of consistent views. ACM Transactions on Database Systems (TODS), 13(4):486--524, 1988. Google Scholar
Digital Library
- S. Hidaka, Z. Hu, K. Inaba, H. Kato, K. Matsuda, and K. Nakano. Bidirectionalizing graph transformations. In ACM SIGPLAN International Conference on Functional Programming (ICFP), Baltimore, Maryland, Sept. 2010. Google Scholar
Digital Library
- S. Hidaka, Z. Hu, H. Kato, and K. Nakano. A compositional approach to bidirectional model transformation. In New Ideas and Emerging Results Track of 31st International Conference on Software Engineering (ICSE 2009, NIER Track), 2009.Google Scholar
Cross Ref
- S. Hidaka, Z. Hu, H. Kato, and K. Nakano. Towards a compositional approach to model transformation for software development. In Proceedings of the 2009 ACM symposium on Applied Computing, pages 468--475. ACM New York, NY, USA, 2009. Google Scholar
Digital Library
- M. Hofmann, B. C. Pierce, and D. Wagner. Symmetric lenses. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), Austin, Texas, Jan. 2011. Google Scholar
Digital Library
- M. Hofmann, B. C. Pierce, and D. Wagner. Edit lenses. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), Philadelphia, Pennsylvania, Jan. 2012. Google Scholar
Digital Library
- Z. Hu, S.-C. Mu, and M. Takeichi. A programmable editor for developing structured documents based on bi-directional transformations. In Partial Evaluation and Program Manipulation (PEPM), pages 178--189, 2004. Extended version in Higher Order and Symbolic Computation, Volume 21, Issue 1--2, June 2008. Google Scholar
Digital Library
- Z. Hu, S.-C. Mu, and M. Takeichi. A programmable editor for developing structured documents based on bidirectional transformations. Higher-Order and Symbolic Computation, 21(1--2), June 2008. Short version in PEPM '04. Google Scholar
Digital Library
- Z. Hu, A. Schürr, P. Stevens, and J. F. Terwilliger. Dagstuhl seminar on bidirectional transformations (bx). SIGMOD Record, 40(1):35--39, 2011. Google Scholar
Digital Library
- M. Johnson, R. Rosebrugh, and R. Wood. Lenses, fibrations, and universal translations. Mathematical Structures in Computer Science, 22:25--42, 2012. Google Scholar
Digital Library
- M. Johnson, R. D. Rosebrugh, and R. Wood. Algebras and Update Strategies. Journal of Universal Computer Science, 16:729--748, 2010.Google Scholar
- S. Kawanaka and H. Hosoya. bixid: a bidirectional transformation language for XML. In ACM SIGPLAN International Conference on Functional Programming (ICFP), Portland, Oregon, pages 201--214, 2006. Google Scholar
Digital Library
- A. J. Kennedy. Functional pearl: Pickler combinators. Journal of Functional Programming, 14(6):727--739, 2004. Google Scholar
Digital Library
- D. Liu, Z. Hu, and M. Takeichi. Bidirectional interpretation of xquery. In ACM SIGPLAN Symposium on Partial Evaluation and Semantics-based Program Manipulation (PEPM), Nice, France, pages 21--30, New York, NY, USA, 2007. Google Scholar
Digital Library
- D. Lutterkort. Augeas: A Linux configuration API, Feb. 2007. Available from http://augeas.net/.Google Scholar
- K. Matsuda, Z. Hu, K. Nakano, M. Hamana, and M. Takeichi. Bidirectionalization transformation based on automatic derivation of view complement functions. In ACM SIGPLAN International Conference on Functional Programming (ICFP), pages 47--58. ACM Press New York, NY, USA, 2007. Google Scholar
Digital Library
- L. Meertens. Designing constraint maintainers for user interaction, 1998. Manuscript.Google Scholar
- S.-C. Mu, Z. Hu, and M. Takeichi. An algebraic approach to bi-directional updating. In ASIAN Symposium on Programming Languages and Systems (APLAS), pages 2--20, Nov. 2004.Google Scholar
Cross Ref
- R. O'Connor. Functor is to lens as applicative is to biplate: Introducing multiplate. CoRR, abs/1103.2841, 2011.Google Scholar
- H. Pacheco, A. Cunha, and Z. Hu. Delta lenses over inductive types. In First International Workshop on Bidirectional Transformations (BX), 2012.Google Scholar
- N. Ramsey. Embedding an interpreted language using higher-order functions and types. In ACM SIGPLAN Workshop on Interpreters, Virtual Machines and Emulators (IVME), San Diego, CA, pages 6--14, 2003. Google Scholar
Digital Library
- P. Stevens. Bidirectional model transformations in QVT: Semantic issues and open questions. In International Conference on Model Driven Engineering Languages and Systems (MoDELS), Nashville, TN, volume 4735 of Lecture Notes in Computer Science, pages 1--15. Springer-Verlag, 2007. Google Scholar
Digital Library
- P. Stevens. A landscape of bidirectional model transformations. Postproceedings of GTTSE, 7, 2008. Google Scholar
Digital Library
- P. Stevens. Towards an algebraic theory of bidirectional transformations. In Graph Transformations: 4th International Conference, Icgt 2008, Leicester, United Kingdom, September 7--13, 2008, Proceedings, page 1. Springer, 2008. Google Scholar
Digital Library
- P. Stevens. Observations relating to the equivalences induced on model sets by bidirectional transformations. In F. Hermann and J. Voigtländer, editors, Proceedings of the First International Workshop on Bidirectional Transformations (BX 2012), 2012. Electronic Communications of the EASST, Volume X.Google Scholar
- J. Voigtländer. Bidirectionalization for free! (Pearl). In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), Savannah, Georgia, 2009. Google Scholar
Digital Library
- J. Voigtländer, Z. Hu, K. Matsuda, and M. Wang. Combining syntactic and semantic bidirectionalization. In P. Hudak and S. Weirich, editors, ICFP, pages 181--192. ACM, 2010. Google Scholar
Digital Library
- M. Wang, J. Gibbons, and N. Wu. Incremental updates for efficient bidirectional transformations. In M. M. T. Chakravarty, Z. Hu, and O. Danvy, editors, ICFP, pages 392--403. ACM, 2011. Google Scholar
Digital Library
- Y. Xiong, D. Liu, Z. Hu, H. Zhao, M. Takeichi, and H. Mei. Towards automatic model synchronization from model transformations. In IEEE/ACM International Conference on Automated Software Engineering (ASE), Atlanta, GA, pages 164--173, 2007. Google Scholar
Digital Library
- Y. Yu, Y. Lin, Z. Hu, S. Hidaka, H. Kato, and L. Montrieux. blinkit: Maintaining invariant traceability through bidirectional transformations. In 34th International Conference on Software Engineering (ICSE), 2012. Google Scholar
Digital Library
Index Terms
Linguistic foundations for bidirectional transformations: invited tutorial
Recommendations
Monadic combinators for "Putback" style bidirectional programming
PEPM '14: Proceedings of the ACM SIGPLAN 2014 Workshop on Partial Evaluation and Program ManipulationBidirectional transformations, in particular lenses, are programs with a forward get transformation and a backward putback transformation that keep source and view data types synchronized. Several bidirectional programming languages exist to aid ...
Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem
Special issue on POPL 2005We 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 ...
Applicative bidirectional programming with lenses
ICFP '15A 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. One way to reduce the development and maintenance ...






Comments