Abstract
Expressive static typing disciplines are a powerful way to achieve high-quality software. However, the adoption cost of such techniques should not be under-estimated. Just like gradual typing allows for a smooth transition from dynamically-typed to statically-typed programs, it seems desirable to support a gradual path to certified programming. We explore gradual certified programming in Coq, providing the possibility to postpone the proofs of selected properties, and to check "at runtime" whether the properties actually hold. Casts can be integrated with the implicit coercion mechanism of Coq to support implicit cast insertion à la gradual typing. Additionally, when extracting Coq functions to mainstream languages, our encoding of casts supports lifting assumed properties into runtime checks. Much to our surprise, it is not necessary to extend Coq in any way to support gradual certified programming. A simple mix of type classes and axioms makes it possible to bring gradual certified programming to Coq in a straightforward manner.
- M. Abadi, L. Cardelli, B. Pierce, and G. Plotkin. Dynamic typing in a statically typed language. ACM Transactions on Programming Languages and Systems, 13(2):237–268, Apr. 1991. Google Scholar
Digital Library
- E. Allende, J. Fabry, R. Garcia, and É. Tanter. Confined gradual typing. In Proceedings of the 29th ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA 2014), pages 251–270, Portland, OR, USA, Oct. 2014. ACM Press. Google Scholar
Digital Library
- F. Ba˜nados, R. Garcia, and É. Tanter. A theory of gradual effect systems. In Proceedings of the 19th ACM SIGPLAN Conference on Functional Programming (ICFP 2014), pages 283–295, Gothenburg, Sweden, Sept. 2014. ACM Press. Google Scholar
Digital Library
- J. Bengtson, K. Bhargavan, C. Fournet, A. D. Gordon, and S. Maffeis. Refinement types for secure implementations. ACM Transactions on Programming Languages and Systems, 33(2):8:1–8:45, Jan. 2011. Google Scholar
Digital Library
- A. Chlipala. Certified Programming with Dependent Types. MIT Press, 2013. Google Scholar
Digital Library
- R. Chugh, P. M. Rondon, A. Bakst, and R. Jhala. Nested refinements: a logic for duck typing. In Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages (POPL 2012), pages 231– 244, Philadelphia, USA, Jan. 2012. ACM Press. Google Scholar
Digital Library
- M. Dénès, C. Hritcu, L. Lampropoulos, Z. Paraskevopoulou, and B. C. Pierce. QuickChick: Property-based testing for Coq. In Coq Workshop, 2014.Google Scholar
- T. Disney and C. Flanagan. Gradual information flow typing. In International Workshop on Scripts to Programs, 2011.Google Scholar
- L. Fennell and P. Thiemann. Gradual security typing with references. In Proceedings of the 26th Computer Security Foundations Symposium (CSF), pages 224–239, June 2013. Google Scholar
Digital Library
- R. B. Findler and M. Felleisen. Contracts for higher-order functions. In Proceedings of the 7th ACM SIGPLAN International Conference on Functional Programming, pages 48–59, Pittsburgh, PA, USA, 2002. ACM Press. Google Scholar
Digital Library
- T. Freeman and F. Pfenning. Refinement types for ML. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI ’91), pages 268– 277. ACM Press, 1991. Google Scholar
Digital Library
- R. Garcia, É. Tanter, R. Wolff, and J. Aldrich. Foundations of typestate-oriented programming. ACM Transactions on Programming Languages and Systems, 36(4):12:1–12:44, Oct. 2014. Google Scholar
Digital Library
- G. Gonthier and A. Mahbouhi. An introduction to small scale reflection in Coq. Journal of Formalized Reasoning, 3(2):95– 152, 2010.Google Scholar
- G. Gonthier, B. Ziliani, A. Nanevski, and D. Dreyer. How to make ad hoc proof automation less ad hoc. Journal of Functional Programming, 23(4):357–401, 2013.Google Scholar
Cross Ref
- J. Gronski, K. Knowles, A. Tomb, S. N. Freund, and C. Flanagan. Sage: Hybrid checking for flexible specifications. In Proceedings of the Scheme and Functional Programming Workshop, pages 93–104, 2006.Google Scholar
- A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 23(3):396–450, 2001. Google Scholar
Digital Library
- K. Knowles and C. Flanagan. Hybrid type checking. ACM Transactions on Programming Languages and Systems, 32(2): Article n.6, Jan. 2010. Google Scholar
Digital Library
- X. Ou, G. Tan, Y. Mandelbaum, and D. Walker. Dynamic typing with dependent types. In Proceedings of the IFIP International Conference on Theoretical Computer Science, pages 437–450, 2004.Google Scholar
Cross Ref
- B. C. Pierce. Types and programming languages. MIT Press, Cambridge, MA, USA, 2002. ISBN 0-262-16209-1. Google Scholar
Digital Library
- P. M. Rondon, M. Kawaguchi, and R. Jhala. Liquid types. In R. Gupta and S. P. Amarasinghe, editors, Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI 2008), pages 159–169. ACM Press, June 2008. Google Scholar
Digital Library
- A. Sa¨ıbi. Typing algorithm in type theory with inheritance. In Proceedings of the 24th ACM Symposium on Principles of Programming Languages (POPL 97), pages 292–301, Paris, France, Jan. 1997. ACM Press. Google Scholar
Digital Library
- T. Schrijvers and B. C. Oliveira. Monads, zippers and views: virtualizing the monad stack. In Proceedings of the 16th ACM SIGPLAN Conference on Functional Programming (ICFP 2011), pages 32–44, Tokyo, Japan, Sept. 2011. ACM Press. Google Scholar
Digital Library
- E. Seidel, N. Vazou, and R. Jhala. Type targeted testing. In J. Vitek, editor, Proceedings of the 24th European Symposium on Programming Languages and Systems (ESOP 2015), volume 9032 of Lecture Notes in Computer Science, London, UK, Mar. 2015. Springer-Verlag. Google Scholar
Digital Library
- I. Sergey and D. Clarke. Gradual ownership types. In H. Seidl, editor, Proceedings of the 21st European Symposium on Programming Languages and Systems (ESOP 2012), volume 7211 of Lecture Notes in Computer Science, pages 579– 599, Tallinn, Estonia, 2012. Springer-Verlag. Google Scholar
Digital Library
- T. Sheard, A. Stump, and S. Weirich. Language-based verification will change the world. In Proceedings of the FSE/SDP Workshop on the Future of Sofware Engineering Research (FoSER 2010), pages 343–348, 2010. Google Scholar
Digital Library
- J. Siek and W. Taha. Gradual typing for functional languages. In Proceedings of the Scheme and Functional Programming Workshop, pages 81–92, Sept. 2006.Google Scholar
- M. Sozeau. Subset coercions in Coq. In Types for Proofs and Programs, volume 4502 of Lecture Notes in Computer Science, pages 237–252. Springer-Verlag, 2007. Google Scholar
Digital Library
- P. Thiemann and L. Fennell. Gradual typing for annotated type systems. In Z. Shao, editor, Proceedings of the 23rd European Symposium on Programming Languages and Systems (ESOP 2014), volume 8410 of Lecture Notes in Computer Science, pages 47–66, Grenoble, France, 2014. Springer-Verlag.Google Scholar
- N. Vazou, P. M. Rondon, and R. Jhala. Abstract refinement types. In M. Felleisen and P. Gardner, editors, Proceedings of the 22nd European Symposium on Programming Languages and Systems (ESOP 2013), volume 7792 of Lecture Notes in Computer Science, pages 209–228, Rome, Italy, Mar. 2013. Springer-Verlag. Google Scholar
Digital Library
- R. Wolff, R. Garcia, É. Tanter, and J. Aldrich. Gradual typestate. In M. Mezini, editor, Proceedings of the 25th European Conference on Object-oriented Programming (ECOOP 2011), volume 6813 of Lecture Notes in Computer Science, pages 459–483, Lancaster, UK, July 2011. Springer-Verlag. Google Scholar
Digital Library
- H. Xi and F. Pfenning. Eliminating array bound checking through dependent types. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI ’98), pages 249–257. ACM Press, 1998. Google Scholar
Digital Library
Index Terms
Gradual certified programming in coq
Recommendations
Gradual certified programming in coq
DLS 2015: Proceedings of the 11th Symposium on Dynamic LanguagesExpressive static typing disciplines are a powerful way to achieve high-quality software. However, the adoption cost of such techniques should not be under-estimated. Just like gradual typing allows for a smooth transition from dynamically-typed to ...
On polymorphic gradual typing
We study an extension of gradual typing—a method to integrate dynamic typing and static typing smoothly in a single language—to parametric polymorphism and its theoretical properties, including conservativity of typing and semantics over both statically ...
Space-efficient gradual typing
Gradual type systems offer a smooth continuum between static and dynamic typing by permitting the free mixture of typed and untyped code. The runtime systems for these languages, and other languages with hybrid type checking, typically enforce function ...






Comments