Abstract
Gradualizing the Calculus of Inductive Constructions (CIC) involves dealing with subtle tensions between normalization, graduality, and conservativity with respect to CIC. Recently, GCIC has been proposed as a parametrized gradual type theory that admits three variants, each sacrificing one of these properties. For devising a gradual proof assistant based on CIC, normalization and conservativity with respect to CIC are key, but the tension with graduality needs to be addressed. Additionally, several challenges remain: (1) The presence of two wildcard terms at any type---the error and unknown terms---enables trivial proofs of any theorem, jeopardizing the use of a gradual type theory in a proof assistant; (2) Supporting general indexed inductive families, most prominently equality, is an open problem; (3) Theoretical accounts of gradual typing and graduality so far do not support handling type mismatches detected during reduction; (4) Precision and graduality are external notions not amenable to reasoning within a gradual type theory. All these issues manifest primally in CastCIC, the cast calculus used to define GCIC. In this work, we present an extension of CastCIC called GRIP. GRIP is a reasonably gradual type theory that addresses the issues above, featuring internal precision and general exception handling. By adopting a novel interpretation of the unknown term that carefully accounts for universe levels, GRIP satisfies graduality for a large and well-defined class of terms, in addition to being normalizing and a conservative extension of CIC. Internal precision supports reasoning about graduality within GRIP itself, for instance to characterize gradual exception-handling terms, and supports gradual subset types. We develop the metatheory of GRIP using a model formalized in Coq, and provide a prototype implementation of GRIP in Agda.
- Andreas Abel and Gabriel Scherer. 2012. On Irrelevance and Algorithmic Equality in Predicative Type Theory. Logical Methods in Computer Science, Volume 8, Issue 1 (2012), 3, https://doi.org/10.2168/LMCS-8(1:29)2012
Google Scholar
Cross Ref
- Thorsten Altenkirch, Neil Ghani, Peter G. Hancock, Conor McBride, and Peter Morris. 2015. Indexed containers. J. Funct. Program., 25 (2015), https://doi.org/10.1017/S095679681500009X
Google Scholar
- Thorsten Altenkirch, Conor McBride, and Wouter Swierstra. 2007. Observational equality, now!. In Proceedings of the Workshop on Programming Languages meets Program Verification (PLPV 2007). 57–68. https://doi.org/10.1145/1292597.1292608
Google Scholar
Digital Library
- Jean-Philippe Bernardy, Patrik Jansson, and Ross Paterson. 2012. Proofs for free: Parametricity for dependent types. Journal of Functional Programming, 22, 2 (2012), March, 107–152. https://doi.org/10.1017/S0956796812000056
Google Scholar
Digital Library
- 2016. Proceedings of the 43rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2016), Rastislav Bodík and Rupak Majumdar (Eds.). ACM Press, St Petersburg, FL, USA. isbn:978-1-4503-3549-2 https://doi.org/10.1145/2837614
Google Scholar
Digital Library
- Simon Boulier, Pierre-Marie Pédrot, and Nicolas Tabareau. 2017. The next 700 syntactical models of type theory. In Proceedings of the 6th ACM SIGPLAN Conference on Certified Programs and Proofs, CPP 2017, Paris, France, January 16-17, 2017. 182–194. https://doi.org/10.1145/3018610.3018620
Google Scholar
Digital Library
- Chris Casinghino, Vilhelm Sjöberg, and Stephanie Weirich. 2014. Combining proofs and programs in a dependently typed language. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2014). ACM Press, San Diego, CA, USA. 671–684. isbn:978-1-4503-2544-8 https://doi.org/10.1145/2535838.2535883
Google Scholar
Digital Library
- Cyril Cohen, Thierry Coquand, Simon Huber, and Anders Mörtberg. 2017. Cubical Type Theory: A Constructive Interpretation of the Univalence Axiom. FLAP, 4, 10 (2017), 3127–3170. http://collegepublications.co.uk/ifcolog/?00019
Google Scholar
- Pierre-Évariste Dagand, Nicolas Tabareau, and Éric Tanter. 2018. Foundations of Dependent Interoperability. Journal of Functional Programming, 28 (2018), 9:1–9:44. https://doi.org/10.1017/S0956796818000011
Google Scholar
Cross Ref
- Richard A. Eisenberg. 2016. Dependent Types in Haskell: Theory and Practice. arxiv:1610.07978.
Google Scholar
- Joseph Eremondi, Ronald Garcia, and Éric Tanter. 2022. Propositional Equality for Gradual Dependently-Typed Programming. Proceedings of the ACM on Programming Languages, 6, ICFP (2022), Sept., https://doi.org/10.1145/3547627
Google Scholar
Digital Library
- Joseph Eremondi, Éric Tanter, and Ronald Garcia. 2019. Approximate Normalization for Gradual Dependent Types. 88:1–88:30. https://doi.org/10.1145/3341692
Google Scholar
Digital Library
- Ronald Garcia, Alison M. Clark, and Éric Tanter. 2016. Abstracting Gradual Typing. 429–442. isbn:978-1-4503-3549-2 https://doi.org/10.1145/2837614 See erratum: https://www.cs.ubc.ca/ rxg/agt-erratum.pdf.
Google Scholar
Digital Library
- Gaëtan Gilbert, Jesper Cockx, Matthieu Sozeau, and Nicolas Tabareau. 2019. Definitional Proof-Irrelevance without K. Proceedings of the ACM on Programming Languages, 3, POPL (2019), Jan., 1–28. https://doi.org/10.1145/3290316
Google Scholar
Digital Library
- 2020. LICS ’20: 35th Annual ACM/IEEE Symposium on Logic in Computer Science, Saarbrücken, Germany, July 8-11, 2020, Holger Hermanns, Lijun Zhang, Naoki Kobayashi, and Dale Miller (Eds.). ACM Press. isbn:978-1-4503-7104-9 https://doi.org/10.1145/3373718
Google Scholar
Digital Library
- Jasper Hugunin. 2020. Why Not W? In 26th International Conference on Types for Proofs and Programs, TYPES 2020, March 2-5, 2020, University of Turin, Italy, Ugo de’Liguoro, Stefano Berardi, and Thorsten Altenkirch (Eds.) (LIPIcs, Vol. 188). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 8:1–8:9. isbn:978-3-95977-182-5 https://doi.org/10.4230/LIPIcs.TYPES.2020.8
Google Scholar
Cross Ref
- 2019. Proceedings of the 24th ACM SIGPLAN Conference on Functional Programming (ICFP 2019). 3, ACM Press.
Google Scholar
- Garrin Kimmell, Aaron Stump, Harley D. Eades III, Peng Fu, Tim Sheard, Stephanie Weirich, Chris Casinghino, Vilhelm Sjöberg, Nathan Collins, and Ki Yung Ahn. 2012. Equational reasoning about programs with general recursion and call-by-value semantics. In Proceedings of the 6th workshop on Programming Languages Meets Program Verification (PLPV 2012). ACM Press, 15–26. https://doi.org/10.1145/2103776.2103780
Google Scholar
Digital Library
- Kenneth Knowles and Cormac Flanagan. 2010. Hybrid type checking. ACM Transactions on Programming Languages and Systems, 32, 2 (2010), Jan., Article n.6. https://doi.org/10.1145/1111037.1111059
Google Scholar
Digital Library
- Bill Lawvere. 1970. Equality in hyperdoctrines and comprehension schema as an adjoint functor. In Proceedings of the AMS Symposium on Pure Mathematics XVII. 1–14.
Google Scholar
Cross Ref
- Nico Lehmann and Éric Tanter. 2017. Gradual Refinement Types. In Proceedings of the 44th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2017). ACM Press, Paris, France. 775–788. https://doi.org/10.1145/3009837.3009856
Google Scholar
Digital Library
- Meven Lennon-Bertrand, Kenji Maillard, Nicolas Tabareau, and Éric Tanter. 2022. Gradualizing the Calculus of Inductive Constructions. ACM Transactions on Programming Languages and Systems, 44, 2 (2022), June, https://doi.org/10.1145/3495528
Google Scholar
Digital Library
- Per Martin-Löf. 1971. An Intuitionistic Theory of Types. Unpublished manuscript.
Google Scholar
- Max S. New and Amal Ahmed. 2018. Graduality from Embedding-Projection Pairs. In Proceedings of the 23rd ACM SIGPLAN Conference on Functional Programming (ICFP 2018). Proceedings of the ACM on Programming Languages, 2, 73:1–73:30. https://doi.org/10.1145/3236768
Google Scholar
Digital Library
- Peter-Michael Osera, Vilhelm Sjöberg, and Steve Zdancewic. 2012. Dependent Interoperability. In Proceedings of the 6th workshop on Programming Languages Meets Program Verification (PLPV 2012). ACM Press, 3–14. https://doi.org/10.1145/2103776.2103779
Google Scholar
Digital Library
- Xinming Ou, Gang Tan, Yitzhak Mandelbaum, and David Walker. 2004. Dynamic Typing with Dependent Types. In Proceedings of the IFIP International Conference on Theoretical Computer Science. 437–450. https://doi.org/10.1007/1-4020-8141-3_34
Google Scholar
Cross Ref
- Pierre-Marie Pédrot and Nicolas Tabareau. 2017. An effectful way to eliminate addiction to dependence. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, June 20-23, 2017. IEEE Computer Society, 1–12. https://doi.org/10.1109/LICS.2017.8005113
Google Scholar
Cross Ref
- Pierre-Marie Pédrot and Nicolas Tabareau. 2018. Failure is Not an Option - An Exceptional Type Theory. In Proceedings of the 27th European Symposium on Programming Languages and Systems (ESOP 2018), Amal Ahmed (Ed.) (Lecture Notes in Computer Science, Vol. 10801). Springer-Verlag, Thessaloniki, Greece. 245–271. https://doi.org/10.1007/978-3-319-89884-1_9
Google Scholar
Cross Ref
- Pierre-Marie Pédrot and Nicolas Tabareau. 2020. The fire triangle: how to mix substitution, dependent elimination, and effects. Proceedings of the ACM on Programming Languages, 4, POPL (2020), Jan., 58:1–58:28. https://doi.org/10.1145/3371126
Google Scholar
Digital Library
- Pierre-Marie Pédrot, Nicolas Tabareau, Hans Fehrmann, and Éric Tanter. 2019. A Reasonably Exceptional Type Theory. 108:1–108:29. https://doi.org/10.1145/3341712
Google Scholar
Digital Library
- Loïc Pujet and Nicolas Tabareau. 2022. Observational Equality: Now For Good. Proceedings of the ACM on Programming Languages, 6, POPL (2022), Jan., https://doi.org/10.1145/3498693
Google Scholar
Digital Library
- Emily Riehl and Michael Shulman. 2017. A type theory for synthetic ∞-categories. Higher Structures, 1 (2017), 147–223 (78). issn:2209-0606
Google Scholar
Cross Ref
- Patrick Maxim Rondon, Ming Kawaguchi, and Ranjit Jhala. 2008. Liquid types. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2008), Rajiv Gupta and Saman P. Amarasinghe (Eds.). ACM Press, 159–169. https://doi.org/10.1145/1375581.1375602
Google Scholar
Digital Library
- Christian Sattler and Andrea Vezzosi. 2020. Partial Univalence in n-truncated Type Theory. 807–819. isbn:978-1-4503-7104-9 https://doi.org/10.1145/3373718.3394759
Google Scholar
Digital Library
- Jeremy Siek and Walid Taha. 2006. Gradual Typing for Functional Languages. In Proceedings of the Scheme and Functional Programming Workshop. 81–92.
Google Scholar
- Jeremy Siek and Philip Wadler. 2010. Threesomes, with and without blame. In Proceedings of the 37th annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2010). ACM Press, Madrid, Spain. 365–376. https://doi.org/10.1145/1706299.1706342
Google Scholar
Digital Library
- Jeremy G. Siek, Michael M. Vitousek, Matteo Cimini, and John Tang Boyland. 2015. Refined Criteria for Gradual Typing. In 1st Summit on Advances in Programming Languages (SNAPL 2015) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 32). Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Asilomar, California, USA. 274–293. https://doi.org/10.4230/LIPIcs.SNAPL.2015.274
Google Scholar
Cross Ref
- Aaron Stump, Vilhelm Sjöberg, and Stephanie Weirich. 2010. Termination Casts: A Flexible Approach to Termination with General Recursion. In Proceedings Workshop on Partiality and Recursion in Interactive Theorem Provers (PAR 2010). 76–93. https://doi.org/10.29007/3w36
Google Scholar
Cross Ref
- Nikhil Swamy, Catalin Hritcu, Chantal Keller, Aseem Rastogi, Antoine Delignat-Lavaud, Simon Forest, Karthikeyan Bhargavan, Cédric Fournet, Pierre-Yves Strub, Markulf Kohlweiss, Jean Karim Zinzindohoue, and Santiago Zanella Béguelin. 2016. Dependent types and multi-effects in F^⋆. 256–270. isbn:978-1-4503-3549-2 https://doi.org/10.1145/2837614
Google Scholar
Digital Library
- M. Takahashi. 1995. Parallel Reductions in λ -Calculus. Information and Computation, 118, 1 (1995), 120 – 127. issn:0890-5401 https://doi.org/10.1006/inco.1995.1057
Google Scholar
Digital Library
- Éric Tanter and Nicolas Tabareau. 2015. Gradual Certified Programming in Coq. In Proceedings of the 11th ACM Dynamic Languages Symposium (DLS 2015). ACM Press, Pittsburgh, PA, USA. 26–40. https://doi.org/10.1145/2816707.2816710
Google Scholar
Digital Library
- The Coq Development Team. 2020. The Coq proof assistant reference manual. https://coq.inria.fr/refman/ Version 8.12.
Google Scholar
- Andrea Vezzosi, Anders Mörtberg, and Andreas Abel. 2019. Cubical Agda: A Dependently Typed Programming Language with Univalence and Higher Inductive Types. Proc. ACM Program. Lang., 3, ICFP (2019), Article 87, July, 29 pages. https://doi.org/10.1145/3341691
Google Scholar
Digital Library
- Philip Wadler and Robert Bruce Findler. 2009. Well-Typed Programs Can’t Be Blamed. In Proceedings of the 18th European Symposium on Programming Languages and Systems (ESOP 2009), Giuseppe Castagna (Ed.) (Lecture Notes in Computer Science, Vol. 5502). Springer-Verlag, York, UK. 1–16. https://doi.org/10.1007/978-3-642-00590-9_1
Google Scholar
Digital Library
- Matthew Z. Weaver and Daniel R. Licata. 2020. A Constructive Model of Directed Univalence in Bicubical Sets. 915–928. isbn:978-1-4503-7104-9 https://doi.org/10.1145/3373718.3394794
Google Scholar
Digital Library
- Hongwei Xi and Frank Pfenning. 1998. Eliminating array bound checking through dependent types. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’98). ACM Press, 249–257. https://doi.org/10.1145/277650.277732
Google Scholar
Digital Library
Index Terms
A reasonably gradual type theory
Recommendations
Gradual type theory
Gradually typed languages are designed to support both dynamically typed and statically typed programming styles while preserving the benefits of each. While existing gradual type soundness theorems for these languages aim to show that type-based ...
Principal Type Schemes for Gradual Programs
POPL '15: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesGradual typing is a discipline for integrating dynamic checking into a static type system. Since its introduction in functional languages, it has been adapted to a variety of type systems, including object-oriented, security, and substructural. This ...
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 ...






Comments