Skip to main navigation Skip to search Skip to main content

How to Safely Use Extensionality in Liquid Haskell

  • IMDEA Software Institute

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

3 Scopus citations

Abstract

Refinement type checkers are a powerful way to reason about functional programs. For example, one can prove properties of a slow, specification implementation and port the proofs to an optimized pure implementation that behaves the same. But to reason about higher-order programs, we must reason about equalities between functions: we need a consistent encoding of functional extensionality. A natural but naive phrasing of the functional extensionality axiom (funext) is inconsistent in refinement type systems with semantic subtyping and polymorphism: if we assume funext, then we can prove false. We demonstrate the inconsistency and develop a new approach to equality in Liquid Haskell: we define a propositional equality in a library we call PEq. Using PEq avoids the inconsistency while proving useful equalities at higher types; we demonstrate its use in several case studies. We validate PEq by building a model and developing its metatheory. Additionally, we prove metaproperties of PEq inside Liquid Haskell itself using an unnamed folklore technique, which we dub ‘classy induction’.

Original languageEnglish
Title of host publicationHaskell 2022 - Proceedings of the 15th ACM SIGPLAN International Symposium on Haskell, Co-located with ICFP 2022
EditorsNadia Polikarpova
Pages13-26
Number of pages14
ISBN (Electronic)9781450394383
DOIs
StatePublished - 6 Sep 2022
Event15th ACM SIGPLAN International Symposium on Haskell, Haskell 2022 - Ljubljana, Slovenia
Duration: 15 Sep 202216 Sep 2022

Publication series

NameHaskell 2022 - Proceedings of the 15th ACM SIGPLAN International Symposium on Haskell, Co-located with ICFP 2022

Conference

Conference15th ACM SIGPLAN International Symposium on Haskell, Haskell 2022
Country/TerritorySlovenia
CityLjubljana
Period15/09/2216/09/22

Keywords

  • function equality
  • functional extensionality
  • refinement types

Fingerprint

Dive into the research topics of 'How to Safely Use Extensionality in Liquid Haskell'. Together they form a unique fingerprint.

Cite this