Abstract
We introduce the FUSION algorithm for local refinement type inference, yielding a new SMT-based method for verifying programs with polymorphic data types and higher-order functions. FUSION is concise as the programmer need only write signatures for (externally exported) top-level functions and places with cyclic (recursive) dependencies, after which FUSION can predictably synthesize the most precise refinement types for all intermediate terms (expressible in the decidable refinement logic), thereby checking the program without false alarms. We have implemented FUSION and evaluated it on the benchmarks from the LiquidHaskell suite totalling about 12KLOC. FUSION checks an existing safety benchmark suite using about half as many templates as previously required and nearly 2 × faster. In a new set of theorem proving benchmarks FUSION is both 10 — 50 × faster and, by synthesizing the most precise types, avoids false alarms to make verification possible.
- C. Barrett, P. Fontaine, and C. Tinelli. 2016. The Satisfiability Modulo Theories Library (SMT-LIB). www.SMT-LIB.org. (2016).Google Scholar
- J. Bengtson, K. Bhargavan, C. Fournet, A.D. Gordon, and S. Maffeis. 2008. Refinement Types for Secure Implementations. In CSF . Google Scholar
Digital Library
- Dirk Beyer, Alessandro Cimatti, Alberto Griggio, M. Erkan Keremoglu, and Roberto Sebastiani. 2009. Software model checking via large-block encoding. In FMCAD. Google Scholar
Cross Ref
- Nikolaj Bjørner, Arie Gurfinkel, Ken McMillan, and Andrey Rybalchenko. 2015. Horn Clause Solvers for Program Verification. In Fields of Logic and Computation. Google Scholar
Cross Ref
- Rod M. Burstall and John Darlington. 1977. A Transformation System for Developing Recursive Programs. J. ACM 24, 1 (1977), 44–67. Google Scholar
Digital Library
- Chris Casinghino, Vilhelm Sjöberg, and Stephanie Weirich. 2014. Combining Proofs and Programs in a Dependently Typed Language. In POPL. Google Scholar
Digital Library
- R.L. Constable. 1986. Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall.Google Scholar
- Benjamin Cosman and Ranjit Jhala. 2017. Local Refinement Typing (Extended version). https://arxiv.org/abs/1706.08007 . (2017).Google Scholar
- J. Dunfield. 2007. Refined typechecking with Stardust. In PLPV. Google Scholar
Digital Library
- M.D. Ernst, J. Cockrell, W. G. Griswold, and D. Notkin. 2001. Dynamically Discovering Likely Program Invariants to Support Program Evolution. IEEE TSE 27(2) (2001), 1–25. Google Scholar
Digital Library
- C. Flanagan, R. Joshi, and K. R. M. Leino. 2001. Annotation inference for modular checkers. Inform. Process. Lett. (2001).Google Scholar
- C. Flanagan, K.R.M. Leino, M. Lillibridge, G. Nelson, J. B. Saxe, and R. Stata. 2002. Extended static checking for Java. In PLDI. Google Scholar
Digital Library
- C. Flanagan and J.B. Saxe. 2000. Avoiding exponential explosion: generating compact verification conditions. In POPL.Google Scholar
- Patrice Godefroid and Mihalis Yannakakis. 2013. Analysis of Boolean Programs. In TACAS.Google Scholar
- S. Graf and H. Saïdi. 1997. Construction of abstract state graphs with PVS. In CAV. Springer, 72–83. Google Scholar
Cross Ref
- Sergey Grebenshchikov, Nuno P. Lopes, Corneliu Popeea, and Andrey Rybalchenko. 2012. Synthesizing software verifiers from proof rules. In PLDI. Google Scholar
Digital Library
- Kodai Hashimoto and Hiroshi Unno. 2015. Refinement Type Inference via Horn Constraint Optimization. In Static Analysis -22nd International Symposium, SAS 2015, Saint-Malo, France, September 9-11, 2015, Proceedings . 199–216. Google Scholar
Cross Ref
- Ralf Hinze. 2009. Functional pearl: la tour d’Hanoï. In ICFP. Google Scholar
Digital Library
- Kryštof Hoder and Nikolaj Bjørner. 2012. Generalized Property Directed Reachability. In SAT.Google Scholar
- Ranjit Jhala, Rupak Majumdar, and Andrey Rybalchenko. 2011. HMC: Verifying Functional Programs Using Abstract Interpreters. In CAV. Google Scholar
Cross Ref
- R. Jhala and K.L. McMillan. 2006. A Practical and Complete Approach to Predicate Refinement. In TACAS 06. Google Scholar
Digital Library
- Richard M. Karp. 1972. Reducibility Among Combinatorial Problems. In Proceedings of a symposium on the Complexity of Computer Computations . Google Scholar
Cross Ref
- Andrew M. Kent, David Kempe, and Sam Tobin-Hochstadt. 2016. Occurrence typing modulo theories. In PLDI.Google Scholar
- K. Knowles and C. Flanagan. 2007. Type Reconstruction for General Refinement Types. In ESOP. http://kenn.frap.net/ publications/knowles-flanagan.esop.07.type.pdfGoogle Scholar
- K.W. Knowles and C. Flanagan. 2010. Hybrid type checking. ACM TOPLAS (2010).Google Scholar
- K. W. Knowles and C. Flanagan. 2009. Compositional reasoning and decidable checking for dependent contract types. In PLPV .Google Scholar
- Naoki Kobayashi, Ryosuke Sato, and Hiroshi Unno. 2011. Predicate abstraction and CEGAR for higher-order model checking. In PLDI. Google Scholar
Digital Library
- Anvesh Komuravelli, Arie Gurfinkel, and Sagar Chaki. 2016. SMT-based model checking for recursive programs. Formal Methods in System Design 48, 3 (2016), 175–205. Google Scholar
Digital Library
- K. Rustan M. Leino. 2005. Efficient weakest preconditions. Inf. Process. Lett. 93, 6 (2005).Google Scholar
Digital Library
- G. Nelson. 1981. Techniques for program verification. Technical Report CSL81-10. Xerox Palo Alto Research Center.Google Scholar
- Martin Odersky, Christoph Zenger, and Matthias Zenger. 2001. Colored local type inference. In POPL. Google Scholar
Digital Library
- X. Ou, G. Tan, Y. Mandelbaum, and D. Walker. 2004. Dynamic Typing with Dependent Types. In IFIP TCS. Google Scholar
Cross Ref
- Alberto Pettorossi and Maurizio Proietti. 1994. Transformation of logic programs: Foundations and techniques. The Journal of Logic Programming 19 (1994), 261 – 320. Google Scholar
Cross Ref
- B. C. Pierce and D. N. Turner. 1998. Local Type Inference. In POPL. Google Scholar
Digital Library
- Nadia Polikarpova, Ivan Kuraj, and Armando Solar-Lezama. 2016. Program synthesis from polymorphic refinement types. In PLDI. Google Scholar
Digital Library
- P. Rondon, M. Kawaguchi, and R. Jhala. 2008. Liquid Types. In PLDI. Google Scholar
Digital Library
- Philipp Rümmer, Hossein Hojjat, and Viktor Kuncak. 2015. On recursion-free Horn clauses and Craig interpolation. Formal Methods in System Design 47, 1 (2015), 1–25. Google Scholar
Digital Library
- J. Rushby, S. Owre, and N. Shankar. 1998. Subtypes for Specifications: Predicate Subtyping in PVS. IEEE TSE (1998).Google Scholar
- Vilhelm Sjöberg and Stephanie Weirich. 2015. Programming up to Congruence. In POPL.Google Scholar
- N. Swamy, J. Chen, C. Fournet, P-Y. Strub, K. Bhargavan, and J. Yang. 2011. Secure distributed programming with valuedependent types. In ICFP.Google Scholar
- N. Swamy, J. Weinberger, C. Schlesinger, J. Chen, and B. Livshits. 2013. Verifying Higher-order Programs with the Dijkstra Monad. In PLDI. Google Scholar
Digital Library
- Hisao Tamaki and Taisuke Sato. 1984. Unfold/Fold Transformation of Logic Programs. In Proceedings of the Second International Logic Programming Conference, Uppsala University, Uppsala, Sweden, July 2-6, 1984 . 127–138.Google Scholar
- H. Unno, T. Terauchi, and N. Kobayashi. 2013. Relatively complete verification of higher-order functional programs. In POPL . Google Scholar
Digital Library
- N. Vazou and R. Jhala. 2016. Refinement Reflection (or, how to turn your favorite language into a proof assistant using SMT). ArXiv e-prints (Oct. 2016). arXiv: cs.PL/1610.04641Google Scholar
- N. Vazou, E. L. Seidel, and R. Jhala. 2014a. LiquidHaskell: Experience with refinement types in the real world. In Haskell.Google Scholar
- N. Vazou, E. L. Seidel, R. Jhala, D. Vytiniotis, and S. L. Peyton Jones. 2014b. Refinement Types for Haskell. In ICFP. Google Scholar
Digital Library
- Panagiotis Vekris, Benjamin Cosman, and Ranjit Jhala. 2016. Refinement types for TypeScript. In PLDI. Google Scholar
Digital Library
- H. Xi and F. Pfenning. 1998. Eliminating Array Bound Checking Through Dependent Types.. In PLDI. Google Scholar
Digital Library
- He Zhu, Aditya V. Nori, and Suresh Jagannathan. 2015. Learning refinement types. In ICFP.Google Scholar
Index Terms
Local refinement typing
Recommendations
Refinement reflection: complete verification with SMT
We introduce Refinement Reflection, a new framework for building SMT-based deductive verifiers. The key idea is to reflect the code implementing a user-defined function into the function’s (output) refinement type. As a consequence, at uses of the ...
Refinement types for Haskell
PLPV '14: Proceedings of the ACM SIGPLAN 2014 Workshop on Programming Languages meets Program VerificationWe present LiquidHaskell (http://goto.ucsd.edu/liquid), an automatic verifier for Haskell. LiquidHaskell uses Refinement types, a restricted form of dependent types where relationships between values are encoded by decorating types with logical ...
Union, intersection and refinement types and reasoning about type disjointness for secure protocol implementations
Foundational Aspects of SecurityWe present a new type system for verifying the security of reference implementations of cryptographic protocols written in a core functional programming language. The type system combines prior work on refinement types, with union, intersection, and ...






Comments