Skip to main content

Three Complementary Approaches to Bidirectional Programming

  • Chapter

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7470))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   49.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Chapter  Google Scholar 

  2. Bancilhon, F., Spyratos, N.: Update semantics of relational views. ACM Transactions on Database Systems 6(4), 557–575 (1981), doi:10.1145/319628.319634

    Article  MATH  Google Scholar 

  3. 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

    Google Scholar 

  4. Benton, N.: Embedded interpreters. Journal of Functional Programming 15(4), 503–542 (2005), doi:10.1017/S0956796804005398

    Article  MathSciNet  MATH  Google Scholar 

  5. 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)

    Chapter  Google Scholar 

  6. 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

    Google Scholar 

  7. 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

    Google Scholar 

  8. 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

    Article  Google Scholar 

  9. 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)

  10. Cosmadakis, S., Papadimitriou, C.: Updates of relational views. Journal of the ACM 31(4), 742–760 (1984), doi:10.1145/1634.1887

    Article  MathSciNet  MATH  Google Scholar 

  11. 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

    Google Scholar 

  12. 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)

    Chapter  Google Scholar 

  13. 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

    Article  MathSciNet  MATH  Google Scholar 

  14. 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)

    Chapter  Google Scholar 

  15. Ennals, R., Gay, D.M.: Multi-language Synchronization. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 475–489. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  16. 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

    Google Scholar 

  17. 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

    Google Scholar 

  18. Foster, J., Pierce, B.: Boomerang Programmer’s Manual (2009), http://www.seas.upenn.edu/~harmony/

  19. 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

    Article  MathSciNet  MATH  Google Scholar 

  20. 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

    Article  Google Scholar 

  21. 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

    Google Scholar 

  22. 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

    Google Scholar 

  23. Gibbons, J., Oliveira, B.: The essence of the iterator pattern. Journal of Functional Programming 19(3–4), 377–402 (2009), doi:10.1017/S0956796809007291

    Article  MathSciNet  MATH  Google Scholar 

  24. 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

    Article  MathSciNet  MATH  Google Scholar 

  25. 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

    Google Scholar 

  26. 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

    Google Scholar 

  27. 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

    Google Scholar 

  28. 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

    Article  MATH  Google Scholar 

  29. Jay, C.: A semantics for shape. Science of Computer Programming 25(2–3), 251–283 (1995), doi:10.1016/0167-6423(95)00015-1

    Article  MathSciNet  MATH  Google Scholar 

  30. 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)

    Chapter  Google Scholar 

  31. 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

    Google Scholar 

  32. 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

    Article  MATH  Google Scholar 

  33. 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

    Article  Google Scholar 

  34. Lutterkort, D.: Augeas—A configuration API. In: Proceedings of Linux Symposium, pp. 47–56 (2008)

    Google Scholar 

  35. 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

    Google Scholar 

  36. 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

    Google Scholar 

  37. Meertens, L.: Designing constraint maintainers for user interaction (1998), Manuscript, ftp://ftp.kestrel.edu/pub/papers/meertens/dcm.ps

  38. 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

    Article  Google Scholar 

  39. 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)

    Chapter  Google Scholar 

  40. 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

    Google Scholar 

  41. Perumalla, K., Fujimoto, R.: Source-code transformations for efficient reversibility. Technical Report GIT-CC-99-21, College of Computing, Georgia Tech. (1999)

    Google Scholar 

  42. 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

    Google Scholar 

  43. 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)

    Chapter  Google Scholar 

  44. 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)

    Chapter  Google Scholar 

  45. 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

    Google Scholar 

  46. 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

    Google Scholar 

  47. Wadler, P.: Theorems for free! In: Proceedings of Functional Programming Languages and Computer Architecture, pp. 347–359. ACM (1989), doi:10.1145/99370.99404

    Google Scholar 

  48. Wadler, P.: Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science 73(2), 231–248 (1990), doi:10.1016/0304-3975(90)90147-A

    Article  MathSciNet  MATH  Google Scholar 

  49. 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)

    Chapter  Google Scholar 

  50. 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

    Google Scholar 

  51. 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

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics