skip to main content
article

Partial type equivalences for verified dependent interoperability

Published:04 September 2016Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Awodey and A. Bauer. Propositions as {types}. Journal of Logic and Computation, 14(4):447–471, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. J. Bénabou. Introduction to bicategories. In Reports of the Midwest Category Seminar, pages 1–77. Springer-Verlag, 1967.Google ScholarGoogle Scholar
  5. 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 ScholarGoogle Scholar
  6. A. Chlipala. Certified Programming with Dependent Types. MIT Press, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. T. Disney and C. Flanagan. Gradual information flow typing. In International Workshop on Scripts to Programs, 2011.Google ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. G. Gonthier and A. Mahbouhi. An introduction to small scale reflection in Coq. Journal of Formalized Reasoning, 3(2):95–152, 2010.Google ScholarGoogle Scholar
  15. 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 ScholarGoogle ScholarCross RefCross Ref
  16. K. Knowles and C. Flanagan. Hybrid type checking. ACM Transactions on Programming Languages and Systems, 32(2):Article n.6, Jan. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. P. Letouzey. Programmation fonctionnelle certifiée – L’extraction de programmes dans l’assistant Coq. PhD thesis, Université Paris-Sud, July 2004.Google ScholarGoogle Scholar
  19. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. McBride. Ornamental algebras, algebraic ornaments. Technical report, University of Strathclyde, 2010.Google ScholarGoogle Scholar
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarCross RefCross Ref
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle Scholar
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle Scholar
  28. É. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  29. The Coq Development Team. The Coq proof assistant reference manual. 2015.Google ScholarGoogle Scholar
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Partial type equivalences for verified dependent interoperability

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 51, Issue 9
        ICFP '16
        September 2016
        501 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/3022670
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP 2016: Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming
          September 2016
          501 pages
          ISBN:9781450342193
          DOI:10.1145/2951913

        Copyright © 2016 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 4 September 2016

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!