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

What's in a Bag?: An “Application Proving Interface” for Finite Bags and its Implementation

Published: 19 June 2024 Publication History

Abstract

Bags are ubiquitous in program verification. They are the means of choice when we want to express that a collection of elements is a rearrangement of another collection. We are working towards an “application proving interface” (API) for finite bags that is perspicuous, rich, and easy to use. We propose an implementation of the Bag API in the dependently typed language Agda that has minimal meta-theoretic requirements and that we believe is suitable for both instructional and practical applications. Bags form a free commutative monoid. The implementation boils down to the free structure: bag expressions built from the empty bag , singleton bags, and the union of bags <Formula format="inline"><TexMath><?TeX $A\ {\color {InductiveConstructor}\uplus }\ B$?></TexMath><AltText>Math 1</AltText><File name="ifl2023-2-inline1" type="svg"/></Formula>, quotiented by the laws of commutative monoids.

References

[1]
Carlo Angiuli, Evan Cavallo, Anders Mörtberg, and Max Zeuner. 2021. Internalizing Representation Independence with Univalence. Proc. ACM Program. Lang. 5, POPL, Article 12 (jan 2021). https://doi.org/10.1145/3434293
[2]
Henning Basold, Herman Geuvers, and Niels van der Weide. 2017. Higher inductive types in programming. Journal of Universal Computer Science 23, 1 (2017), 63–88.
[3]
Richard S. Bird. 1988. Lectures on Constructive Functional Programming. In Constructive Methods in Computer Science, Manfred Broy (Ed.). Springer-Verlag.
[4]
Ana Bove, Peter Dybjer, and Ulf Norell. 2009. A Brief Overview of Agda - A Functional Language with Dependent Types. In Theorem Proving in Higher Order Logics, 22nd International Conference, TPHOLs 2009, Munich, Germany, August 17-20, 2009. Proceedings(Lecture Notes in Computer Science, Vol. 5674), Stefan Berghofer, Tobias Nipkow, Christian Urban, and Makarius Wenzel (Eds.). Springer, 73–78. https://doi.org/10.1007/978-3-642-03359-9_6
[5]
Jacques Carette, Musa Al-hassy, and Wolfram Kahl. 2018. A tale of theories and data-structures. https://wiki.hh.se/wg211/images/9/94/M18Carette-Slides.pdf
[6]
Vikraman Choudhury and Marcelo Fiore. 2019. The finite-multiset construction in HoTT.
[7]
Vikraman Choudhury and Marcelo Fiore. 2023. Free Commutative Monoids in Homotopy Type Theory. Electronic Notes in Theoretical Informatics and Computer Science (2023).
[8]
Nils Anders Danielsson. 2012. Bag equivalence via a proof-relevant membership relation. In Interactive Theorem Proving: Third International Conference, ITP 2012, Princeton, NJ, USA, August 13-15, 2012. Proceedings 3. Springer, 149–165.
[9]
Bengt Nordström. 1988. Terminating General Recursion. BIT 28, 3 (sep 1988), 605–619. https://doi.org/10.1007/BF01941137
[10]
L. C. Paulson. 1996. ML for the Working Programmer (2nd ed.). Cambridge University Press.
[11]
Andrew M Pitts. 2020. Quotients in Dependent Type Theory. In 5th International Conference on Formal Structures for Computation and Deduction. https://www.cl.cam.ac.uk/ amp12/talks/FSCD2020-s3-slides.pdf
[12]
Aaron Stump. 2016. Verified Functional Programming in Agda. Association for Computing Machinery and Morgan & Claypool.
[13]
The Coq Development Team. 2022. The Coq Proof Assistant. https://doi.org/10.5281/zenodo.7313584
[14]
The Agda Community. 2023. Agda Standard Library. https://github.com/agda/agda-stdlib
[15]
The agda/cubical development team. 2018–2023. The agda/cubical library. https://github.com/agda/cubical/
[16]
Twan van Laarhoven. [n. d.]. The complete correctness of sorting. https://www.twanvl.nl/blog/agda/sorting

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
IFL '23: Proceedings of the 35th Symposium on Implementation and Application of Functional Languages
August 2023
186 pages
ISBN:9798400716317
DOI:10.1145/3652561
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].

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 19 June 2024

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. APIs
  2. Bags
  3. Dependent types
  4. Multisets

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

IFL 2023

Acceptance Rates

Overall Acceptance Rate 19 of 36 submissions, 53%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 18
    Total Downloads
  • Downloads (Last 12 months)18
  • Downloads (Last 6 weeks)2
Reflects downloads up to 13 Jan 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format.

HTML Format

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media