skip to main content
10.1145/3704253.3706139acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article
Open access

Characterizations of Partial Well-Behaved Lenses

Published: 10 January 2025 Publication History

Abstract

Foster et al. proposed a linguistic approach to the bidirectional transformation, with lens. A lens is a pair of two functions, one is a forward transformation called get which produces a target view from an original source, and the other is a backward transformation called put which updates the original source to a new one with an updated view. The get and put functions depend on each other to be consistent. A lens is called well-behaved if it satisfies two lens laws, GetPut and PutGet. Every put function uniquely determines a get function if it exists, as far as the get and put functions form a well-behaved lens. Fischer et al. found the conditions of a put function under which the corresponding get function exists, where both get and put functions are supposed to be total. In this paper, we consider the case where get and put functions are possibly partial. We show that almost the same conditions as the ones given by Fischer et al. work well when only a put function is possibly partial, while they do not work when a get function is also possibly partial. In order to have similar results, we propose a new lens law for the case where both get and put functions are possibly partial.

References

[1]
Faris Abou-Saleh, James Cheney, Jeremy Gibbons, James McKinna, and Perdita Stevens. 2014. Introduction to Bidirectional Transformations. In Bidirectional Transformations - International Summer School, Tutorial Lectures, Jeremy Gibbons and Perdita Stevens (Eds.) (Lecture Notes in Computer Science, Vol. 9715). Springer International Publishing, Oxford, UK. 1–28. https://doi.org/10.1007/978-3-319-79108-1_1
[2]
Faris Abou-Saleh, James Cheney, Jeremy Gibbons, James McKinna, and Perdita Stevens. 2016. Reflections on Monadic Lenses. In A List of Successes That Can Change the World: Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday, Sam Lindley andConor McBride and Philip W. Trinder andDonald Sannella (Eds.) (Lecture Notes in Computer Science, Vol. 9600). Springer, 1–31. https://doi.org/10.1007/978-3-319-30936-1_1
[3]
Holger Bock Axelsen and Robert Glück. 2016. On reversible Turing machines and their function universality. Acta Informatica, 53, 5 (2016), Aug, 509–543. https://doi.org/10.1007/s00236-015-0253-y
[4]
François Bancilhon and Nicolas Spyratos. 1981. Update semantics of relational views. ACM Trans. Database Syst., 6, 4 (1981), Dec, 557–575. https://doi.org/10.1145/319628.319634
[5]
C. H. Bennett. 1973. Logical Reversibility of Computation. IBM Journal of Research and Development, 17, 6 (1973), Nov, 525–532. https://doi.org/10.1147/rd.176.0525
[6]
Aaron Bohannon, J. Nathan Foster, Benjamin C. Pierce, Alexandre Pilkiewicz, and Alan Schmitt. 2008. Boomerang: resourceful lenses for string data. In Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, George C. Necula and Philip Wadler (Eds.) (POPL ’08). Association for Computing Machinery, San Francisco, California, USA. 407–419. https://doi.org/10.1145/1328438.1328487
[7]
Zinovy Diskin, Harald König, and Mark Lawford. 2018. Multiple Model Synchronization with Multiary Delta Lenses. In Fundamental Approaches to Software Engineering, Alessandra Russo and Andy Schürr (Eds.) (Lecture Notes in Computer Science, Vol. 10802). Springer International Publishing, Thessaloniki, Greece. 21–37. https://doi.org/10.1007/978-3-319-89363-1_2
[8]
Sebastian Fischer, Zhenjiang Hu, and Hugo Pacheco. 2015. A Clear Picture of Lens Laws - Functional Pearl. In Mathematics of Program Construction - 12th International Conference, MPC 2015, Ralf Hinze and Janis Voigtländer (Eds.) (Lecture Notes in Computer Science, Vol. 9129). Springer, Königswinter, Germany. 215–223. https://doi.org/10.1007/978-3-319-19797-5_10
[9]
Sebastian Fischer, Zhenjiang Hu, and Hugo Pacheco. 2015. The essence of bidirectional programming. Sci. China Inf. Sci., 58, 5 (2015), April, 1–21. https://doi.org/10.1007/s11432-015-5316-8
[10]
John Nathan Foster. 2009. Bidirectional programming languages. Ph. D. Dissertation. USA. isbn:9781109710137 AAI3405376
[11]
J. Nathan Foster, Michael B. Greenwald, Jonathan T. Moore, Benjamin C. Pierce, and Alan Schmitt. 2007. Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem. ACM Trans. Program. Lang. Syst., 29, 3 (2007), may, 17–es. https://doi.org/10.1145/1232420.1232424
[12]
Soichiro Hidaka, Massimo Tisi, Jordi Cabot, and Zhenjiang Hu. 2016. Feature-based classification of bidirectional transformation approaches. Softw. Syst. Model., 15, 3 (2016), 907–928. https://doi.org/10.1007/S10270-014-0450-0
[13]
Bernhard Hoisl, Zhenjiang Hu, and Soichiro Hidaka. 2014. Towards Co-evolution in Model-Driven Development Via Bidirectional Higher-Order Transformation. In Proceedings of the 2nd International Conference on Model-Driven Engineering and Software Development - MODELSWARD, Luís Ferreira Pires, Slimane Hammoudi, Joaquim Filipe, and Rui César das Neves (Eds.). SciTePress, Lisbon, Portugal. 466–471. https://doi.org/10.5220/0004809004660471
[14]
Yasunori Ishihara, Hiroyuki Kato, Keisuke Nakano, Makoto Onizuka, and Yuya Sasaki. 2019. Toward BX-Based Architecture for Controlling and Sharing Distributed Data. In 2019 IEEE International Conference on Big Data and Smart Computing (BigComp). IEEE, Kyoto, Japan. 1–5. https://doi.org/10.1109/BIGCOMP.2019.8679145
[15]
Hsiang-Shang Ko, Tao Zan, and Zhenjiang Hu. 2016. 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, Martin Erwig and Tiark Rompf (Eds.) (PEPM ’16). Association for Computing Machinery, St. Petersburg, FL, USA. 61–72. https://doi.org/10.1145/2847538.2847544
[16]
Kazutaka Matsuda and Meng Wang. 2018. HOBiT: Programming Lenses Without Using Lens Combinators. In Programming Languages and Systems - 27th European Symposium on Programming, ESOP 2018, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2018, Amal Ahmed (Ed.) (Lecture Notes in Computer Science, Vol. 10801). Springer International Publishing, Thessaloniki, Greece. 31–59. https://doi.org/10.1007/978-3-319-89884-1_2
[17]
Keisuke Nakano. 2021. Idempotent Turing Machines. In 46th International Symposium on Mathematical Foundations of Computer Science, MFCS 2021, Filippo Bonchi and Simon J. Puglisi (Eds.) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 202). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Tallinn, Estonia. 79:1–79:18. https://doi.org/10.4230/LIPICS.MFCS.2021.79
[18]
Keisuke Nakano. 2021. A Tangled Web of 12 Lens Laws. In Reversible Computation - 13th International Conference, RC 2021, Shigeru Yamashita and Tetsuo Yokoyama (Eds.) (Lecture Notes in Computer Science, Vol. 12805). Springer, Virtual Event. 185–203. https://doi.org/10.1007/978-3-030-79837-6_11
[19]
Benjamin C. Pierce. 2005. Harmony: The Art of Reconciliation. In Trustworthy Global Computing, Rocco De Nicola and Davide Sangiorgi (Eds.) (Lecture Notes in Computer Science, Vol. 3705). Springer, Edinburgh, UK. 1. https://doi.org/10.1007/11580850_1
[20]
Masaomi Yamaguchi, Kazutaka Matsuda, Cristina David, and Meng Wang. 2021. Synbit: synthesizing bidirectional programs using unidirectional sketches. Proc. ACM Program. Lang., 5, OOPSLA (2021), oct, 1–31. https://doi.org/10.1145/3485482
[21]
Hanliang Zhang, Wenhao Tang, Ruifeng Xie, Meng Wang, and Zhenjiang Hu. 2023. Contract lenses: Reasoning about bidirectional programs via calculation. Journal of Functional Programming, 33 (2023), Nov, e10. https://doi.org/10.1017/S0956796823000059

Index Terms

  1. Characterizations of Partial Well-Behaved Lenses

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    PEPM '25: Proceedings of the 2025 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation
    January 2025
    65 pages
    ISBN:9798400713507
    DOI:10.1145/3704253
    This work is licensed under a Creative Commons Attribution International 4.0 License.

    Sponsors

    In-Cooperation

    • SIGACT: SIGACT
    • SIGLOG: SIGLOG

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 10 January 2025

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. asymmetric lens
    2. bidirectional transformation
    3. lens law
    4. partial functions
    5. well-behavedness

    Qualifiers

    • Research-article

    Funding Sources

    • Japan Society for the Promotion of Science
    • National Institute of Informatics

    Conference

    PEPM '25
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 66 of 120 submissions, 55%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 65
      Total Downloads
    • Downloads (Last 12 months)65
    • Downloads (Last 6 weeks)65
    Reflects downloads up to 23 Jan 2025

    Other Metrics

    Citations

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media