Refinement types allow for lightweight program verification by enriching types types with logical predicates. Liquid typing provides a decidable refinement inference mechanism that is convenient but subject to two major issues: (1) inference is global and requires top-level annotations, making it unsuitable for inference of modular code components and prohibiting its applicability to library code, and (2) inference failure results in obscure error messages. These difficulties seriously hamper the migration of existing code to use refinements.
This paper shows that gradual liquid type inference – a novel combination of liquid inference and gradual refinement types – addresses both issues. Gradual refinement types, which support imprecise predicates that are optimistically interpreted, can be used in argument positions to constrain liquid inference so that the global inference process effectively infers modular specifications usable for library components. Dually, when gradual refinements appear as the result of inference, they signal an inconsistency in the use of static refinements. Because liquid refinements are drawn from a finite set of predicates, in gradual liquid type inference we can enumerate the safe concretizations of each imprecise refinement, i.e., the static refinements that justify why a program is gradually well-typed. This enumeration is useful for static liquid type error explanation, since the safe concretizations exhibit all the potential inconsistencies that lead to static type errors.
We develop the theory of gradual liquid type inference and explore its pragmatics in the setting of Liquid Haskell. To demonstrate the utility of our approach, we develop an interactive tool, GuiLT, for gradual liquid type inference in Liquid Haskell that both infers modular types and explores safe concretizations of gradual refinements. We report on the use of \GuiLT for error reporting and discuss a case study on the migration of three commonly-used Haskell list manipulation libraries into Liquid Haskell.
Thu 8 NovDisplayed time zone: Guadalajara, Mexico City, Monterrey change
10:30 - 12:00 | |||
10:30 22mTalk | Horn-ICE Learning for Synthesizing Invariants and Contracts OOPSLA Deepak D'Souza , Ezudheen P , Pranav Garg University of Illinois at Urbana-Champaign, Daniel Neider Max Planck Institute for Software Systems, P. Madhusudan University of Illinois at Urbana-Champaign | ||
10:52 22mTalk | Gradual Liquid Type Inference OOPSLA Niki Vazou IMDEA Software Institute, Éric Tanter University of Chile & Inria Paris, David Van Horn University of Maryland, USA | ||
11:15 22mTalk | Collapsible Contracts: Fixing a Pathology of Gradual Typing OOPSLA Daniel Feltey Northwestern University, USA, Ben Greenman Northeastern University, USA, Christophe Scholliers Universiteit Gent, Belgium, Robert Bruce Findler Northwestern University, USA, Vincent St-Amour Northwestern University | ||
11:37 22mTalk | The Root Cause of Blame: Contracts for Intersection and Union Types OOPSLA Jack Williams University of Edinburgh, UK, J. Garrett Morris University of Kansas, USA, Philip Wadler University of Edinburgh, UK |