On Coevaluation Behavior and Equivalence
Abstract
:1. Introduction
1.1. Coevaluation-Based Semantics
1.2. Contributions
- A description of the subset of infinite computations that coevaluation is able to express (Section 4.2 and Section 5.1).
- A well-behaved coevaluation extension, that is, an extension where coevaluation behaves the same as evaluation for finite computations, and where coevaluation behaves the same as divergence for infinite computations (Section 5.3).
- Proof of the expected equivalence between (extended) coevaluation and the union of evaluation with divergence (Section 5.3 and Section 6.1).
- Proof of the non-existence of known unusual features in (extended) coevaluation (Section 6.2).
2. Related Work
2.1. Related Semantics
2.2. Step-Indexed Coevaluation Realization
2.3. Coinduction Based on Clocks
2.4. Step-Indexed Logical Relations
3. Preliminaries
3.1. The Language
3.2. Natural Semantics
3.3. Divergence
4. Coevaluation Behavior
4.1. Coevaluation
4.2. Behavior
5. Coevaluation Extension
5.1. Coevaluation Behavior Exposed
- The (-app-l) and (-app-r) analogous rules must be added to .
- The (-app) rule must be split in two: one rule that explicitly captures only finite computations (those corresponding to (⇒-app) ⇒ rule) and one that explicitly captures infinite computations only (those corresponding to the (-app-f) rule).
5.2. Preliminary Coevaluation Extension
5.3. Well-Behaved Coevaluation Extension
6. Expected Coevaluation Behavior
6.1. Expected Coevaluation Equivalence
6.2. Expected Non-Existence of Unusual Features of Coevaluation
7. Discussion
7.1. Related Coevaluation-Based Semantics
7.2. Compiler Verification
7.3. Implications and Limitations
7.4. Extension of Leroy’s Work
8. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A. Leroy’s Lemmas
References
- Kahn, G. Natural semantics. In STACS 87; Brandenburg, F.J., Vidal-Naquet, G., Wirsing, M., Eds.; Springer: Berlin/Heidelberg, Germany, 1987; Volume 247, pp. 22–39. [Google Scholar] [CrossRef]
- Leroy, X. Coinductive Big-Step Operational Semantics. In Programming Languages and Systems; Sestoft, P., Ed.; Springer: Berlin/Heidelberg, Germany, 2006; Volume 3924, pp. 54–68. [Google Scholar] [CrossRef] [Green Version]
- Leroy, X.; Grall, H. Coinductive big-step operational semantics. Inf. Comput. 2009, 207, 284–304. [Google Scholar] [CrossRef] [Green Version]
- Charguéraud, A. Pretty-Big-Step Semantics. In Programming Languages and Systems; Felleisen, M., Gardner, P., Eds.; Springer: Berlin/Heidelberg, Germany, 2013; Volume 7792, pp. 41–60. [Google Scholar] [CrossRef] [Green Version]
- Bach Poulsen, C.; Mosses, P.D. Flag-based big-step semantics. J. Log. Algebr. Methods Program. 2017, 88, 174–190. [Google Scholar] [CrossRef] [Green Version]
- Perreira Pereira, M.J. Tools and Techniques for the Verification of Modular Stateful Code. Ph.D. Thesis, Université Paris-Saclay, Gif-sur-Yvette, France, 2018. [Google Scholar]
- Zúñiga, A. On the Coevaluation Behavior and Equivalence: The Coq Development. Available online: https://zenodo.org/record/7118459#.Y1YTDORByUk (accessed on 28 September 2022).
- Cousot, P.; Cousot, R. Bi-inductive structural semantics. Inf. Comput. 2009, 207, 258–283. [Google Scholar] [CrossRef] [Green Version]
- Cousot, P.; Cousot, R. Inductive Definitions, Semantics and Abstract Interpretations. In Proceedings of the 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Albuquerque, NM, USA, 19–22 January 1992; Association for Computing Machinery: New York, NY, USA, 1992; pp. 83–94. [Google Scholar] [CrossRef]
- Grall, H. Deux critèRes de Sécurité Pour L’exécution de Code Mobile. Ph.D. Thesis, École Nationale des Ponts et Chaussées, Champs-sur-Marne, France, 2003. [Google Scholar]
- Zúñiga, A.; Bel-Enguix, G. Coinductive Natural Semantics for Compiler Verification in Coq. Mathematics 2020, 8, 1573. [Google Scholar] [CrossRef]
- Coquand, T. Infinite objects in type theory. In Types for Proofs and Programs; Barendregt, H., Nipkow, T., Eds.; Springer: Berlin/Heidelberg, Germany, 1993; pp. 62–78. [Google Scholar] [CrossRef]
- Giménez, E. Un Calcul de Constructions Infinies et Son Application a la Vérification de Systemes Communicants. Ph.D. Thesis, École Normale Supérieure de Lyon, Lyon, France, 1996. [Google Scholar]
- Hughes, J.; Pareto, L.; Sabry, A. Proving the Correctness of Reactive Systems Using Sized Types. In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, St. Petersburg Beach, FL, USA, 21–24 January 1996; Association for Computing Machinery: New York, NY, USA, 1996; pp. 410–423. [Google Scholar] [CrossRef]
- Abel, A. A Polymorphic Lambda-Calculus with Sized Higher-Order Types. Ph.D. Thesis, Ludwig-Maximilians-Universität München, München, Germany, 2006. [Google Scholar]
- Sacchini, J.L. On Type-Based Termination and Dependent Pattern Matching in the Calculus of Inductive Constructions. Ph.D. Thesis, École Nationale Supérieure des Mines de Paris, Paris, France, 2011. [Google Scholar]
- Abel, A.; Pientka, B. Well-founded recursion with copatterns and sized types. J. Funct. Program. 2016, 26, e2. [Google Scholar] [CrossRef] [Green Version]
- Abel, A.; Pientka, B.; Thibodeau, D.; Setzer, A. Copatterns: Programming Infinite Structures by Observations. In Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Rome, Italy, 23–25 January 2013; Association for Computing Machinery: New York, NY, USA, 2013; pp. 27–38. [Google Scholar] [CrossRef] [Green Version]
- Abel, A.M.; Pientka, B. Wellfounded Recursion with Copatterns: A Unified Approach to Termination and Productivity. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, Boston, MA, USA, 25–27 September 2013; Association for Computing Machinery: New York, NY, USA, 2013; pp. 185–196. [Google Scholar] [CrossRef]
- Thibodeau, D. An Intensional Type Theory of Coinduction Using Copatterns. Ph.D. Thesis, McGill University, Montréal, QC, Canada, 2020. [Google Scholar]
- Møgelberg, R.E. A Type Theory for Productive Coprogramming via Guarded Recursion. In Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), Vienna, Austria, 14–18 July 2014; Association for Computing Machinery: New York, NY, USA, 2014. [Google Scholar] [CrossRef]
- Bizjak, A.; Møgelberg, R.E. A Model of Guarded Recursion with Clock Synchronisation. Electron. Notes Theor. Comput. Sci. 2015, 319, 83–101. [Google Scholar] [CrossRef] [Green Version]
- Bizjak, A.; Grathwohl, H.B.; Clouston, R.; Møgelberg, R.E.; Birkedal, L. Guarded Dependent Type Theory with Coinductive Types. In Foundations of Software Science and Computation Structures; Jacobs, B., Löding, C., Eds.; Springer: Berlin/Heidelberg, Germany, 2016; pp. 20–35. [Google Scholar] [CrossRef] [Green Version]
- Clouston, R.; Bizjak, A.; Grathwohl, H.B.; Birkedal, L. The Guarded Lambda-Calculus: Programming and Reasoning with Guarded Recursion for Coinductive Types. Log. Methods Comput. Sci. 2017, 12, 1–39. [Google Scholar] [CrossRef] [Green Version]
- Bahr, P.; Grathwohl, H.B.; Møgelberg, R.E. The clocks are ticking: No more delays! In Proceedings of the 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), Reykjavik, Iceland, 20–23 June 2017; pp. 1–12. [Google Scholar] [CrossRef] [Green Version]
- Birkedal, L.; Bizjak, A.; Clouston, R.; Grathwohl, H.B.; Spitters, B. Guarded Cubical Type Theory. J. Autom. Reason. 2019, 63, 211–253. [Google Scholar] [CrossRef] [Green Version]
- Baunsgaard Kristensen, M.; Mogelberg, R.E.; Vezzosi, A. Greatest HITs: Higher Inductive Types in Coinductive Definitions via Induction under Clocks. In Proceedings of the 37th Annual ACM/IEEE Symposium on Logic in Computer Science, Haifa, Israel, 2–5 August 2022; Association for Computing Machinery: New York, NY, USA, 2022. [Google Scholar] [CrossRef]
- Gratzer, D.; Sterling, J.; Birkedal, L. Implementing a Modal Dependent Type Theory. Proc. ACM Program. Lang. 2019, 3, 107. [Google Scholar] [CrossRef] [Green Version]
- Stassen, P.; Gratzer, D.; Birkedal, L. A Flexible Multimodal Proof Assistant. In Proceedings of the 28th International Conference on Types for Proofs and Programs, TYPES 2022, Nantes, France, 20–25 June 2022; Available online: https://types22.inria.fr/files/2022/06/TYPES_2022_paper_29.pdf (accessed on 28 September 2022).
- Atkey, R.; McBride, C. Productive Coprogramming with Guarded Recursion. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, Boston, MA, USA, 25–27 September 2013; Association for Computing Machinery: New York, NY, USA, 2013; pp. 197–208. [Google Scholar] [CrossRef]
- Nakano, H. A modality for recursion. In Proceedings of the Fifteenth Annual IEEE Symposium on Logic in Computer Science, Santa Barbara, CA, USA, 26–28 June 2000; pp. 255–266. [Google Scholar] [CrossRef]
- Appel, A.W.; McAllester, D. An Indexed Model of Recursive Types for Foundational Proof-Carrying Code. ACM Trans. Program. Lang. Syst. 2001, 23, 657–683. [Google Scholar] [CrossRef]
- Ahmed, A. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types. In Proceedings of the 15th European Symposium on Programming, ESOP 2006, Held as Part of the Joint European, Vienna, Austria, 27–28 March 2006; pp. 69–83. [Google Scholar] [CrossRef] [Green Version]
- Perconti, J.T.; Ahmed, A. Verifying an Open Compiler Using Multi-language Semantics. In Proceedings of the 23rd European Symposium on Programming, ESOP 2014, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2014, Grenoble, France, 5–13 April 2014; pp. 128–148. [Google Scholar] [CrossRef] [Green Version]
- Paraskevopoulou, Z.; Li, J.M.; Appel, A.W. Compositional Optimizations for CertiCoq. Proc. ACM Program. Lang. 2021, 5, 86. [Google Scholar] [CrossRef]
- Owens, S.; Myreen, M.O.; Kumar, R.; Tan, Y.K. Functional Big-Step Semantics. In Proceedings of the 25th European Symposium on Programming, ESOP 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, 2–8 April 2016; pp. 589–615. [Google Scholar] [CrossRef] [Green Version]
- Owens, S.; Norrish, M.; Kumar, R.; Myreen, M.O.; Tan, Y.K. Verifying Efficient Function Calls in CakeML. Proc. ACM Program. Lang. 2017, 1, 18. [Google Scholar] [CrossRef] [Green Version]
- Paraskevopoulou, Z.; Grover, A. Compiling with Continuations, Correctly. Proc. ACM Program. Lang. 2021, 5, 114. [Google Scholar] [CrossRef]
- Leroy, X.; Grall, H. Coinductive Big-Step Operational Semantics—The Coq Development. Available online: https://xavierleroy.org/coindsem/doc/src1.tgz (accessed on 28 September 2022).
- Leroy, X. Functional Programming Languages Part I: Interpreters and Operational Semantics. Available online: https://xavierleroy.org/mpri/2-4/semantics.pdf (accessed on 28 September 2022).
- Leroy, X. Formal Verification of a Realistic Compiler. Commun. ACM 2009, 52, 107–115. [Google Scholar] [CrossRef] [Green Version]
- Leroy, X. A formally verified compiler back-end. J. Autom. Reason. 2009, 43, 363–446. [Google Scholar] [CrossRef] [Green Version]
- Leroy, X. Formal Certification of a Compiler Back-End or: Programming a Compiler with a Proof Assistant. In Proceedings of the 33rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages 2006, Charleston, SC, USA, 11–13 January 2006; pp. 42–54. [Google Scholar] [CrossRef] [Green Version]
- Blazy, S.; Leroy, X. Mechanized semantics for the Clight subset of the C language. J. Autom. Reason. 2009, 43, 263–288. [Google Scholar] [CrossRef] [Green Version]
- Blazy, S.; Dargaye, Z.; Leroy, X. Formal Verification of a C Compiler Front-End. In Proceedings of the 14th International Symposium on Formal Methods, Hamilton, ON, Canada, 21–27 August 2006; pp. 460–475. [Google Scholar] [CrossRef] [Green Version]
- Leroy, X. The Formal Verification of Compilers. Deep Summer School 2017. 2017. Available online: https://deepspec.org/event/dsss17/leroy-dsss17.pdf (accessed on 15 March 2012).
- Anand, A.; Appel, A.W.; Morrisett, G.; Paraskevopoulou, Z.; Pollack, R.; Savary Bélanger, O.; Sozeau, M.; Weaver, M. CertiCoq: A verified compiler for Coq. In Proceedings of the CoqPL 2017, Paris, France, 15–21 January 2017. [Google Scholar]
- Paraskevopoulou, Z.; Appel, A.W. Closure Conversion is Safe for Space. Proc. ACM Program. Lang. 2019, 3. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zúñiga, A.; Bel-Enguix, G. On Coevaluation Behavior and Equivalence. Mathematics 2022, 10, 3800. https://doi.org/10.3390/math10203800
Zúñiga A, Bel-Enguix G. On Coevaluation Behavior and Equivalence. Mathematics. 2022; 10(20):3800. https://doi.org/10.3390/math10203800
Chicago/Turabian StyleZúñiga, Angel, and Gemma Bel-Enguix. 2022. "On Coevaluation Behavior and Equivalence" Mathematics 10, no. 20: 3800. https://doi.org/10.3390/math10203800
APA StyleZúñiga, A., & Bel-Enguix, G. (2022). On Coevaluation Behavior and Equivalence. Mathematics, 10(20), 3800. https://doi.org/10.3390/math10203800