Abstract
Bidirectional transformations (BXs), programs with a forward transformation and a backward transformation that maintain consistency between input and output, are routinely written in ways that do not let programmers specify their behavior completely. Several bidirectional programming languages exist to aid programmers in writing BXs with increased maintainability but decreased expressiveness. Such languages allow programmers to write BXs as one program for both directions, which is easier to maintain than separate programs for each direction. However, the maintainability provided by existing bidirectional languages comes at the cost of expressiveness because the ambiguity of synchronization is solved by default strategies which are hidden from programmers. The programmers’ inability to influence synchronization strategies has led to the proposal of a vast number of approaches that consider tailor-made synchronization strategies for particular applications. In this paper, we argue that such ambiguity is essential for BX and advocate that the synchronization strategy should not be hidden from programmers but considered from the start. We propose a novel approach to specifying so-called well-behaved bidirectional programs by their backward transformations, capable of expressing all aspects of a BX while retaining maintainability. Soundness of our approach results from a systematic analysis, based on existing mathematical concepts, of the instrumental laws of well-behaved BXs. We show that well-behaved BXs are uniquely determined by their backward transformations and corresponding forward transformations can be obtained for free.
摘要
创新点
双向变换在数据同步和软件进化等方面有着很多潜在的应用。 它包含两个变换: 一个是顺向变换, 从原数据得到一个视图; 另一个是逆向更新, 用视图更新原数据。 为了便于开发双向变换, 人们通过在顺向语言中增加逆向更新的语义方法设计出不少双向语言。 然而, 对于一个顺向语言来说逆向更新语义一般来说是不唯一的, 因此这样定义出来的双向语言行为不明确难以使用。 为了从根本上解决这个问题, 本文指出(1)双向变换的实质是逆向更新, (2)顺向变换可从逆向更新唯一导出, (3)双向变换语言的设计实质是逆向更新语言的设计。
Article PDF
Similar content being viewed by others
Avoid common mistakes on your manuscript.
References
Czarnecki K, Foster J N, Hu Z, et al. Bidirectional transformations: a cross-discipline perspective. Lect Notes Comput Sci, 2009, 5563: 260–283
Hu Z, Schürr A, Stevens P, et al. Dagstuhl seminar on bidirectional transformations (BX). IGMOD Rec, 2011. 40: 35–39
Bancilhon F, Spyratos N. Update semantics of relational views. ACM Trans Database Syst, 1981, 6: 557–575
Dayal U, Bernstein P. On the correct translation of update operations on relational views. ACM Trans Database Syst, 1982, 7: 381–416
Gottlob G, Paolini P, Zicari R. Properties and update semantics of consistent views. ACM Trans Database Syst, 1988, 13: 486–524
Foster J N, Greenwald M B, Moore J T, et al. Combinators for bidirectional tree transformations: a linguistic approach to the view-update problem. ACM Trans Program Lang Syst, 2007, 29: 17
Hu Z, Mu S C, Takeichi M. A programmable editor for developing structured documents based on bidirectional transformations. Higher-Order Symb Comput, 2008. 21: 89–118
Lämmel R. Coupled software transformations (extended abstract). In: Proceedings of 1st International Workshop on Software Evolution Transformations, Delft, 2004. 31–35
Hidaka S, Hu Z, Inaba K, et al. Bidirectionalizing graph transformations. In: Proceedings of 15th ACM SIGPLAN International Conference on Functional Programming, Baltimore, 2010. 205–216
Keller A. Choosing a view update translator by dialog at view definition time. In: Proceedings of the 12th International Conference on Very Large Databases, Kyoto, 1986. 467–474
Larson J A, Sheth A P. Updating relational views using knowledge at view definition and view update time. Inf Syst, 1991, 16: 145–168
Matsuda K, Hu Z, Nakano K, et al. Bidirectionalization transformation based on automatic derivation of view complement functions. In: Proceedings of 12th ACM SIGPLAN International Conference on Functional Programming, Freiburg, 2007. 47–58
Voigtländer J. Bidirectionalization for free! (pearl). In: Proceedings of 36th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Savannah, 2009. 165–176
Xiong Y, Liu D, Hu Z, et al. Towards automatic model synchronization from model transformations. In: Proceedings of ASE 2007, Atlanta, 2007. 164–173
Bohannon A, Foster J N, Pierce B C, et al. Boomerang: resourceful lenses for string data. In: Proceedings of 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Francisco, 2008. 407–419
Bohannon A, Pierce B C, Vaughan J A. Relational lenses: a language for updatable views. In: Proceedings of 25th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, Chicago, 2006. 338–347
Hofmann M, Pierce B C, Wagner D. Symmetric lenses. In: Proceedings of 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Austin, 2011. 371–384
Hofmann M, Pierce B C, Wagner D. Edit lenses. In: Proceedings of 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Philadelphia, 2012. 495–508
Pacheco H, Cunha A. Generic point-free lenses. Lect Notes Comput Sci, 2010, 6120: 331–352
Pacheco H, Cunha A, Hu Z. Delta lenses over inductive types. Electron Commun EASST, 2012, 49: 2
Buneman P, Cheney J, Vansummeren S. On the expressiveness of implicit provenance in query and update languages. ACM Trans Database Syst, 2008, 33: 28
Barbosa D M J, Cretin J, Foster J N, et al. Matching lenses: alignment and view update. In: Proceedings of 15th ACM SIGPLAN International Conference on Functional Programming, Baltimore, 2010. 193–204
Hanus M. Curry: an Integrated Functional Logic Language (vers. 0.8.3). Technical Report, Keil University, 2012
Foster J N. Bidirectional Programming Languages. Dissertation for the Doctoral Degree. University of Pennsylvania, 2009
Pacheco H. Bidirectional Data Transformation by Calculation. Dissertation for the Doctoral Degree. University of Minho, 2012
Fischer S, Hu Z, Pacheco H. “Putback” is the Essence of Bidirectional Programming. GRACE Technical Report 2012-08, National Institute of Informatics, 2012
Pacheco H, Hu Z, Fischer S. Monadic combinators for “putback” style bidirectional programming. In: Proceedings of PEPM 2014, San Diego, 2014. 39–50
Pacheco H, Zan T, Hu Z. BiFluX: a bidirectional functional update language for XML. In: Proceedings of 16th International Symposium on Principles and Practice of Declarative Programming, Canterbury, 2014
Hu Z, Pacheco H, Fischer S. Validity checking of putback transformations in bidirectional programming. Lect Notes Comput Sci, 2014, 8442: 1–15
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Fischer, S., Hu, Z. & Pacheco, H. The essence of bidirectional programming. Sci. China Inf. Sci. 58, 1–21 (2015). https://doi.org/10.1007/s11432-015-5316-8
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11432-015-5316-8