Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3426425.3426940acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article
Open access

Untangling mechanized proofs

Published: 15 November 2020 Publication History

Abstract

Proof assistants like Coq, Lean, or HOL4 rely heavily on stateful meta-programs called scripts to assemble proofs. Unlike pen-and-paper proofs, proof scripts only describe the steps to take (induct on x, apply a theorem, …), not the states that these steps lead to; as a result, plain proof scripts are essentially incomprehensible without the assistance of an interactive user interface able to run the script and show the corresponding proof states.
Until now, the standard process to communicate a proof without forcing readers to execute its script was to manually copy-paste intermediate proof states into the script, as source code comments — a tedious and error-prone exercise. Additional prose (such as for a book or tutorial) was likewise embedded in comments, preserving executability at the cost of a mediocre text-editing experience.
This paper describes a new approach to the development and dissemination of literate proof scripts, with a focus on the Coq proof assistant. Specifically, we describe two contributions: a compiler that interleaves Coq’s output with the original proof script to produce interactive webpages that are complete, self-contained presentations of Coq proofs; and a new literate programming toolkit that allows authors to switch seamlessly between prose- and code-oriented views of the same sources, by translating back and forth between reStructuredText documents and literate Coq source files. In combination, these tools offer a new way to write, communicate, and preserve proofs, combining the flexibility of procedural proof scripts and the intelligibility of declarative proofs.

Supplementary Material

Auxiliary Presentation Video (sle20main-p66-p-video.mp4)
A video introduction to Alectryon, from SLE 2020. Unlike pen-and-paper proofs, Coq proof scripts only describe the steps to take, not the states that these steps lead to; as a result, proof scripts are essentially incomprehensible without an interactive user interface to show proof goals. Until now, the standard process to share a self-contained Coq proof was to copy-paste goals into the proof script as comments. Additional prose was likewise embedded in comments. Alectryon is a way to develop and disseminate literate proof scripts. It combines a compiler that interleaves Coq’s output with the original proof script to produce interactive webpages, and a literate programming toolkit that allows authors to translate back and forth between reST and Coq. These tools offer a new way to write, communicate, and preserve proofs, combining the flexibility of procedural proof scripts and the intelligibility of declarative proofs.
MP4 File (3426425.3426940.mp4)
Video Presentation

References

[1]
David Aspinall. 2000. Proof General: A Generic Tool for Proof Development. In Tools and Algorithms for the Construction and Analysis of Systems, TACAS 2000, Susanne Graf and Michael Schwartzbach (Eds.). Lecture Notes in Computer Science, Vol. 1785. Springer Berlin Heidelberg, 38-43. https://doi.org/10.1007/3-540-46419-0_3
[2]
Ralph Back, Jim Grundy, and Joakim von Wright. 1997. Structured calculational proof. Formal Aspects of Computing 9, 5 ( 01 Sep 1997 ), 469-483. https://doi.org/10.1007/BF01211456
[3]
Yves Bertot and Pierre Castéran. 2004. Interactive Theorem Proving and Program Development. Springer-Verlag Berlin Heidelberg. https: //doi.org/10.1007/978-3-662-07964-5
[4]
Sylvie Boldo and Guillaume Melquiond. 2011. Flocq: A Unified Library for Proving Floating-Point Algorithms in Coq. In 20th IEEE Symposium on Computer Arithmetic, ARITH 2011, Tübingen, Germany, 25-27 July 2011, Elisardo Antelo, David Hough, and Paolo Ienne (Eds.). IEEE Computer Society, 243-252. https://doi.org/10.1109/ARITH. 2011.40
[5]
Mike Bostock, Jason Davies, Jefrey Heer, Vadim Ogievetsky, and community. 2011. D3.js: Data-Driven Documents. (Feb. 2011 ). https: //d3js.org/.
[6]
Edwin C. Brady. 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. Journal of Functional Programming 23, 5 (Sep 2013 ), 552-593. https://doi.org/10. 1017/S095679681300018X
[7]
Adam Chlipala. 2013. Certified Programming with Dependent Types: A Pragmatic Introduction to the Coq Proof Assistant. The MIT Press.
[8]
Adam Chlipala. 2015. Formal Reasoning About Programs. Electronic textbook. http://adam.chlipala.net/frap/.
[9]
Pierre Corbineau. 2008. A Declarative Language for the Coq Proof Assistant. In Types for Proofs and Programs, Marino Miculan, Ivan Scagneto, and Furio Honsell (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 69-84. https://doi.org/10.1007/978-3-540-68103-8_5
[10]
Chris Coyier. 2011. Stuf you can do with the “Checkbox Hack”. ( 2011 ). https://css-tricks. com/the-checkbox-hack/.
[11]
Judy Crow, Sam Owre, John Rushby, Natarajan Shankar, and Mandayam Srivas. 1995. A Tutorial Introduction to PVS. In Workshop on Industrial-Strength Formal Specification Techniques. Boca Raton, Florida. http://www.csl.sri.com/papers/wift-tutorial/
[12]
Leonardo de Moura, Soonho Kong, Jeremy Avigad, Floris van Doorn, and Jakob von Raumer. 2015. The Lean Theorem Prover (System Description). In Proceedings of the 25th International Conference on Automated Deduction (CADE-25). Berlin, Germany, August 2015. Springer International Publishing, 378-388. https://doi.org/10.1007/978-3-319-21401-6_26
[13]
Edsger W. Dijkstra and Carel S. Scholten. 1990. Predicate Calculus and Program Semantics. Springer New York. https://doi.org/10.1007/978-1-4612-3228-5
[14]
Jonathan Edwards. 2004. Example Centric Programming. ACM SIGPLAN Notices 39, 12 (Dec. 2004 ), 84-91. https://doi.org/10.1145/ 1052883.1052894
[15]
Marc Eisenstadt and Mike Brayshaw. 1990. A fine-grained account of Prolog execution for teaching and debugging. Instructional Science 19, 4 ( 01 Jul 1990 ), 407-436. https://doi.org/10.1007/BF00116447
[16]
Gorkem Ercan. 2016. A common interface for building developer tools. (June 2016 ). https://developers.redhat.com/blog/2016/06/27/acommon-interface-for-building-developer-tools/.
[17]
Martin Fowler. 2008. Projectional editing. ( 2008 ). https:// martinfowler.com/bliki/ProjectionalEditing.html.
[18]
Mario Frank. 2020. The Coq Proof Script Visualiser (coq-psv). In 11th Coq Workshop, colocated with IJCAR ' 20.
[19]
Emilio Jesús Gallego Arias. 2016. SerAPI: Machine-Friendly, DataCentric Serialization for COQ. (Oct. 2016 ). https://hal-minesparistech. archives-ouvertes.fr/hal-01384408.
[20]
Emilio Jesús Gallego Arias, Benoît Pin, and Pierre Jouvelot. 2016. jsCoq: Towards Hybrid Theorem Proving Interfaces. In Proceedings of the 12th Workshop on User Interfaces for Theorem Provers, UITP 2016, Coimbra, Portugal, 2nd July 2016 (EPTCS, Vol. 239 ), Serge Autexier and Pedro Quaresma (Eds.). 15-27. https://doi.org/10.4204/EPTCS.239.2
[21]
David Goodger. 2016. Docutils Project Documentation Overview. (Jan. 2016 ). https://docutils.sourceforge.io/docs/index.html.
[22]
David Goodger. 2020. reStructuredText Markup Specification. (July 2020 ). https://docutils.sourceforge.io/docs/ref/rst/restructuredtext. html.
[23]
Michael J. Gordon, Arthur J. Milner, and Christopher P. Wadsworth. 1979. Edinburgh LCF. Lecture Notes in Computer Science 78 ( 1979 ). https://doi.org/10.1007/3-540-09724-4
[24]
Jim Grundy and Thomas Långbacka. 1997. Recording HOL Proofs in a Structured Browsable Format. In Proceedings of the 6th International Conference on Algebraic Methodology and Software Technology (AMAST '97), Sydney, Australia, December 13-17, 1997. 567-571. https://doi.org/10.1007/BFb0000500
[25]
John Harrison. 1996. A mizar mode for HOL. Theorem Proving in Higher Order Logics ( 1996 ), 203-220. https://doi.org/10.1007/ bfb0105406
[26]
Maxim Hendriks, Cezary Kaliszyk, Femke Van Raamsdonk, and Freek Wiedijk. 2010. Teaching logic using a state-of-the-art proof assistant. Acta Didactica Napocensia 3, 2 ( 2010 ), 35-48.
[27]
Thomas Kluyver, Benjamin Ragan-Kelley, Fernando Pérez, Brian Granger, Mathias Bussonnier, Jonathan Frederic, Kyle Kelley, Jessica Hamrick, Jason Grout, Sylvain Corlay, Paul Ivanov, Damián Avila, Safia Abdalla, Carol Willing, and Jupyter development team. 2016. Jupyter Notebooks-A publishing format for reproducible computational workflows. In Positioning and Power in Academic Publishing: Players, Agents and Agendas, Fernando Loizides and Birgit Scmidt (Eds.). IOS Press, 87-90. https://eprints.soton.ac.uk/403913/
[28]
D. E. Knuth. 1984. Literate Programming. Comput. J. 27, 2 (Feb 1984 ), 97-111. https://doi.org/10.1093/comjnl/27.2. 97
[29]
Donald E. Knuth. 1984. Literate Programming. Comput. J. 27, 2 ( 01 1984 ), 97-111. https://doi.org/10.1093/comjnl/27.2. 97
[30]
Donald E. Knuth. 1992. Literate Programming. Center for the Study of Language and Information, USA.
[31]
Leslie Lamport. 2012. How to write a 21st century proof. Journal of Fixed Point Theory and Applications 11, 1 (Mar 2012 ), 43-63. https: //doi.org/10.1007/s11784-012-0071-6
[32]
K. Rustan M. Leino and Nadia Polikarpova. 2014. Verified Calculations. In Verified Software: Theories, Tools, Experiments, Ernie Cohen and Andrey Rybalchenko (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 170-190.
[33]
Eugene Loy. 2018. Jupyter kernel for Coq. (Dec. 2018 ). https://github. com/EugeneLoy/coq_jupyter.
[34]
Assia Mahboubi and Enrico Tassi. 2020. Mathematical Components. Electronic textbook. https://math-comp.github.io/mcb/.
[35]
James H. Morris, Eric Schmidt, and Philip Wadler. 1980. Experience with an Applicative String Processing Language. In Proceedings of the 7th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Las Vegas, Nevada) (POPL '80). Association for Computing Machinery, New York, NY, USA, 32-46. https://doi.org/10.1145/ 567446.567450
[36]
Benjamin C. Pierce, Arthur Azevedo de Amorim, Chris Casinghino, Marco Gaboardi, Michael Greenberg, Cǎtǎlin Hriţcu, Vilhelm Sjöberg, and Brent Yorgey. 2018. Logical Foundations. Electronic textbook. https://softwarefoundations.cis.upenn.edu/ Version 5.5. https://softwarefoundations.cis.upenn.edu/.
[37]
Clément Pit-Claudel. 2016. coqrst, An experiment in modernizing Coq's manual. (May 2016 ). https://github.com/cpitclaudel/coq-rst/.
[38]
Clément Pit-Claudel. 2017. Editor support for F*. (April 2017 ). https: //github.com/FStarLang/FStar/wiki/Editor-support-for-F*.
[39]
Valentin Robert. 2018. Front-end tooling for building and maintaining dependently-typed functional programs. Ph.D. Dissertation. UC San Diego. https://escholarship.org/uc/item/9q3490fh
[40]
Alan Schmit. 2016. Documenting Coq Code using Org-mode. (June 2016 ). http://alan.petitepomme.net/tips/documenting_coq.html.
[41]
Alan Schmit. 2016. Executing Coq Code using Org-mode. (June 2016 ). http://alan.petitepomme.net/tips/executing_coq.html.
[42]
Ilya Sergey. 2014. Programs and Proofs: Mechanizing Mathematics with Dependent Types. Lecture notes with exercises. https://ilyasergey.net/ pnp/.
[43]
Martin Simons. 1997. Proof presentation for Isabelle. In Theorem Proving in Higher Order Logics, Elsa L. Gunter and Amy Felty (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 259-274. https://doi. org/10.1007/bfb0028399
[44]
Charles Simonyi, Magnus Christerson, and Shane Cliford. 2006. Intentional Software. SIGPLAN Not. 41, 10 (Oct. 2006 ), 451-464. https: //doi.org/10.1145/1167515.1167511
[45]
Lisa M. C. Smith and Mansur H. Samadzadeh. 1991. An annotated bibliography of literate programming. ACM SIGPLAN Notices 26, 1 (Jan 1991 ), 14-20. https://doi.org/10.1145/122203.122204
[46]
Carst Tankink, Herman Geuvers, James McKinna, and Freek Wiedijk. 2010. Proviola: A Tool for Proof Re-animation. In Intelligent Computer Mathematics, 10th International Conference, Paris, France, July 5-10, 2010. Proceedings. 440-454. https://doi.org/10.1007/978-3-642-14128-7_37
[47]
Enrico Tassi. 2018. Roundtrip. ( 2018 ). https://github.com/mathcomp/mcb/tree/master/roundtrip.
[48]
The Coq Development Team. 2002. hTe Coq Proof Assistant: Reference Manual, version 7.2. Technical Report RT-0255. INRIA. 290 pages. https://hal.inria.fr/inria-00069919
[49]
The Coq Development Team. 2018. hTe Coq Proof Assistant: Reference Manual, version 8.8.0. https://doi.org/10.5281/zenodo.1219885
[50]
The Coq Development Team. 2020. hTe Coq Proof Assistant, version 8.11.0. https://doi.org/10.5281/zenodo.3744225
[51]
Hendrik Tews. 2011. Proof tree visualization for Proof General. (April 2011 ). https://askra.de/software/prooftree/.
[52]
Read the Docs. 2013. A markdown parser for docutils. (Aug. 2013 ). https://github.com/readthedocs/recommonmark/.
[53]
Andrzej Trybulec and Howard A. Blair. 1985. Computer Assisted Reasoning with MIZAR. In Proceedings of the 9th International Joint Conference on Artificial Intelligence. Los Angeles, CA, USA, August 1985, Aravind K. Joshi (Ed.). Morgan Kaufmann, 26-28. https://ijcai.org/ Proceedings/85-1/Papers/006.pdf
[54]
Josef Urban. 2005. XML-izing Mizar: Making Semantic Processing and Presentation of MML Easy. In Proceedings of the 4th International Conference on Mathematical Knowledge Management (MKM '05), Bremen, Germany, July 15-17, 2005. 346-360. https://doi.org/10.1007/ 11618027_23
[55]
Josef Urban and Grzegorz Bancerek. 2007. Presenting and Explaining Mizar. Electronic Notes in Theoretical Computer Science 174, 2 (May 2007 ), 63-74. https://doi.org/10.1016/j.entcs. 2006. 09.022
[56]
Antoneta J. M. van Gasteren. 1990. On the Shape of Mathematical Arguments. Springer Berlin Heidelberg. https://doi.org/10.1007/ bfb0020908
[57]
Markus Wenzel. 1999. Isar-A Generic Interpretative Approach to Readable Formal Proof Documents. In Theorem Proving in Higher Order Logics, Yves Bertot, Gilles Dowek, Laurent Théry, André Hirschowitz, and Christine Paulin (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 167-183. https://doi.org/10.1007/3-540-48256-3_12
[58]
Freek Wiedijk. 2001. Mizar Light for HOL Light. In Theorem Proving in Higher Order Logics, Richard J. Boulton and Paul B. Jackson (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 378-393. https://doi. org/10.1007/3-540-44755-5_26
[59]
Jay Wilcox. 2014. Literate Coq Blogging. (Dec. 2014 ). https://github. com/wilcoxjay/coq-lit.

Cited By

View all
  • (2024)CryptoZoo: A Viewer for Reduction ProofsApplied Cryptography and Network Security10.1007/978-3-031-54770-6_1(3-25)Online publication date: 1-Mar-2024
  • (2023)Lorgnette: Creating Malleable Code ProjectionsProceedings of the 36th Annual ACM Symposium on User Interface Software and Technology10.1145/3586183.3606817(1-16)Online publication date: 29-Oct-2023
  • (2023)Colaroid: A Literate Programming Approach for Authoring Explorable Multi-Stage TutorialsProceedings of the 2023 CHI Conference on Human Factors in Computing Systems10.1145/3544548.3581525(1-22)Online publication date: 19-Apr-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SLE 2020: Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering
November 2020
295 pages
ISBN:9781450381765
DOI:10.1145/3426425
This work is licensed under a Creative Commons Attribution International 4.0 License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 15 November 2020

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. formal verification
  2. literate programming
  3. proof browsing
  4. proof presentation

Qualifiers

  • Research-article

Conference

SPLASH '20
Sponsor:

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)189
  • Downloads (Last 6 weeks)31
Reflects downloads up to 18 Aug 2024

Other Metrics

Citations

Cited By

View all
  • (2024)CryptoZoo: A Viewer for Reduction ProofsApplied Cryptography and Network Security10.1007/978-3-031-54770-6_1(3-25)Online publication date: 1-Mar-2024
  • (2023)Lorgnette: Creating Malleable Code ProjectionsProceedings of the 36th Annual ACM Symposium on User Interface Software and Technology10.1145/3586183.3606817(1-16)Online publication date: 29-Oct-2023
  • (2023)Colaroid: A Literate Programming Approach for Authoring Explorable Multi-Stage TutorialsProceedings of the 2023 CHI Conference on Human Factors in Computing Systems10.1145/3544548.3581525(1-22)Online publication date: 19-Apr-2023
  • (2023)PRoofster: Automated Formal Verification2023 IEEE/ACM 45th International Conference on Software Engineering: Companion Proceedings (ICSE-Companion)10.1109/ICSE-Companion58688.2023.00018(26-30)Online publication date: May-2023
  • (2023)Machine-Learned Premise Selection for LeanAutomated Reasoning with Analytic Tableaux and Related Methods10.1007/978-3-031-43513-3_10(175-186)Online publication date: 14-Sep-2023
  • (2022)‘do’ unchained: embracing local imperativity in a purely functional language (functional pearl)Proceedings of the ACM on Programming Languages10.1145/35476406:ICFP(512-539)Online publication date: 31-Aug-2022
  • (2022)i-LaTeX : Manipulating Transitional Representations between LaTeX Code and Generated DocumentsProceedings of the 2022 CHI Conference on Human Factors in Computing Systems10.1145/3491102.3517494(1-16)Online publication date: 29-Apr-2022
  • (2021)ProofViz: An Interactive Visual Proof ExplorerTrends in Functional Programming10.1007/978-3-030-83978-9_6(116-135)Online publication date: 23-Aug-2021
  • (2021)Dynamic Proof PresentationMathematical Reasoning: The History and Impact of the DReaM Group10.1007/978-3-030-77879-8_4(63-86)Online publication date: 24-May-2021

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media