Fulls seldom differ

Mark Koch, Alan Lawrence, Conor McBride, Craig Roy

Research output: Contribution to journalArticlepeer-review

8 Downloads (Pure)

Abstract

Many programs process lists by recursing in a wide variety of sequential and/or divide-and-conquer patterns. Reasoning about the correctness and completeness of these programs requires reasoning about the lengths of the lists, techniques for which are typically undecidable or at least NP-complete. In this paper we show how introducing a relatively simple (sub-)language for expressions describing list lengths, whilst not completely general, covers a great number of these patterns. It includes not only doubling but also exponentiation (iterated doubling), and moreover admits a simple length-checking algorithm that is complete over a predictable problem domain. We prove termination of the algorithm via category-theoretic pullbacks, formalized in Agda, as well as providing a more realistic implementation in Rocq, and a toy language Fulbourn with interpreter in Haskell.
Original languageEnglish
Pages (from-to)616-642
Number of pages27
JournalProceedings of the ACM on Programming Languages (PACMPL)
Volume9
Issue numberICFP
DOIs
Publication statusPublished - 5 Aug 2025

Keywords

  • type systems
  • functional programming
  • length-indexed vectors

Fingerprint

Dive into the research topics of 'Fulls seldom differ'. Together they form a unique fingerprint.

Cite this