Abstract
Full-spectrum dependent types promise to enable the development of correct-by-construction software. However, even certified software needs to interact with simply-typed or untyped programs, be it to perform system calls, or to use legacy libraries. Trading static guarantees for runtime checks, the dependent interoperability framework provides a mechanism by which simply-typed values can safely be coerced to dependent types and, conversely, dependently-typed programs can defensively be exported to a simply-typed application. In this paper, we give a semantic account of dependent interoperability. Our presentation relies on and is guided by a pervading notion of type equivalence, whose importance has been emphasized in recent work on homotopy type theory. Specifically, we develop the notion of partial type equivalences as a key foundation for dependent interoperability. Our framework is developed in Coq; it is thus constructive and verified in the strictest sense of the terms. Using our library, users can specify domain-specific partial equivalences between data structures. Our library then takes care of the (sometimes, heavy) lifting that leads to interoperable programs. It thus becomes possible, as we shall illustrate, to internalize and hand-tune the extraction of dependently-typed programs to interoperable OCaml programs within Coq itself.
- T. Altenkirch, C. McBride, and W. Swierstra. Observational equality, now! In Proceedings of the ACM Workshop on Programming Languages meets Program Verification (PLPV 2007), pages 57–68, Freiburg, Germany, Oct. 2007. Google Scholar
Digital Library
- S. Awodey and A. Bauer. Propositions as {types}. Journal of Logic and Computation, 14(4):447–471, 2004. 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. Bénabou. Introduction to bicategories. In Reports of the Midwest Category Seminar, pages 1–77. Springer-Verlag, 1967.Google Scholar
- E. Brady, C. McBride, and J. McKinna. Types for Proofs and Programs, volume 3085 of Lecture Notes in Computer Science, chapter Inductive Families Need Not Store Their Indices, pages 115–129. Springer-Verlag, 2004.Google Scholar
- A. Chlipala. Certified Programming with Dependent Types. MIT Press, 2013. Google Scholar
Digital Library
- C. Cohen, M. Dénès, and A. Mörtberg. Refinements for free! In Proceedings of the 3rd International Conference on Certified Programs and Proofs (CPP 2013), pages 147–162, Melbourne, Australia, Dec. 2013. Google Scholar
Digital Library
- P.-E. Dagand and C. McBride. Transporting functions across ornaments. In Proceedings of the 17th ACM SIGPLAN Conference on Functional Programming (ICFP 2012), pages 103–114, Copenhagen, Denmark, Sept. 2012. ACM Press. Google Scholar
Digital Library
- B. Delaware, C. Pit-Claudel, J. Gross, and A. Chlipala. Fiat: Deductive synthesis of abstract data types in a proof assistant. In Proceedings of the 42nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2015), pages 689–700, Mumbai, India, Jan. 2015. ACM Press. Google Scholar
Digital Library
- 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 Conference on Functional Programming (ICFP 2002), pages 48–59, Pittsburgh, PA, USA, Sept. 2002. ACM Press. Google Scholar
Digital Library
- R. Garcia, A. M. Clark, and É. Tanter. Abstracting gradual typing. In Proceedings of the 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2016), pages 429–442, St Petersburg, FL, USA, Jan. 2016. ACM Press. 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
- J. M. E. Hyland. First steps in synthetic domain theory. In Proceedings of the International Conference on Category Theory, pages 131–156, Como, Italy, July 1991. Springer-Verlag.Google Scholar
Cross Ref
- 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
- H.-S. Ko and J. Gibbons. Relational algebraic ornaments. In Proceedings of the ACM SIGPLAN Workshop on Dependently Typed Programming (DTP 2013), pages 37–48. ACM Press, 2013. Google Scholar
Digital Library
- P. Letouzey. Programmation fonctionnelle certifiée – L’extraction de programmes dans l’assistant Coq. PhD thesis, Université Paris-Sud, July 2004.Google Scholar
- J. Matthews and R. B. Findler. Operational semantics for multi-language programs. In Proceedings of the 34th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2007), pages 3–10, Nice, France, Jan. 2007. ACM Press. Google Scholar
Digital Library
- C. McBride. Ornamental algebras, algebraic ornaments. Technical report, University of Strathclyde, 2010.Google Scholar
- P.-M. Osera, V. Sjöberg, and S. Zdancewic. Dependent interoperability. In Proceedings of the 6th workshop on Programming Languages Meets Program Verification (PLPV 2012), pages 3–14. ACM Press, 2012. 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
- P. M. Rondon, M. Kawaguchi, and R. Jhala. Liquid types. In R. Gupta and S. P. Amarasinghe, editors, Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2008), pages 159–169. ACM Press, June 2008. Google Scholar
Digital Library
- T. Sekiyama, Y. Nishida, and A. Igarashi. Manifest contracts for datatypes. In Proceedings of the 42nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2015), pages 195–207, Mumbai, India, Jan. 2015. ACM Press. 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 and N. Oury. First-class type classes. In Proceedings of the 21st International Conference on Theorem Proving in Higher-Order Logics, pages 278–293, Montreal, Canada, Aug. 2008. Google Scholar
Digital Library
- W. Swierstra and J. Alpuim. From proposition to program - embedding the refinement calculus in Coq. In Proceedings of the 13th International Symposium on Functional and Logic Programming (FLOPS 2016), pages 29–44, Kochi, Japan, Mar. 2016.Google Scholar
- É. Tanter and N. Tabareau. Gradual certified programming in Coq. In Proceedings of the 11th ACM Dynamic Languages Symposium (DLS 2015), pages 26–40, Pittsburgh, PA, USA, Oct. 2015. ACM Press. Google Scholar
Digital Library
- The Coq Development Team. The Coq proof assistant reference manual. 2015.Google Scholar
- P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In Proceedings of the 16th ACM Symposium on Principles of Programming Languages (POPL 89), pages 60–76, Austin, TX, USA, Jan. 1989. ACM Press. Google Scholar
Digital Library
- T. Williams, P. Dagand, and D. Rémy. Ornaments in practice. In J. P. Magalh˜aes and T. Rompf, editors, Proceedings of the 10th ACM SIGPLAN Workshop on Generic Programming (WGP 2014), pages 15–24, Gothenburg, Sweden, Aug. 2014. ACM Press. Google Scholar
Digital Library
Index Terms
Partial type equivalences for verified dependent interoperability
Recommendations
Partial type equivalences for verified dependent interoperability
ICFP 2016: Proceedings of the 21st ACM SIGPLAN International Conference on Functional ProgrammingFull-spectrum dependent types promise to enable the development of correct-by-construction software. However, even certified software needs to interact with simply-typed or untyped programs, be it to perform system calls, or to use legacy libraries. ...
Dependent interoperability
PLPV '12: Proceedings of the sixth workshop on Programming languages meets program verificationIn this paper we study the problem of interoperability --- combining constructs from two separate programming languages within one program --- in the case where one of the two languages is dependently typed and the other is simply typed.We present a ...
A Partial Type Checking Algorithm for Type
We analyze a partial type checking algorithm for the inconsistent domain-free pure type system Type:Type (λ*). We show that the algorithm is sound and partially complete using a coinductive specification of algorithmic equality. This entails that the ...







Comments