Abstract
We propose the integration of a random test generation system (capable of discovering program bugs) and a refinement type system (capable of expressing and verifying program invariants), for higher-order functional programs, using a novel lightweight learning algorithm as an effective intermediary between the two. Our approach is based on the well-understood intuition that useful, but difficult to infer, program properties can often be observed from concrete program states generated by tests; these properties act as likely invariants, which if used to refine simple types, can have their validity checked by a refinement type checker. We describe an implementation of our technique for a variety of benchmarks written in ML, and demonstrate its effectiveness in inferring and proving useful invariants for programs that express complex higher-order control and dataflow.
- A. Albarghouthi and K. L. McMillan. Beautiful interpolants. In CAV, 2013. Google Scholar
Digital Library
- D. Beyer and M. E. Keremoglu. Cpachecker: A tool for configurable software verification. In CAV, 2011. Google Scholar
Digital Library
- C. Boyapati, S. Khurshid, and D. Marinov. Korat: Automated testing based on java predicates. In ISSTA, 2002. Google Scholar
Digital Library
- H. R. Chamarthi, P. C. Dillinger, M. Kaufmann, and P. Manolios. Integrating testing and interactive theorem proving. In ACL2, 2011.Google Scholar
Cross Ref
- R. Chugh, P. M. Rondon, and R. Jhala. Nested refinements: A logic for duck typing. In POPL, 2012. Google Scholar
Digital Library
- K. Claessen and J. Hughes. Quickcheck: A lightweight tool for random testing of haskell programs. In ICFP, 2000. Google Scholar
Digital Library
- E. Clarke, O. Grumberg, S. Jha, Y. Lu, and H. Veith. Counterexampleguided abstraction refinement for symbolic model checking. J. ACM, 50(5):752–794, 2003. Google Scholar
Digital Library
- M. D. Ernst, J. H. Perkins, P. J. Guo, S. McCamant, C. Pacheco, M. S. Tschantz, and C. Xiao. The Daikon system for dynamic detection of likely invariants. Sci. Comput. Program., 69(1-3):35–45, 2007. Google Scholar
Digital Library
- C. Flanagan and K. R. M. Leino. Houdini, an annotation assistant for esc/java. In FME, 2001. Google Scholar
Digital Library
- P. Garg, C. Löding, P. Madhusudan, and D. Neider. Ice: A robust learning framework for learning invariants. In CAV, 2014. Google Scholar
Digital Library
- S. Graf and H. Sa¨ıdi. Construction of abstract state graphs with pvs. In CAV, 1997. Google Scholar
Digital Library
- B. S. Gulavani, T. A. Henzinger, Y. Kannan, A. V. Nori, and S. K. Rajamani. Synergy: A new algorithm for property checking. In FSE, 2006. Google Scholar
Digital Library
- T. A. Henzinger, R. Jhala, R. Majumdar, and K. L. McMillan. Abstractions from proofs. In POPL, 2004. Google Scholar
Digital Library
- R. Jhala, R. Majumdar, and A. Rybalchenko. Hmc: Verifying functional programs using abstract interpreters. In CAV, 2011. Google Scholar
Digital Library
- M. Kawaguchi, P. Rondon, and R. Jhala. Type-based data structure verification. In PLDI, 2009. Google Scholar
Digital Library
- N. Kobayashi. Types and higher-order recursion schemes for verification of higher-order programs. In POPL, 2009. Google Scholar
Digital Library
- N. Kobayashi, R. Sato, and H. Unno. Predicate abstraction and cegar for higher-order model checking. In PLDI, 2011. Google Scholar
Digital Library
- S. Lindley and C. McBride. Hasochism: The pleasure and pain of dependently typed haskell programming. In Haskell, 2013. Google Scholar
Digital Library
- C. McBride. Faking it simulating dependent types in haskell. J. Funct. Program., 12(5):375–392, 2002. Google Scholar
Digital Library
- E. J. McCluskey. Minimization of boolean functions. Bell system technical Journal, 35(6):1417–1444, 1956.Google Scholar
- K. L. McMillan. An interpolating theorem prover. Theor. Comput. Sci., 345(1):101–121, 2005. Google Scholar
Digital Library
- A. Nanevski, G. Morrisett, A. Shinnar, P. Govereau, and L. Birkedal. Ynot: Dependent types for imperative programs. In ICFP, 2008. Google Scholar
Digital Library
- C. G. Nelson. Techniques for program verification. Technical report, XEROX Research Center, 1981.Google Scholar
- P. C. Nguyen and D. V. Horn. Relatively complete counterexamples for higher-order programs. In PLDI, 2015. Google Scholar
Digital Library
- T. Nguyen, D. Kapur, W. Weimer, and S. Forrest. Using dynamic analysis to discover polynomial and array invariants. In ICSE, 2012. Google Scholar
Digital Library
- OCAML Library. http://caml.inria.fr/pub/docs/.Google Scholar
- S. J. Ramsay, R. P. Neatherway, and C.-H. L. Ong. A type-directed abstraction refinement approach to higher-order model checking. In POPL, 2014. Google Scholar
Digital Library
- P. M. Rondon, M. Kawaguci, and R. Jhala. Liquid types. In PLDI, 2008. Google Scholar
Digital Library
- E. L. Seidel, N. Vazou, and R. Jhala. Type targeted testing. In ESOP, 2015. Google Scholar
Digital Library
- R. Sharma and A. Aiken. From invariant checking to invariant inference using randomized search. In CAV, 2014. Google Scholar
Digital Library
- R. Sharma, M. Gligoric, A. Arcuri, G. Fraser, and D. Marinov. Testing container classes: Random or systematic? In FASE, 2011. Google Scholar
Digital Library
- R. Sharma, A. V. Nori, and A. Aiken. Interpolants as classifiers. In CAV, 2012. Google Scholar
Digital Library
- R. Sharma, S. Gupta, B. Hariharan, A. Aiken, P. Liang, and A. V. Nori. A data driven approach for algebraic loop invariants. In ESOP, 2013. Google Scholar
Digital Library
- R. Sharma, S. Gupta, B. Hariharan, A. Aiken, and A. V. Nori. Verification as learning geometric concepts. In SAS, 2013.Google Scholar
Cross Ref
- SML Library. http://www.smlnj.org/doc/smlnj-lib/.Google Scholar
- N. Swamy, J. Weinberger, C. Schlesinger, J. Chen, and B. Livshits. Verifying higher-order programs with the dijkstra monad. In PLDI, 2013. Google Scholar
Digital Library
- T. Terauchi. Dependent types from counterexamples. In POPL, 2010. Google Scholar
Digital Library
- H. Unno and N. Kobayashi. Dependent type inference with interpolants. In PPDP, 2009. Google Scholar
Digital Library
- H. Unno, T. Terauchi, and N. Kobayashi. Automating relatively complete verification of higher-order functional programs. In POPL, 2013. Google Scholar
Digital Library
- N. Vazou, P. M. Rondon, and R. Jhala. Abstract refinement types. In ESOP, 2013. Google Scholar
Digital Library
- H. Xi and F. Pfenning. Dependent types in practical programming. In POPL, 1999. Google Scholar
Digital Library
- Yices SMT solver. http://yices.csl.sri.com/.Google Scholar
- H. Zhu and S. Jagannathan. Compositional and lightweight dependent type inference for ml. In VMCAI, 2013.Google Scholar
Digital Library
- H. Zhu, A. V. Nori, and S. Jagannathan. Learning refinement types. Technical report, Purdue Univsersity, 2015.Google Scholar
- https://www.cs. purdue.edu/homes/zhu103/msolve/tech.pdf.Google Scholar
Index Terms
Learning refinement types
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 ...
Learning refinement types
ICFP 2015: Proceedings of the 20th ACM SIGPLAN International Conference on Functional ProgrammingWe propose the integration of a random test generation system (capable of discovering program bugs) and a refinement type system (capable of expressing and verifying program invariants), for higher-order functional programs, using a novel lightweight ...
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 ...






Comments