Abstract
This paper surveys three distinct approaches to bidirectional programming. The first approach, syntactic bidirectionalization, takes a program describing the forward transformation as input and calculates a well-behaved reverse transformation. The second approach, semantic bidirectionalization, is similar, but takes the forward transformation itself as input rather than a program describing it. It requires the transformation to be a polymorphic function and uses parametricity and free theorems in the proof of well-behavedness. The third approach, based on bidirectional combinators, focuses on the use of types to ensure well-behavedness and special constructs for dealing with alignment problems. In presenting these approaches, we pay particular attention to use of complements, which are structures that represent the information discarded by the transformation in the forward direction.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Abbott, M., Altenkirch, T., Ghani, N.: Categories of Containers. In: Gordon, A.D. (ed.) FOSSACS 2003. LNCS, vol. 2620, pp. 23–38. Springer, Heidelberg (2003)
Bancilhon, F., Spyratos, N.: Update semantics of relational views. ACM Transactions on Database Systems 6(4), 557–575 (1981), doi:10.1145/319628.319634
Barbosa, D., Cretin, J., Foster, J.N., Greenberg, M., Pierce, B.: Matching lenses: Alignment and view update. In: Proceedings of International Conference on Functional Programming. SIGPLAN Notices, vol. 45(9), pp. 193–204. ACM (2010), doi:10.1145/1932681.1863572
Benton, N.: Embedded interpreters. Journal of Functional Programming 15(4), 503–542 (2005), doi:10.1017/S0956796804005398
Berdaguer, P., Cunha, A., Pacheco, H., Visser, J.: Coupled Schema Transformation and Data Conversion for XML and SQL. In: Hanus, M. (ed.) PADL 2007. LNCS, vol. 4354, pp. 290–304. Springer, Heidelberg (2006)
Bohannon, A., Vaughan, J., Pierce, B.: Relational lenses: A language for updateable views. In: Proceedings of Principles of Database Systems, pp. 338–347. ACM (2006), doi:10.1145/1142351.1142399
Bohannon, A., Foster, J., Pierce, B., Pilkiewicz, A., Schmitt, A.: Boomerang: Resourceful lenses for string data. In: Proceedings of Principles of Programming Languages. SIGPLAN Notices, vol. 43(1), pp. 407–419. ACM (2008), doi:10.1145/1328897.1328487
Brabrand, C., Møller, A., Schwartzbach, M.: Dual syntax for XML languages. Information Systems 33(4–5), 385–406 (2008), doi:10.1016/j.is.2008.01.006
Comon, H., Dauchet, M., Gilleron, R., Löding, C., Jacquemard, F., Lugiez, D., Tison, S., Tommasi, M.: Tree automata techniques and applications (2007), http://tata.gforge.inria.fr/ (release October 12, 2007)
Cosmadakis, S., Papadimitriou, C.: Updates of relational views. Journal of the ACM 31(4), 742–760 (1984), doi:10.1145/1634.1887
Cunha, J., Saraiva, J., Visser, J.: From spreadsheets to relational databases and back. In: Proceedings of Partial Evaluation and Program Manipulation, pp. 179–188. ACM (2009), doi:10.1145/1480945.1480972
Czarnecki, K., Foster, J.N., Hu, Z., Lämmel, R., Schürr, A., Terwilliger, J.F.: Bidirectional Transformations: A Cross-Discipline Perspective. In: Paige, R.F. (ed.) ICMT 2009. LNCS, vol. 5563, pp. 260–283. Springer, Heidelberg (2009)
Dayal, U., Bernstein, P.: On the correct translation of update operations on relational views. ACM Transactions on Database Systems 7(3), 381–416 (1982), doi:10.1145/319732.319740
Diskin, Z., Xiong, Y., Czarnecki, K.: From State- to Delta-Based Bidirectional Model Transformations. In: Tratt, L., Gogolla, M. (eds.) ICMT 2010. LNCS, vol. 6142, pp. 61–76. Springer, Heidelberg (2010)
Ennals, R., Gay, D.M.: Multi-language Synchronization. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 475–489. Springer, Heidelberg (2007)
Fegaras, L.: Propagating updates through XML views using lineage tracing. In: Proceedings of International Conference on Data Engineering, pp. 309–320. IEEE (2010), doi:10.1109/ICDE.2010.5447896
Fisher, K., Gruber, R.: PADS: A domain-specific language for processing ad hoc data. In: Proceedings of Programming Language Design and Implementation. SIGPLAN Notices, vol. 40(6), pp. 295–304. ACM (2005), doi:10.1145/1064978.1065046
Foster, J., Pierce, B.: Boomerang Programmer’s Manual (2009), http://www.seas.upenn.edu/~harmony/
Foster, J., Greenwald, M., Kirkegaard, C., Pierce, B., Schmitt, A.: Exploiting schemas in data synchronization. Journal of Computer and System Sciences 73(4), 669–689 (2007), doi:10.1016/j.jcss.2006.10.024
Foster, J., Greenwald, M., Moore, J., Pierce, B., Schmitt, A.: Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem. ACM Transactions on Programming Languages and Systems 29(3), 17 (2007), doi:10.1145/1232420.1232424
Foster, J., Pilkiewicz, A., Pierce, B.: Quotient lenses. In: Proceedings of International Conference on Functional Programming, vol. 43(9), pp. 383–395. ACM (2008), doi:10.1145/1411203.1411257
Foster, J., Pierce, B., Zdancewic, S.: Updatable security views. In: Proceedings of Computer Security Foundations, pp. 60–74. IEEE (2009), doi:10.1109/CSF.2009.25
Gibbons, J., Oliveira, B.: The essence of the iterator pattern. Journal of Functional Programming 19(3–4), 377–402 (2009), doi:10.1017/S0956796809007291
Hegner, S.: An order-based theory of updates for closed database views. Annals of Mathematics and Artificial Intelligence 40(1–2), 63–125 (2004), doi:10.1023/A:1026158013113
Hidaka, S., Hu, Z., Inaba, K., Kato, H., Matsuda, K., Nakano, K.: Bidirectionalizing graph transformations. In: Proceedings of International Conference on Functional Programming. SIGPLAN Notices, vol. 45(9), pp. 205–216. ACM (2010), doi:10.1145/1932681.1863573
Hofmann, M., Pierce, B., Wagner, D.: Symmetric lenses. In: Proceedings of Principles of Programming Languages. SIGPLAN Notices, vol. 46(1), pp. 371–384. ACM (2011), doi:10.1145/1925844.1926428
Hu, Z., Iwasaki, H., Takeichi, M., Takano, A.: Tupling calculation eliminates multiple data traversals. In: Proceedings of International Conference on Functional Programming. SIGPLAN Notices, vol. 32(8), pp. 164–175. ACM (1997), doi:10.1145/258949.258964
Hu, Z., Mu, S.-C., Takeichi, M.: A programmable editor for developing structured documents based on bidirectional transformations. Higher-Order and Symbolic Computation 21(1–2), 89–118 (2008), doi:10.1007/s10990-008-9025-5
Jay, C.: A semantics for shape. Science of Computer Programming 25(2–3), 251–283 (1995), doi:10.1016/0167-6423(95)00015-1
Jeuring, J., Leather, S., Pedro Magalhães, J., Rodriguez Yakushev, A.: Libraries for Generic Programming in Haskell. In: Koopman, P., Plasmeijer, R., Swierstra, D. (eds.) AFP 2008. LNCS, vol. 5832, pp. 165–229. Springer, Heidelberg (2009)
Kawanaka, S., Hosoya, H.: biXid: a bidirectional transformation language for XML. In: Proceedings of International Conference on Functional Programming. SIGPLAN Notices, vol. 41(9), pp. 201–214. ACM (2006), doi:10.1145/1160074.1159830
Laurent, D., Lechtenbörger, J., Spyratos, N., Vossen, G.: Monotonic complements for independent data warehouses. The VLDB Journal 10(4), 295–315 (2001), doi:10.1007/s007780100055
Lechtenbörger, J., Vossen, G.: On the computation of relational view complements. ACM Transactions on Database Systems 28(2), 175–208 (2003), doi:10.1145/777943.777946
Lutterkort, D.: Augeas—A configuration API. In: Proceedings of Linux Symposium, pp. 47–56 (2008)
Matsuda, K., Hu, Z., Nakano, K., Hamana, M., Takeichi, M.: Bidirectionalization transformation based on automatic derivation of view complement functions. In: Proceedings of International Conference on Functional Programming. SIGPLAN Notices, vol. 42(9), pp. 47–58. ACM (2007), doi:10.1145/1291220.1291162
Matsuda, K., Hu, Z., Takeichi, M.: Type-based specialization of XML transformations. In: Proceedings of Partial Evaluation and Program Manipulation, pp. 61–72. ACM (2009), doi:10.1145/1480945.1480955
Meertens, L.: Designing constraint maintainers for user interaction (1998), Manuscript, ftp://ftp.kestrel.edu/pub/papers/meertens/dcm.ps
Miller, R., Hernandez, M., Haas, L., Yan, L., Ho, C., Fagin, R., Popa, L.: The Clio project: Managing heterogeneity. SIGMOD Record 30(1), 78–83 (2001), doi:10.1145/373626.373713
Pacheco, H., Cunha, A.: Generic Point-free Lenses. In: Bolduc, C., Desharnais, J., Ktari, B. (eds.) MPC 2010. LNCS, vol. 6120, pp. 331–352. Springer, Heidelberg (2010)
Pacheco, H., Cunha, A.: Calculating with lenses: Optimising bidirectional transformations. In: Proceedings of Partial Evaluation and Program Manipulation, pp. 91–100. ACM (2011), doi:10.1145/1929501.1929520
Perumalla, K., Fujimoto, R.: Source-code transformations for efficient reversibility. Technical Report GIT-CC-99-21, College of Computing, Georgia Tech. (1999)
Ramsey, N.: Embedding an interpreted language using higher-order functions and types. In: Proceedings of Interpreters, Virtual Machines and Emulators, pp. 6–14. ACM (2003), doi:10.1145/858570.858571
Schürr, A.: Specification of Graph Translators with Triple Graph Grammars. In: Mayr, E.W., Schmidt, G., Tinhofer, G. (eds.) WG 1994. LNCS, vol. 903, pp. 151–163. Springer, Heidelberg (1995)
Stevens, P.: Bidirectional Model Transformations in QVT: Semantic Issues and Open Questions. In: Engels, G., Opdyke, B., Schmidt, D.C., Weil, F. (eds.) MODELS 2007. LNCS, vol. 4735, pp. 1–15. Springer, Heidelberg (2007)
Voigtländer, J.: Bidirectionalization for free! In: Proceedings of Principles of Programming Languages. SIGPLAN Notices, vol. 44(1), pp. 165–176. ACM (2009), doi:10.1145/1594834.1480904
Voigtländer, J., Hu, Z., Matsuda, K., Wang, M.: Combining syntactic and semantic bidirectionalization. In: Proceedings of International Conference on Functional Programming. SIGPLAN Notices, vol. 45(9), pp. 181–192. ACM (2010), doi:10.1145/1932681.1863571
Wadler, P.: Theorems for free! In: Proceedings of Functional Programming Languages and Computer Architecture, pp. 347–359. ACM (1989), doi:10.1145/99370.99404
Wadler, P.: Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science 73(2), 231–248 (1990), doi:10.1016/0304-3975(90)90147-A
Wang, M., Gibbons, J., Matsuda, K., Hu, Z.: Gradual Refinement: Blending Pattern Matching with Data Abstraction. In: Bolduc, C., Desharnais, J., Ktari, B. (eds.) MPC 2010. LNCS, vol. 6120, pp. 397–425. Springer, Heidelberg (2010)
Wang, M., Gibbons, J., Wu, N.: Incremental updates for efficient bidirectional transformations. In: Proceedings of International Conference on Functional Programming. SIGPLAN Notices, vol. 46(9), pp. 392–403. ACM (2011), doi:10.1145/2034574.2034825
Xiong, Y., Liu, D., Hu, Z., Zhao, H., Takeichi, M., Mei, H.: Towards automatic model synchronization from model transformations. In: Proceedings of Automated Software Engineering, pp. 164–173. ACM (2007), doi:10.1145/1321631.1321657
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Foster, N., Matsuda, K., Voigtländer, J. (2012). Three Complementary Approaches to Bidirectional Programming. In: Gibbons, J. (eds) Generic and Indexed Programming. Lecture Notes in Computer Science, vol 7470. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32202-0_1
Download citation
DOI: https://doi.org/10.1007/978-3-642-32202-0_1
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-32201-3
Online ISBN: 978-3-642-32202-0
eBook Packages: Computer ScienceComputer Science (R0)