skip to main content
research-article

Bounded refinement types

Published: 29 August 2015 Publication History

Abstract

We present a notion of bounded quantification for refinement types and show how it expands the expressiveness of refinement typing by using it to develop typed combinators for: (1) relational algebra and safe database access, (2) Floyd-Hoare logic within a state transformer monad equipped with combinators for branching and looping, and (3) using the above to implement a refined IO monad that tracks capabilities and resource usage. This leap in expressiveness comes via a translation to ``ghost" functions, which lets us retain the automated and decidable SMT based checking and inference that makes refinement typing effective in practice.

References

[1]
C. Barrett, A. Stump, and C. Tinelli. http://smt-lib.org.
[2]
J. Bengtson, K. Bhargavan, C. Fournet, A. D. Gordon, and S. Maffeis. Refinement types for secure implementations. ACM TOPLAS, 2011.
[3]
Y. Bertot and P. Castéran. Coq’Art: The Calculus of Inductive Constructions. Springer Verlag, 2004.
[4]
R.L. Constable. Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall, 1986.
[5]
P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for the static analysis of programs. In POPL, 1977.
[6]
J. Dunfield. Refined typechecking with Stardust. In PLPV, 2007.
[7]
R. A. Eisenberg and S. Weirich. Dependently typed programming with singletons. In Haskell, 2012.
[8]
J.C. Filliˆatre. Proof of imperative programs in type theory. In TYPES, 1998.
[9]
C. Fournet, M. Kohlweiss, and P-Y. Strub. Modular code-based cryptographic verification. In CCS, 2011.
[10]
A. Guha, M. Fredrikson, B. Livshits, and N. Swamy. Verified security for browser extensions. In IEEE S & P, 2011.
[11]
G. Kaki and S. Jagannathan. A relational framework for higher-order shape analysis. In ICFP, 2014.
[12]
O. Kiselyov, R. Lämmel, and K. Schupke. Strongly typed heterogeneous collections. In Haskell, 2004.
[13]
D. Leijen and E. Meijer. Domain specific embedded compilers. In DSL, 1999.
[14]
C. McBride. Simulating dependent types in Haskell. In JFP, 2002.
[15]
S. Moore, C. Dimoulas, D. King, and S. Chong. SHILL: A secure shell scripting language. In OSDI, 2014.
[16]
A. Nanevski, G. Morrisett, A. Shinnar, P. Govereau, and L. Birkedal. Ynot: Dependent types for imperative programs. In ICFP, 2008.
[17]
G. Nelson. Techniques for program verification. Technical Report CSL81-10, Xerox Palo Alto Research Center, 1981.
[18]
U. Norell. Towards a practical programming language based on dependent type theory. PhD thesis, Chalmers, 2007.
[19]
N. Oury and W. Swierstra. The power of Pi. In ICFP, 2008.
[20]
S. L. Peyton-Jones, D. Vytiniotis, S. Weirich, and G. Washburn. Simple unification-based type inference for GADTs. In ICFP, 2006.
[21]
P. Rondon, M. Kawaguchi, and R. Jhala. Liquid types. In PLDI, 2008.
[22]
J. Rushby, S. Owre, and N. Shankar. Subtypes for specifications: Predicate subtyping in pvs. IEEE TSE, 1998.
[23]
N. Swamy, J. Weinberger, C. Schlesinger, J. Chen, and B. Livshits. Verifying higher-order programs with the dijkstra monad. In PLDI, 2013.
[24]
UCSD Programming Systems. github.com/ucsd-progsys/ liquidhaskell/tree/master/benchmarks/icfp15.
[25]
S. Tobin-Hochstadt and M. Felleisen. Logical types for untyped languages. In ICFP, 2010.
[26]
H. Unno, T. Terauchi, and N. Kobayashi. Relatively complete verification of higher-order functional programs. In POPL, 2013.
[27]
N. Vazou, P. Rondon, and R. Jhala. Abstract refinement types. In ESOP, 2013.
[28]
N. Vazou, E. L. Seidel, and R. Jhala. Liquidhaskell: Experience with refinement types in the real world. In Haskell, 2014.
[29]
N. Vazou, E. L. Seidel, R. Jhala, D. Vytiniotis, and S. L. Peyton Jones. Refinement types for Haskell. In ICFP, 2014.
[30]
H. Xi and F. Pfenning. Eliminating array bound checking through dependent types. In PLDI, 1998.

Cited By

View all
  • (2017)Proceedings of the First Workshop on Coalgebra, Horn Clause Logic Programming and TypesElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.258.7258(72-73)Online publication date: 13-Sep-2017
  • (2024)Ill-Typed Programs Don’t EvaluateProceedings of the ACM on Programming Languages10.1145/36329098:POPL(2010-2040)Online publication date: 5-Jan-2024
  • (2023)Higher-Order MSL Horn ConstraintsProceedings of the ACM on Programming Languages10.1145/35712627:POPL(2017-2047)Online publication date: 11-Jan-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 50, Issue 9
ICFP '15
September 2015
436 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/2858949
  • Editor:
  • Andy Gill
Issue’s Table of Contents
  • cover image ACM Conferences
    ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
    August 2015
    436 pages
    ISBN:9781450336697
    DOI:10.1145/2784731
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 29 August 2015
Published in SIGPLAN Volume 50, Issue 9

Check for updates

Author Tags

  1. abstract interpretation
  2. haskell
  3. refinement types

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)25
  • Downloads (Last 6 weeks)1
Reflects downloads up to 13 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2017)Proceedings of the First Workshop on Coalgebra, Horn Clause Logic Programming and TypesElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.258.7258(72-73)Online publication date: 13-Sep-2017
  • (2024)Ill-Typed Programs Don’t EvaluateProceedings of the ACM on Programming Languages10.1145/36329098:POPL(2010-2040)Online publication date: 5-Jan-2024
  • (2023)Higher-Order MSL Horn ConstraintsProceedings of the ACM on Programming Languages10.1145/35712627:POPL(2017-2047)Online publication date: 11-Jan-2023
  • (2022)Embedded Domain Specific VerifiersPrinciples of Systems Design10.1007/978-3-031-22337-2_26(535-553)Online publication date: 29-Dec-2022
  • (2021)Intensional datatype refinement: with application to scalable verification of pattern-match safetyProceedings of the ACM on Programming Languages10.1145/34343365:POPL(1-29)Online publication date: 4-Jan-2021
  • (2021)Data flow refinement type inferenceProceedings of the ACM on Programming Languages10.1145/34343005:POPL(1-31)Online publication date: 4-Jan-2021
  • (2020)Regular language type inference with term rewritingProceedings of the ACM on Programming Languages10.1145/34089944:ICFP(1-29)Online publication date: 3-Aug-2020
  • (2020)Extending Liquid Types to ArraysACM Transactions on Computational Logic10.1145/336274021:2(1-41)Online publication date: 21-Jan-2020
  • (2019)Modal assertions for actor correctnessProceedings of the 9th ACM SIGPLAN International Workshop on Programming Based on Actors, Agents, and Decentralized Control10.1145/3358499.3361221(11-20)Online publication date: 22-Oct-2019
  • (2019)A Decidable Logic for Tree Data-Structures with MeasurementsVerification, Model Checking, and Abstract Interpretation10.1007/978-3-030-11245-5_15(318-341)Online publication date: 11-Jan-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media