Intensional datatype refinement: with application to scalable verification of pattern-match safety
Eddie Jones, Steven J. Ramsay
Abstract
The pattern-match safety problem is to verify that a given functional program will never crash due to non-exhaustive patterns in its function definitions. We present a refinement type system that can be used to solve this problem. The system extends ML-style type systems with algebraic datatypes by a limited form of structural subtyping and environment-level intersection. We describe a fully automatic, sound and complete type inference procedure for this system which, under reasonable assumptions, is worst-case linear-time in the program size. Compositionality is essential to obtaining this complexity guarantee. A prototype implementation for Haskell is able to analyse a selection of packages from the Hackage database in a few hundred milliseconds.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext c7a17670-f2ed-4580-89aa-8a978b308101Cited by top-tier papers1
Ask how each one uses itRelated papers
- Data flow refinement type inferenceZvonimir Pavlinovic, Yusen Su, Thomas WiesPOPL 2021 · 15 citations
- Type-level programming with match typesOlivier Blanvillain, Jonathan Immanuel Brachthäuser, Maxime Kjaer, Martin OderskyPOPL 2022 · 10 citations
- A Complementary Approach to Incorrectness TypingCelia Mengyue Li, Sophie Pull, Steven RamsayPOPL 2026 · 2 citations
- Polymorphic Type Inference for Dynamic LanguagesGiuseppe Castagna, Mickaël Laurent, Kim NguyenPOPL 2024 · 12 citations
- First-Class Refinement Types for ScalaMatt Bovel, Viktor Kunčak, Martin OderskyOOPSLA 2026
