Abstract
We present λert, a type theory supporting refinement types with <em>explicit proofs</em>. Instead of solving refinement constraints with an SMT solver like DML and Liquid Haskell, our system requires and permits programmers to embed proofs of properties within the program text, letting us support a rich logic of properties including quantifiers and induction. We show that the type system is sound by showing that every refined program erases to a simply-typed program, and by means of a denotational semantics, we show that every erased program has all of the properties demanded by its refined type. All of our proofs are formalised in Lean 4.
- Danel Ahman. 2018. Handling fibred algebraic effects. Proc. ACM Program. Lang., 2, POPL (2018), 7:1–7:29. https://doi.org/10.1145/3158095 Google ScholarDigital Library
- Robert Atkey. 2018. The Syntax and Semantics of Quantitative Type Theory. In LICS ’18: 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, July 9–12, 2018, Oxford, United Kingdom. https://doi.org/10.1145/3209108.3209189 Google ScholarDigital Library
- Steven Awodey and Andrej Bauer. 2004. Propositions as [types]. Journal of logic and computation, 14, 4 (2004), 447–471. Google ScholarDigital Library
- Bruno Barras and Bruno Bernardo. 2008. The implicit calculus of constructions as a programming language with dependent types. In Foundations of Software Science and Computational Structures: 11th International Conference, FOSSACS 2008, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2008, Budapest, Hungary, March 29-April 6, 2008. Proceedings 11. 365–379. Google ScholarCross Ref
- Sa Cui, Kevin Donnelly, and Hongwei Xi. 2005. Ats: A language that combines programming with theorem proving. In Frontiers of Combining Systems: 5th International Workshop, FroCoS 2005, Vienna, Austria, September 19-21, 2005. Proceedings 5. 310–320. Google ScholarDigital Library
- Nicola Gambino and Peter Aczel. 2006. The generalised type-theoretic interpretation of constructive set theory. The Journal of Symbolic Logic, 71, 1 (2006), 67–103. https://doi.org/10.2178/jsl/1140641163 Google ScholarCross Ref
- Robert Harper. 1992. Constructing type systems over an operational semantics. Journal of Symbolic Computation, 14, 1 (1992), 71–84. issn:0747-7171 https://doi.org/10.1016/0747-7171(92)90026-Z Google ScholarDigital Library
- Ranjit Jhala and Niki Vazou. 2020. Refinement Types: A Tutorial. arXiv e-prints, Article arXiv:2010.07763, Oct., arXiv:2010.07763 pages. arxiv:2010.07763. Google Scholar
- Shin-ya Katsumata. 2014. Parametric Effect Monads and Semantics of Effect Systems. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’14). Association for Computing Machinery, New York, NY, USA. 633–645. isbn:9781450325448 https://doi.org/10.1145/2535838.2535846 Google ScholarDigital Library
- Alexei Kopylov. 2003. Dependent Intersection: A New Way of Defining Records in Type Theory. In 18th IEEE Symposium on Logic in Computer Science (LICS 2003), 22-25 June 2003, Ottawa, Canada, Proceedings. IEEE Computer Society, 86–95. https://doi.org/10.1109/LICS.2003.1210048 Google ScholarCross Ref
- Laura Kovács and Andrei Voronkov. 2013. First-Order Theorem Proving and Vampire. In Computer Aided Verification, Natasha Sharygina and Helmut Veith (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 1–35. isbn:978-3-642-39799-8 Google Scholar
- Nicolai Kraus, Martín Escardó, Thierry Coquand, and Thorsten Altenkirch. 2017. Notions of anonymous existence in Martin-Löf type theory. Logical Methods in Computer Science, 13, 1 (2017). Google Scholar
- Satoshi Kura. 2021. A General Semantic Construction of Dependent Refinement Type Systems, Categorically. In Foundations of Software Science and Computation Structures - 24th International Conference, FOSSACS 2021, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2021, Luxembourg City, Luxembourg, March 27 - April 1, 2021, Proceedings, Stefan Kiefer and Christine Tasson (Eds.) (Lecture Notes in Computer Science, Vol. 12650). Springer, 406–426. https://doi.org/10.1007/978-3-030-71995-1_21 Google ScholarDigital Library
- Zhaohui Luo. 1990. An extended calculus of constructions. Ph. D. Dissertation. University of Edinburgh. Google Scholar
- Paul-André Melliès and Noam Zeilberger. 2015. Functors Are Type Refinement Systems. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’15). Association for Computing Machinery, New York, NY, USA. 3–16. isbn:9781450333009 https://doi.org/10.1145/2676726.2676970 Google ScholarDigital Library
- Robin Milner. 1978. A theory of type polymorphism in programming. Journal of computer and system sciences, 17, 3 (1978), 348–375. Google ScholarCross Ref
- Alexandre Miquel. 2000. A model for impredicative type systems, universes, intersection types and subtyping. In Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No. 99CB36332). 18–29. Google ScholarCross Ref
- Eugenio Moggi. 1991. Notions of computation and monads. Information and Computation, 93, 1 (1991), 55–92. issn:0890-5401 https://doi.org/10.1016/0890-5401(91)90052-4 Selections from 1989 IEEE Symposium on Logic in Computer Science Google ScholarDigital Library
- John C. Reynolds. 2003. What do types mean? — From intrinsic to extrinsic semantics. Springer New York, New York, NY. 309–327. isbn:978-0-387-21798-7 https://doi.org/10.1007/978-0-387-21798-7_15 Google ScholarCross Ref
- Patrick M. Rondon, Ming Kawaguci, and Ranjit Jhala. 2008. Liquid Types. SIGPLAN Not., 43, 6 (2008), jun, 159–169. issn:0362-1340 https://doi.org/10.1145/1379022.1375602 Google ScholarDigital Library
- Vilhelm Sjöberg and Stephanie Weirich. 2015. Programming up to Congruence. SIGPLAN Not., 50, 1 (2015), Jan., 369–382. issn:0362-1340 https://doi.org/10.1145/2775051.2676974 Google ScholarDigital Library
- Jonathan Sterling and Robert Harper. 2021. Logical relations as types: Proof-relevant parametricity for program modules. Journal of the ACM (JACM), 68, 6 (2021), 1–47. Google ScholarDigital Library
- Matúš Tejiščák. 2019. Erasure in Dependently Typed Programming. Ph. D. Dissertation. University of St. Andrews. Google Scholar
- The Coq Development Team. 2021. The Coq Proof Assistant. https://doi.org/10.5281/zenodo.4501022 Google ScholarCross Ref
- Benno van den Berg and Martijn den Besten. 2021. Quadratic type checking for objective type theory. arXiv e-prints, Article arXiv:2102.00905, Feb., arXiv:2102.00905 pages. arxiv:2102.00905. Google Scholar
- Niki Vazou and Michael Greenberg. 2022. How to safely use extensionality in Liquid Haskell. In Haskell ’22: 15th ACM SIGPLAN International Haskell Symposium, Ljubljana, Slovenia, September 15 - 16, 2022, Nadia Polikarpova (Ed.). ACM, 13–26. https://doi.org/10.1145/3546189.3549919 Google ScholarDigital Library
- Niki Vazou, Eric L. Seidel, Ranjit Jhala, Dimitrios Vytiniotis, and Simon Peyton-Jones. 2014. Refinement Types for Haskell. SIGPLAN Not., 49, 9 (2014), aug, 269–282. issn:0362-1340 https://doi.org/10.1145/2692915.2628161 Google ScholarDigital Library
- Christoph Weidenbach, Uwe Brahm, Thomas Hillenbrand, Enno Keen, Christian Theobald, and Dalibor Topić. 2002. Spass Version 2.0. In Automated Deduction—CADE-18, Andrei Voronkov (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 275–279. isbn:978-3-540-45620-9 Google Scholar
- Dominik Winterer, Chengyu Zhang, and Zhendong Su. 2020. On the Unusual Effectiveness of Type-Aware Operator Mutations for Testing SMT Solvers. 4, OOPSLA (2020), Article 193, nov, 25 pages. https://doi.org/10.1145/3428261 Google ScholarDigital Library
- Hongwei Xi and Frank Pfenning. 1998. Eliminating Array Bound Checking through Dependent Types. In Proceedings of the ACM SIGPLAN 1998 Conference on Programming Language Design and Implementation (PLDI ’98). Association for Computing Machinery, New York, NY, USA. 249–257. isbn:0897919874 https://doi.org/10.1145/277650.277732 Google ScholarDigital Library
Index Terms
- Explicit Refinement Types
Recommendations
Mechanizing Refinement Types
Practical checkers based on refinement types use the combination of implicit semantic subtyping and parametric polymorphism to simplify the specification and automate the verification of sophisticated properties of programs. However, a formal ...
Gradual refinement types
POPL '17Refinement types are an effective language-based verification technique. However, as any expressive typing discipline, its strength is its weakness, imposing sometimes undesired rigidity. Guided by abstract interpretation, we extend the gradual typing ...
Gradual refinement types
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesRefinement types are an effective language-based verification technique. However, as any expressive typing discipline, its strength is its weakness, imposing sometimes undesired rigidity. Guided by abstract interpretation, we extend the gradual typing ...
Comments