Liquid resource types

  title={Liquid resource types},
  author={Tristan Knoth and Di Wang and Adam Reynolds and Jan Hoffmann and Nadia Polikarpova},
  journal={Proceedings of the ACM on Programming Languages},
  pages={1 - 29}
This article presents liquid resource types, a technique for automatically verifying the resource consumption of functional programs. Existing resource analysis techniques trade automation for flexibility – automated techniques are restricted to relatively constrained families of resource bounds, while more expressive proof techniques admitting value-dependent bounds rely on handwritten proofs. Liquid resource types combine the best of these approaches, using logical refinements to… 

Figures and Tables from this paper

Mechanizing Refinement Types (extended)

A core refinement calculus that combines semantic subtyping and parametric polymorphism is presented, a metatheory for this calculus is developed, and soundness of the type system is proved.

Statically verified refinements for multiparty protocols

With distributed computing becoming ubiquitous in the modern era, safe distributed programming is an open challenge. To address this, multiparty session types (MPST) provide a typing discipline for

Mechanizing Refinement Types

Practical checkers based on refinement types use the combination of implicit semantic subtyping and parametric polymorphism to simplify the specification and automate the verification of sophisticated

Denotational semantics as a foundation for cost recurrence extraction for functional languages

This work gives a formal account of a standard informal method to extract a recurrence that describes its cost in terms of the size of its input and then to compute a closed-form upper bound on that recurrence.

Continuous Verification of Machine Learning: a Declarative Programming Approach

It is argued that methods of continuous verification must rely on robust programming language infrastructure (refinement types, automated proving, type-driven program synthesis), which provides a major opportunity for the declarative programming language community.



Towards automatic resource bound analysis for OCaml

This article presents a resource analysis system for OCaml programs that automatically derives worst-case resource bounds for higher-order polymorphic programs with user-defined inductive types and preserves the expressivity and efficiency of existing AARA techniques.

Static determination of quantitative resource usage for higher-order programs

A new automatic static analysis for determining upper-bound functions on the use of quantitative resources for strict, higher-order, polymorphic, recursive programs dealing with possibly-aliased data is described, using a type-based approach.

Liquid types

We present Logically Qualified Data Types, abbreviated to Liquid Types, a system that combines Hindley-Milner type inference with Predicate Abstraction to automatically infer dependent types precise

Resource-guided program synthesis

The experiments show that ReSyn synthesizes programs that are asymptotically more efficient than those generated by a resource-agnostic synthesizer, and is faster than a naive combination of synthesis and resource analysis.

TiML: a functional language for practical complexity analysis with invariants

TiML, though lacking full automation and theoretical completeness, is versatile enough to verify worst-case and/or amortized complexities for algorithms and data structures like classic list operations, merge sort, Dijkstra's shortest-path algorithm, red-black trees, Braun trees, functional queues, and dynamic tables with bounds like m n logn.

Quantitative program reasoning with graded modal types

This work proposes the umbrella notion of graded modal types, encompassing coeffect types and dual notions of type-based effect reasoning via graded monads, and demonstrates this approach via a type system embodied in a fully-fledged functional language called Granule.

Static prediction of heap space usage for first-order functional programs

It is shown how to efficiently obtain linear a priori bounds on the heap space consumption of first-order functional programs and that integral solutions to the linear programs derived correspond to programs that can be evaluated without any operating system support for memory management.

Bounded Linear Types in a Resource Semiring

This paper introduces a bounded linear typing discipline on a general notion of resource which can be modeled in a semiring, and provides both a general type-inference procedure and a coherent categorical semantics for this type system.

Control-flow refinement and progress invariants for bound analysis

This paper describes two techniques, control-flow refinement and progress invariants, that together enable estimation of precise bounds for procedures with nested and multi-path loops, and presents an algorithm that uses progress invariant to compute precise limits for nested loops.

Refinement types for ML

A type system called refinement types is described, which is an example of a new way to make this tradeoff, as well as a potentially useful system in itself.