Projects per year
Abstract
Algorithms on restructuring binary search trees are typically presented in imperative pseudocode. Understandably so, as their performance relies on in-place execution, rather than the repeated allocation of fresh nodes in memory. Unfortunately, these imperative algorithms are notoriously difficult to verify as their loop invariants must relate the unfinished tree fragments being rebalanced. This paper presents several novel functional algorithms for accessing and inserting elements in a restructuring binary search tree that are as fast as their imperative counterparts; yet the correctness of these functional algorithms is established using a simple inductive argument. For each data structure, move-to-root, splay, and zip trees, this paper describes both a bottom-up algorithm using zippers and a top-down algorithm using a novel first-class constructor context primitive. The functional and imperative algorithms are equivalent: we mechanise the proofs establishing this in the Coq proof assistant using the Iris framework. This yields a first fully verified implementation of well known algorithms on binary search trees with performance on par with the fastest implementations in C.
Original language | English |
---|---|
Article number | 168 |
Pages (from-to) | 518-542 |
Number of pages | 25 |
Journal | Proceedings of the ACM on Programming Languages |
Volume | 8 |
Issue number | PLDI |
DOIs | |
Publication status | Published - 20 Jun 2024 |
Event | 45th ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI) - Copenhagen, Denmark Duration: 24 Jun 2024 → 28 Jun 2024 Conference number: 45 |
Keywords / Materials (for Non-textual outputs)
- key words and phrases
- FIP
- FBIP
- tail recursion modulo cons
- zippers
- splay trees
- zip trees
Fingerprint
Dive into the research topics of 'The functional essence of imperative binary search trees'. Together they form a unique fingerprint.Projects
- 1 Finished
-
Effect Handler Oriented Programming
Lindley, S. (Principal Investigator)
1/02/21 → 31/01/25
Project: Research