skip to main content
10.1145/2814228.2814239acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Type systems for the masses: deriving soundness proofs and efficient checkers

Published: 21 October 2015 Publication History

Abstract

The correct definition and implementation of non-trivial type systems is difficult and requires expert knowledge, which is not available to developers of domain-specific languages (DSLs) in practice. We propose Veritas, a workbench that simplifies the development of sound type systems. Veritas provides a single, high-level specification language for type systems, from which it automatically tries to derive soundness proofs and efficient and correct type-checking algorithms. For verification, Veritas combines off-the-shelf automated first-order theorem provers with automated proof strategies specific to type systems. For deriving efficient type checkers, Veritas provides a collection of optimization strategies whose applicability to a given type system is checked through verification on a case-by-case basis. We have developed a prototypical implementation of Veritas and used it to verify type soundness of the simply-typed lambda calculus and of parts of typed SQL. Our experience suggests that many of the individual verification steps can be automated and, in particular, that a high degree of automation is possible for type systems of DSLs.

References

[1]
Markus Aderhold. Automated synthesis of induction axioms for programs with second-order recursion. In Proceedings of International Joint Conference on Automated Reasoning, volume 6173 of LNCS, pages 263–277. Springer, 2010.
[2]
Jonathan Aldrich, Robert J. Simmons, and Key Shin. SASyLF: an educational proof assistant for language theory. In Proceedings of the 2008 International Workshop on Functional and Declarative Programming in Education, pages 31–40. ACM, 2008.
[3]
Brian E. Aydemir, Aaron Bohannon, Matthew Fairbairn, J. Nathan Foster, Benjamin C. Pierce, Peter Sewell, Dimitrios Vytiniotis, Geoffrey Washburn, Stephanie Weirich, and Steve Zdancewic. Mechanized Metatheory for the Masses: The P OPL M ARK Challenge. In Proceedings of International Conference on Theorem Proving in Higher Order Logics (TPHOL), pages 50–65. Springer-Verlag, 2005.
[4]
Tom Bergan. Typmix: A framework for implementing modular, extensible type systems. Master’s thesis, UCLA, 2007.
[5]
Stefan Berghofer. A solution to the P OPL M ARK challenge using de Bruijn indices in Isabelle/HOL. Automated Reasoning, 49(3):303–326, 2012.
[6]
N. G. De Bruijn. Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the church-rosser theorem. Indagationes Mathematicae, 34:381–392, 1972.
[7]
Arthur Charguéraud. The locally nameless representation. Automated Reasoning, 49(3):363–408, 2012.
[8]
Alberto Ciaffaglione and Ivan Scagnetto. A weak HOAS approach to the P OPL M ARK challenge. In Proceedings of Workshop on Logical and Semantic Frameworks with Applications (LSFA), pages 109–124, 2012.
[9]
Koen Claessen and John Hughes. Quickcheck: A lightweight tool for random testing of Haskell programs. In Proceedings of International Conference on Functional Programming (ICFP), pages 268–279. ACM, 2000.
[10]
Benjamin Delaware, Steven Keuchel, Tom Schrijvers, and Bruno C.d.S. Oliveira. Modular monadic meta-theory. In Proceedings of International Conference on Functional Programming (ICFP), pages 319–330. ACM, 2013.
[11]
Sebastian Erdweg, Stefan Fehrenbach, and Klaus Ostermann. Evolution of software systems with extensible languages and DSLs. IEEE Software, 31(5):68–75, 2014.
[12]
Sebastian Erdweg and Felix Rieger. A framework for extensible languages. In Proceedings of Conference on Generative Programming and Component Engineering (GPCE), pages 3–12. ACM, 2013.
[13]
Sebastian Erdweg, Tijs van der Storm, Markus Völter, Meinte Boersma, Remi Bosman, William R. Cook, Albert Gerritsen, Angelo Hulshout, Steven Kelly, Alex Loh, Gabriël Konat, Pedro J. Molina, Martin Palatnik, Risto Pohjonen, Eugen Schindler, Klemens Schindler, Riccardo Solmi, Vlad Vergu, Eelco Visser, Kevin van der Vlist, Guido Wachsmuth, and Jimi van der Woning. The state of the art in language workbenches. In Proceedings of Conference on Software Language Engineering (SLE), volume 8225 of LNCS, pages 197–217. Springer, 2013.
[14]
Sascha Fahl, Marian Harbach, Thomas Muders, Matthew Smith, Lars Baumgärtner, and Bernd Freisleben. Why Eve and Mallory love Android: An analysis of android SSL (in)security. In Proceedings of Conference on Computer and Communications Security (CCS), pages 50–61. ACM, 2012.
[15]
Martin Fowler. Domain-Specific Languages. Addison Wesley, 2010.
[16]
Holger Gast. A generator for type checkers. PhD thesis, University of Tübingen, 2004.
[17]
Robert Harper and Daniel R. Licata. Mechanizing metatheory in a logical framework. Functional Programming, pages 613– 673, 2007.
[18]
Bastiaan Heeren, Jurriaan Hage, and S. Doaitse Swierstra. Scripting the type inference process. In Proceedings of International Conference on Functional Programming (ICFP), pages 3–13. ACM, 2003.
[19]
Lennart C. L. Kats and Eelco Visser. The Spoofax language workbench: Rules for declarative specification of languages and IDEs. In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 444–463. ACM, 2010.
[20]
Laura Kovács and Andrei Voronkov. First-order theorem proving and vampire. In Proceedings of International Conference on Computer Aided Verification (CAV), pages 1–35. Springer, 2013.
[21]
K. Rustan M. Leino. Automating induction with an SMT solver. In Proceedings of Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI), volume 7148 of LNCS, pages 315–331. Springer, 2012.
[22]
Xavier Leroy. Java bytecode verification: Algorithms and formalizations. Automated Reasoning, 30(3-4):235–269, 2003.
[23]
Xavier Leroy. A locally nameless solution to the P OPL M ARK challenge. Technical Report 6098, INRIA, 2007.
[24]
Florian Lorenzen and Sebastian Erdweg. Modular and automated type-soundness verification for language extensions. In Proceedings of International Conference on Functional Programming (ICFP), pages 331–342. ACM, 2013.
[25]
Ralf Mitschke, Sebastian Erdweg, Mirko Köhler, Mira Mezini, and Guido Salvaneschi. i3QL: Language-integrated live data views. In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 417–432. ACM, 2014.
[26]
Francisco Ortin, Daniel Zapico, Jose Quiroga, and Miguel Garcia. Automatic generation of object-oriented type checkers. Lecture Notes on Software Engineering, 2(4), 2014.
[27]
Frank Pfenning and Conal Elliott. Higher-order abstract syntax. In Proceedings of Conference on Programming Language Design and Implementation (PLDI), pages 199–208. ACM, 1988.
[28]
Benjamin C Pierce. Types and programming languages. MIT press, 2002.
[29]
Andrew M. Pitts. Nominal logic, a first order theory of names and binding. Information and Computation, 186(2):165–193, 2003.
[30]
Andrew Reynolds and Viktor Kuncak. On induction for SMT solvers. Technical Report 201755, EPFL, 2014.
[31]
Michael Roberson, Melanie Harries, Paul T. Darga, and Chandrasekhar Boyapati. Efficient software model checking of soundness of type systems. In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 493–504. ACM, 2008.
[32]
Carsten Schürmann and Frank Pfenning. Automated theorem proving in a simple meta-logic for LF. In Proceedings of International Conference on Automated Deduction (CADE), volume 1421 of LNCS, pages 286–300. Springer, 1998.
[33]
Peter Sewell, Francesco Zappa Nardelli, Scott Owens, Gilles Peskine, Thomas Ridge, Susmit Sarkar, and Rok Strniša. Ott: Effective tool support for the working semanticist. Functional Programming, 20(1):71–122, 2010.
[34]
Geoff Sutcliffe. The TPTP problem library and associated infrastructure: The FOF and CNF parts, v3.5.0. Automated Reasoning, 43(4):337–362, 2009.
[35]
Don Syme and Andrew D. Gordon. Automating type soundness proofs via decision procedures and guided reductions. In Proceedings of Logic for Programming, Artificial Intelligence, and Reasoning, pages 418–434. Springer, 2002.
[36]
Aaron Tomb and Cormac Flanagan. Automatic type inference via partial evaluation. In Proceedings of Conference on Principles and Practice of Declarative Programming (PPDP), pages 106–116. ACM, 2005.
[37]
Jeroen van den Bos and Tijs van der Storm. Bringing domainspecific languages to digital forensics. In Proceedings of International Conference on Software Engineering (ICSE), pages 671–680. ACM, 2011.
[38]
Eelco Visser, Guido Wachsmuth, Andrew P. Tolmach, Pierre Neron, Vlad A. Vergu, Augusto Passalaqua, and Gabrieël Konat. A language designer’s workbench: A one-stop-shop for implementation and verification of language designs. In Proceedings of Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software (ONWARD), pages 95––111. ACM, 2014.
[39]
Jérôme Vouillon. A solution to the P OPL M ARK challenge based on de Bruijn indices. Automated Reasoning, 49(3):327– 362, 2012.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Onward! 2015: 2015 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward!)
October 2015
307 pages
ISBN:9781450336888
DOI:10.1145/2814228
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 October 2015

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Type systems
  2. first-order theorem proving
  3. type checking
  4. type soundness

Qualifiers

  • Research-article

Conference

SPLASH '15
Sponsor:

Acceptance Rates

Overall Acceptance Rate 40 of 105 submissions, 38%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)3
Reflects downloads up to 27 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Language-parameterized Proofs for Functional Languages with SubtypingFunctional and Logic Programming10.1007/978-981-97-2300-3_15(291-310)Online publication date: 15-May-2024
  • (2023)A Declarative Validator for GSOS LanguagesElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.378.2378(14-25)Online publication date: 13-Apr-2023
  • (2023)Towards the Complexity Analysis of Programming Language Proof MethodsTheoretical Aspects of Computing – ICTAC 202310.1007/978-3-031-47963-2_8(100-118)Online publication date: 4-Dec-2023
  • (2023)Testing Languages with a Languages-as-Databases ApproachTests and Proofs10.1007/978-3-031-38828-6_7(108-126)Online publication date: 18-Jul-2023
  • (2022)Lang-n-Prove: A DSL for Language ProofsProceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3567512.3567514(16-29)Online publication date: 29-Nov-2022
  • (2022)A Query Language for Language AnalysisSoftware Engineering and Formal Methods10.1007/978-3-031-17108-6_4(57-73)Online publication date: 26-Sep-2022
  • (2022)A Calculus for Multi-language Operational SemanticsSoftware Verification10.1007/978-3-030-95561-8_3(25-42)Online publication date: 22-Feb-2022
  • (2020)A systematic approach to deriving incremental type checkersProceedings of the ACM on Programming Languages10.1145/34281954:OOPSLA(1-28)Online publication date: 13-Nov-2020
  • (2017)Rewriting for sound and complete union, intersection and negation typesACM SIGPLAN Notices10.1145/3170492.313604252:12(117-130)Online publication date: 23-Oct-2017
  • (2017)Intrinsically-typed definitional interpreters for imperative languagesProceedings of the ACM on Programming Languages10.1145/31581042:POPL(1-34)Online publication date: 27-Dec-2017
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media