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

How to do proofs: practically proving properties about effectful programs' results (functional pearl)

Published: 18 August 2019 Publication History

Abstract

Dependently-typed languages are great for stating and proving properties of pure functions. We can reason about them modularly (state and prove their properties independently of other functions) and non-intrusively (without modifying their implementation). But what if we are interested in properties about the results of effectful computations? Ideally, we could keep on stating and proving them just as nicely.
This pearl shows we can. We formalise a way to lift a property about values to a property about effectful computations producing such values, and we demonstrate that we need not make any sacrifices when reasoning about them. In addition to this modular and non-intrusive reasoning, our approach offers independence of the underlying monad and allows for readable proofs whose structure follows that of the code.

References

[1]
Michael Gordon Abbott, Thorsten Altenkirch, and Neil Ghani. 2005. Containers: Constructing strictly positive types. Theor. Comput. Sci. 342, 1 (2005), 3–27.
[2]
Agda Developers. 2019. Syntactic Sugar - Do notation - Agda 2.6.0 documentation. https://agda.readthedocs.io/en/v2.6.0/language/syntacticsugar.html#do-notation . (Accessed on 05/14/2019).
[3]
Agda Developers. 2019. Syntactic Sugar - Idiom brackets - Agda 2.6.0 documentation. https://agda.readthedocs.io/en/v2.6.0/language/ syntactic-sugar.html#idiom-brackets . (Accessed on 05/14/2019).
[4]
Pierre-Évariste Dagand. 2017. The essence of ornaments. J. Funct. Program. 27 (2017).
[5]
Nicola Gambino and Martin Hyland. 2003. Wellfounded Trees and Dependent Polynomial Functors. In Types for Proofs and Programs, International Workshop, TYPES 2003, Torino, Italy, April 30 - May 4, 2003, Revised Selected Papers . 210–225.
[6]
Jeremy Gibbons and Ralf Hinze. 2011. Just Do It: Simple Monadic Equational Reasoning. In Proceedings of the 16th ACM SIGPLAN International Conference on Functional Programming (ICFP ’11) . ACM, New York, NY, USA, 2–14.
[7]
Graham Hutton and Diana Fulger. 2008. Reasoning about effects: Seeing the wood through the trees. In Pre-proceedings of the Ninth Symposium on Trends in Functional Programming .
[8]
Conor McBride. 2010. Ornamental algebras, algebraic ornaments. (2010).
[9]
Conor McBride and James McKinna. 2004. The view from the left. Journal of Functional Programming 14, 1 (2004), 69111.
[10]
Conor McBride and Ross Paterson. 2008. Applicative programming with effects. Journal of functional programming 18, 1 (2008), 1–13.
[11]
U. Norell. 2007. Towards a Practical Programming Language Based on Dependent Type Theory . Ph.D. Dissertation. Chalmers.
[12]
Morten Heine Sørensen and Pawel Urzyczyn. 2006. Lectures on the Curry-Howard isomorphism . Vol. 149. Elsevier.
[13]
Wouter Swierstra. 2009. A Hoare logic for the state monad. In International Conference on Theorem Proving in Higher Order Logics . Springer, 440–451.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
TyDe 2019: Proceedings of the 4th ACM SIGPLAN International Workshop on Type-Driven Development
August 2019
76 pages
ISBN:9781450368155
DOI:10.1145/3331554
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 18 August 2019

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Agda
  2. applicative
  3. dependently-typed programming
  4. effectful
  5. equational reasoning
  6. extrinsic proofs
  7. functor
  8. monad
  9. strong specification

Qualifiers

  • Research-article

Conference

ICFP '19
Sponsor:

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 179
    Total Downloads
  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)1
Reflects downloads up to 04 Oct 2024

Other Metrics

Citations

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media