ABSTRACT
Finger Trees (Hinze & Paterson, 2006) are a general purpose persistent data structure with good performance. Their genericity permits developing a wealth of structures like ordered sequences or interval trees on top of a single implementation. However, the type systems used by current functional languages do not guarantee the coherent parameterization and specialization of Finger Trees, let alone the correctness of their implementation. We present a certified implementation of Finger Trees solving these problems using the Program extension of Coq. We not only implement the structure but also prove its invariants along the way, which permit building certified structures on top of Finger Trees in an elegant way.
- Edwin Brady, Conor McBride, and James McKinna. Inductive families need not store their indices. In Stefano Berardi, Mario Coppo, and Ferruccio Damiani, editors, TYPES, volume 3085 of LNCS, pages 115--129. Springer, 2003.Google Scholar
- Adam Chlipala. Position paper: Thoughts on programming with proof assistants. In PLPV'06: Proceedings of the Programming Languages meets Program Verification Workshop, August 2006.Google Scholar
- Coq. The Coq proof assistant. coq.inria.fr.Google Scholar
- Thierry Coquand. Alfa/agda. In Freek Wiedijk, editor, The Seventeen Provers of the World, volume 3600 of LNCS, pages 50--54. Springer, 2006. Google Scholar
- Jean-Christophe Filliâtre and Pierre Letouzey. Functors for proofs and programs. In David A. Schmidt, editor, ESOP, volume 2986 of LNCS, pages 370--384. Springer, 2004.Google Scholar
- Seth Fogarty, Emir Pasalic, Jeremy Siek, and Walid Taha. Concoqtion: indexed types now! In G. Ramalingam and Eelco Visser, editors, PEPM, pages 112--121. ACM, 2007. Google Scholar
Digital Library
- Haskell. The Haskell programming language. haskell.org.Google Scholar
- Ralf Hinze and Ross Paterson. Finger Trees: A Simple General-purpose Data Structure. J. Funct. Program., 16(2):197--217, 2006. Google Scholar
Digital Library
- Pierre Letouzey. A new extraction for coq. In Herman Geuvers and Freek Wiedijk, editors, TYPES'02, volume 2646 of LNCS, pages 200--219. Springer, 2002. Google Scholar
Digital Library
- Conor McBride. Dependently Typed Functional Programs and Their Proofs. PhD thesis, University of Edinburgh, 1999.Google Scholar
- Conor McBride and James McKinna. The view from the left. J. Funct. Program., 14(1):69--111, 2004. Google Scholar
Digital Library
- Alexandre Miquel. The implicit calculus of constructions. In TLCA, volume 2044 of LNCS, pages 344--359. Springer, 2001. Google Scholar
- OCaml. The Ocaml programming language. caml.inria.fr.Google Scholar
- Sam Owre and Natarajan Shankar. The formal semantics of PVS. Technical Report SRI-CSL-97-2, Computer Science Laboratory, SRI International, Menlo Park, CA, August 1997.Google Scholar
- Catherine Parent. Synthesizing proofs from programs in the Calculus of Inductive Constructions. In Bernhard Möller, editor, MPC, volume 947 of LNCS, pages 351--379. Springer, 1995. Google Scholar
Digital Library
- Christine Paulin-Mohring. Inductive definitions in the system COQ. In Typed Lambda Calculi and Applications, volume 664 of LNCS, pages 328--345. Springer, 1993. Google Scholar
- Tim Sheard. Languages of the future. SIGPLAN Notices, 39(12): 119--132, 2004. Google Scholar
Digital Library
- Matthieu Sozeau. Subset coercions in Coq. In TYPES'06, volume 4502 of LNCS, pages 237--252. Springer, 2007. Google Scholar
- Benjamin Werner. On the strength of proof-irrelevant type theories. 3rd International Joint Conference on Automated Reasoning, 2006. Google Scholar
Digital Library
- Hongwei Xi. Applied Type System (extended abstract). In post-workshop Proceedings of TYPES 2003, pages 394--408. Springer-Verlag LNCS 3085, 2004.Google Scholar
- Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), San Antonio, Texas, pages 214--227, January 1999. Google Scholar
Digital Library
Index Terms
Program-ing finger trees in Coq
Recommendations
Finger trees explained anew, and slightly simplified (functional pearl)
Haskell 2020: Proceedings of the 13th ACM SIGPLAN International Symposium on HaskellWe explicitly motivate the subtle intricacies of Hinze and Paterson's Finger Tree datastructure, by step-wise refining a naive implementation. The result is a new explanation of how Finger Trees work and why they have the particular structure they have, ...
Coq Coq correct! verification of type checking and erasure for Coq, in Coq
Coq is built around a well-delimited kernel that perfoms typechecking for definitions in a variant of the Calculus of Inductive Constructions (CIC). Although the metatheory of CIC is very stable and reliable, the correctness of its implementation in Coq ...
Program-ing finger trees in Coq
Proceedings of the ICFP '07 conferenceFinger Trees (Hinze & Paterson, 2006) are a general purpose persistent data structure with good performance. Their genericity permits developing a wealth of structures like ordered sequences or interval trees on top of a single implementation. However, ...







Comments