Abstract
Bidirectional transformation has played important roles in broad areas, database management, programming language, and model-driven development after Foster et al. revisited view updating problems introduced by Bancilhon and Spyratos. They introduced the concept of (asymmetric) lens as a pair of a forward \( get \) and a backward \( put \) functions to synchronize a source data and its view consistently. For the \( get \) and \( put \) functions to be consistent, they should satisfy several lens laws such as the (StrongGetPut), (GetPut), (PutGet) and (PutPut) laws. By combining some of these lens laws, we can represent how consistent a lens satisfying the laws is. Fischer et al. has introduced nine meaningful weaker lens laws to give a “clear picture” of the laws where they show relations among lens laws, for example, that one law implies another and combination of two laws is equivalent to combination of the other three laws. This paper gives more precise relationship among 12 lens laws that have been presented in literature. The relationship makes an intertwined implication diagram like a tangled web. The results can be used for easily verifying the desirable lens laws.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
In [3], a lens is said to be undoable when not only (Undoability) but also (PutGet) hold in our terminology.
- 2.
We prefer a shorter name though it might be called the StrongGetPut family.
References
Bancilhon, F., Spyratos, N.: Update semantics of relational views. ACM Trans. Database Syst. 6(4), 557–575 (1981). https://doi.org/10.1145/319628.319634
Bohannon, A., Pierce, B.C., Vaughan, J.A.: Relational lenses: a language for updatable views. In: Vansummeren, S. (ed.) Proceedings of the Twenty-Fifth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, 26–28 Jun 2006, Chicago, Illinois, USA, pp. 338–347. ACM (2006). https://doi.org/10.1145/1142351.1142399
Diskin, Z.: Algebraic models for bidirectional model synchronization. In: Czarnecki, K., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) MODELS 2008. LNCS, vol. 5301, pp. 21–36. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-87875-9_2
Diskin, Z., Xiong, Y., Czarnecki, K.: From state- to delta-based bidirectional model transformations: the asymmetric case. J. Object Technol. 10(6), 1–25 (2011). https://doi.org/10.5381/jot.2011.10.1.a6
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
Foster, J.N., Greenwald, M.B., Kirkegaard, C., Pierce, B.C., Schmitt, A.: Exploiting schemas in data synchronization. J. Comput. Syst. Sci. 73(4), 669–689 (2007). https://doi.org/10.1016/j.jcss.2006.10.024
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
Foster, J.N., Pilkiewicz, A., Pierce, B.C.: Quotient lenses. In: Hook, J., Thiemann, P. (eds.) Proceeding of the 13th ACM SIGPLAN international conference on Functional programming, ICFP 2008, Victoria, BC, Canada, 20–28 Sept 2008, pp. 383–396. ACM (2008). https://doi.org/10.1145/1411204.1411257
Foster, N., Matsuda, K., Voigtländer, J.: Three complementary approaches to bidirectional programming. In: Gibbons, J. (ed.) Generic and Indexed Programming. LNCS, vol. 7470, pp. 1–46. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32202-0_1
Hidaka, S., Hu, Z., Inaba, K., Kato, H., Matsuda, K., Nakano, K.: Bidirectionalizing graph transformations. In: Proceeding of the 15th ACM SIGPLAN International Conference on Functional Programming, ICFP 2010, Baltimore, Maryland, USA, 27–29 Sept 2010, pp. 205–216 (2010). https://doi.org/10.1145/1863543.1863573
Hidaka, S., Tisi, M., Cabot, J., Hu, Z.: Feature-based classification of bidirectional transformation approaches. Softw. Syst. Model. 15(3), 907–928 (2016). https://doi.org/10.1007/s10270-014-0450-0
Hu, Z., Mu, S., Takeichi, M.: A programmable editor for developing structured documents based on bidirectional transformations. In: Heintze, N., Sestoft, P. (eds.) Proceedings of the 2004 ACM SIGPLAN Workshop on Partial Evaluation and Semantics-based Program Manipulation, 2004, Verona, Italy, 24–25 Aug 2004, pp. 178–189. ACM (2004). https://doi.org/10.1145/1014007.1014025
Kmett, E.: The Lens library: Lenses, Folds and Traversals (2013). http://lens.github.io
Ko, H., Zan, T., Hu, Z.: Bigul: a formally verified core language for putback-based bidirectional programming. In: Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2016, St. Petersburg, FL, USA, 20–22 Jan 2016, pp. 61–72 (2016). https://doi.org/10.1145/2847538.2847544
Nakano, K.: Towards a complete picture of lens laws. In: Proceedings of the Third Workshop on Software Foundations for Data Interoperability (SFDI2019+), Fukuoka, Japan (2019)
Nakano, K., Hu, Z., Takeichi, M.: Consistent web site updating based on bidirectional transformation. Int. J. Softw. Tools Technol. Transf. 11(6), 453–468 (2009). https://doi.org/10.1007/s10009-009-0124-3
Pickering, M., Gibbons, J., Wu, N.: Profunctor optics: modular data accessors. Art Sci. Eng. Program. 1(2), 7 (2017). https://doi.org/10.22152/programming-journal.org/2017/1/7
Sasano, I., Hu, Z., Hidaka, S., Inaba, K., Kato, H., Nakano, K.: Toward bidirectionalization of ATL with GRoundTram. In: Cabot, J., Visser, E. (eds.) ICMT 2011. LNCS, vol. 6707, pp. 138–151. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-21732-6_10
Stevens, P.: Bidirectional model transformations in QVT: semantic issues and open questions. Softw. Syst. Model. 9(1), 7–20 (2010). https://doi.org/10.1007/s10270-008-0109-9
Stevens, P.: Observations relating to the equivalences induced on model sets by bidirectional transformations. ECEASST 49 (2012). https://doi.org/10.14279/tuj.eceasst.49.714
Acknowledgment
The author thanks Mirai Ikebuchi and anonymous referees for their helpful comments. This work was supported by JSPS KAKENHI Grant Numbers JP17H06099, JP18H04093, and JP21K11744.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Nakano, K. (2021). A Tangled Web of 12 Lens Laws. In: Yamashita, S., Yokoyama, T. (eds) Reversible Computation. RC 2021. Lecture Notes in Computer Science(), vol 12805. Springer, Cham. https://doi.org/10.1007/978-3-030-79837-6_11
Download citation
DOI: https://doi.org/10.1007/978-3-030-79837-6_11
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-79836-9
Online ISBN: 978-3-030-79837-6
eBook Packages: Computer ScienceComputer Science (R0)