Skip to main content

Principles and Practice of Bidirectional Programming in BiGUL

  • Chapter
  • First Online:
Bidirectional Transformations

Abstract

Putback-based bidirectional programming allows the programmer to write only one backward transformation, from which the unique corresponding forward transformation is derived for free. A key distinguishing feature of putback-based bidirectional programming is full control over the bidirectional behavior, which is important for specifying intended bidirectional transformations without any ambiguity. In this chapter, we will introduce BiGUL, a simple yet powerful putback-based bidirectional programming language, explaining the underlying principles and showing how various kinds of bidirectional application can be developed in BiGUL.

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

Access this chapter

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 EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Institutional subscriptions

Notes

  1. 1.

    The text of this section is adapted from the first author’s FM 2014 paper [10].

  2. 2.

    The text of this section is adapted from our BX 2016 paper [17].

References

  1. Barbosa, D.M.J., Cretin, J., Foster, J.N., Greenberg, M., Pierce, B.C.: Matching lenses: alignment and view update. In: International Conference on Functional Programming, pp. 193–204. ACM (2010). https://doi.org/10.1145/1863543.1863572

  2. Bohannon, A., Foster, J.N., Pierce, B.C., Pilkiewicz, A., Schmitt, A.: Boomerang: resourceful lenses for string data. In: Symposium on Principles of Programming Languages, pp. 407–419. ACM (2008). https://doi.org/10.1145/1328438.1328487

  3. Bohannon, A., Pierce, B.C., Vaughan, J.A.: Relational lenses: a language for updatable views. In: Symposium on Principles of Database Systems, pp. 338–347. ACM (2006). https://doi.org/10.1145/1142351.1142399

  4. Diskin, Z., Xiong, Y., Czarnecki, K.: From state- to delta-based bidirectional model transformations: the asymmetric case. J. Object Technol. 10(6), 6:1–6:25 (2011). https://doi.org/10.5381/jot.2011.10.1.a6

    Google Scholar 

  5. Fischer, S., Hu, Z., Pacheco, H.: A clear picture of lens laws. In: Hinze, R., Voigtländer, J. (eds.) MPC 2015. LNCS, vol. 9129, pp. 215–223. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-19797-5_10

    Chapter  Google Scholar 

  6. Fischer, S., Hu, Z., Pacheco, H.: The essence of bidirectional programming. Sci. China Inf. Sci. 58(5), 1–21 (2015). https://doi.org/10.1007/s11432-015-5316-8

    Article  Google Scholar 

  7. Foster, J.: Bidirectional programming languages. Ph.D. thesis, University of Pennsylvania, December 2009

    Google Scholar 

  8. Foster, J.N., Greenwald, M.B., Moore, J.T., Pierce, B.C., Schmitt, A.: Combinators for bidirectional tree transformations: a linguistic approach to the view-update problem. ACM Trans. Program. Lang. Syst. 29(3), 17 (2007). https://doi.org/10.1145/1232420.1232424

    Article  MATH  Google Scholar 

  9. Hidaka, S., Hu, Z., Inaba, K., Kato, H., Matsuda, K., Nakano, K.: Bidirectionalizing graph transformations. In: International Conference on Functional Programming, pp. 205–216. ACM (2010). https://doi.org/10.1145/1932681.1863573

  10. Hu, Z., Pacheco, H., Fischer, S.: Validity checking of putback transformations in bidirectional programming. In: Jones, C., Pihlajasaari, P., Sun, J. (eds.) FM 2014. LNCS, vol. 8442, pp. 1–15. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-06410-9_1

    Chapter  Google Scholar 

  11. Ko, H.S., Zan, T., Hu, Z.: BiGUL: a formally verified core language for putback-based bidirectional programming. In: Workshop on Partial Evaluation and Program Manipulation, pp. 61–72. ACM (2016). https://doi.org/10.1145/2847538.2847544

  12. Matsuda, K., Hu, Z., Nakano, K., Hamana, M., Takeichi, M.: Bidirectionalization transformation based on automatic derivation of view complement functions. In: International Conference on Functional Programming, pp. 47–58. ACM (2007). https://doi.org/10.1145/1291220.1291162

  13. Pacheco, H., Hu, Z., Fischer, S.: Monadic combinators for “putback” style bidirectional programming. In: Workshop on Partial Evaluation and Program Manipulation, pp. 39–50. ACM (2014). https://doi.org/10.1145/2543728.2543737

  14. Pacheco, H., Zan, T., Hu, Z.: BiFluX: a bidirectional functional update language for XML. In: International Symposium on Principles and Practice of Declarative Programming, pp. 147–158 (2014). https://doi.org/10.1145/2643135.2643141

  15. Voigtländer, J.: Bidirectionalization for free! In: Symposium on Principles of Programming Languages, pp. 165–176. ACM (2009). https://doi.org/10.1145/1480881.1480904

  16. Xiong, Y., Liu, D., Hu, Z., Zhao, H., Takeichi, M., Mei, H.: Towards automatic model synchronization from model transformations. In: International Conference on Automated Software Engineering, pp. 164–173. ACM (2007). https://doi.org/10.1145/1321631.1321657

  17. Zan, T., Liu, L., Ko, H.S., Hu, Z.: Brul: a putback-based bidirectional transformation library for updatable views. In: International Workshop on Bidirectional Transformations, pp. 77–89. CEUR-WS (2016). http://ceur-ws.org/Vol-1571/paper_3.pdf

  18. Zhu, Z., Zhang, Y., Ko, H.S., Martins, P., Saraiva, J., Hu, Z.: Parsing and reflective printing, bidirectionally. In: International Conference on Software Language Engineering, pp. 2–14. ACM (2016). https://doi.org/10.1145/2997364.2997369

Download references

Acknowledgements

We would like to thank James Cheney, Jeremy Gibbons, and, in particular, Anthony Anjorin for their meticulous and helpful comments on this paper. This work is supported by JSPS Grant-in-Aid for Scientific Research (A) No. 25240009 of Japan, the Nation Basic Research Program (973 Program) of China under Grant No. 2015CB352201, and the National Natural Science Foundation of China under Grant No. 61620106007.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Zhenjiang Hu .

Editor information

Editors and Affiliations

1 Electronic supplementary material

Below is the link to the electronic supplementary material.

Supplementary material 1 (zip 6 KB)

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Hu, Z., Ko, HS. (2018). Principles and Practice of Bidirectional Programming in BiGUL. In: Gibbons, J., Stevens, P. (eds) Bidirectional Transformations. Lecture Notes in Computer Science(), vol 9715. Springer, Cham. https://doi.org/10.1007/978-3-319-79108-1_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-79108-1_4

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-79107-4

  • Online ISBN: 978-3-319-79108-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics