Functional Extensionality for Refinement Types

03/03/2021
by   Niki Vazou, et al.
0

Refinement type checkers are a powerful way to reason about functional programs. For example, one can prove properties of a slow, specification implementation, porting the proofs to an optimized implementation that behaves the same. Without functional extensionality, proofs must relate functions that are fully applied. When data itself has a higher-order representation, fully applied proofs face serious impediments! When working with first-order data, fully applied proofs lead to noisome duplication when using higher-order functions. While dependent type theories are typically consistent with functional extensionality axioms, refinement type systems with semantic subtyping treat naive phrasings of functional extensionality inconsistently, leading to unsoundness. We demonstrate this unsoundness 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 unsoundness while still proving useful equalities at higher types; we demonstrate its use in several case studies. We validate PEq by building a small 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'.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/17/2017

Higher-Order Constrained Horn Clauses and Refinement Types

Motivated by applications in automated verification of higher-order func...
research
04/06/2019

System FR as Foundations for Stainless

We present the design, implementation, and foundation of a verifier for ...
research
06/24/2020

ReLoC Reloaded: A Mechanized Relational Logic for Fine-Grained Concurrency and Logical Atomicity

We present a new version of ReLoC: a relational logic for proving refine...
research
05/05/2021

Refinements of Futures Past: Higher-Order Specification with Implicit Refinement Types (Extended Version)

Refinement types decorate types with assertions that enable automatic ve...
research
08/05/2020

Extensional equality preservation and verified generic programming

In verified generic programming, one cannot exploit the structure of con...
research
08/07/2017

Deriving Law-Abiding Instances

Liquid Haskell's refinement-reflection feature augments the Haskell lang...
research
09/10/2018

Classical Proofs as Parallel Programs

We introduce a first proofs-as-parallel-programs correspondence for clas...

Please sign up or login with your details

Forgot password? Click here to reset