Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

A Modular Type Reconstruction Algorithm

Published: 08 December 2018 Publication History

Abstract

Mmt is a framework for designing and implementing formal systems in a way that systematically abstracts from theoretical and practical aspects of their type of theoretical and logical foundations. Thus, definitions, theorems, and algorithms can be stated independently of the foundation, and language designers can focus on the essentials of a particular foundation and inherit a large-scale implementation from Mmt at low cost. Going beyond the similarly motivated approach of meta-logical frameworks, Mmt does not even commit to a particular meta-logic—that makes Mmt level results harder to obtain but also more general.
We present one such result: a type reconstruction algorithm that realizes the foundation-independent aspects generically relative to a set of rules that supply the foundation-specific knowledge. Maybe surprisingly, we see that the former covers most of the algorithm, including the most difficult details. Thus, we can easily instantiate our algorithm with rule sets for several important language features including, e.g., dependent function types. Moreover, our design is modular such that we obtain a type reconstruction algorithm for any combination of these features.

References

[1]
A. Asperti, C. Sacerdoti Coen, E. Tassi, and S. Zacchiroli. 2006. Crafting a proof assistant. In TYPES, T. Altenkirch and C. McBride (Eds.). Springer, 18--32.
[2]
A. Avron, F. Honsell, I. Mason, and R. Pollack. 1992. Using typed lambda calculus to implement formal systems on a machine. Journal of Automated Reasoning 9, 3, 309--354.
[3]
A. Asperti, W. Ricciotti, C. Sacerdoti Coen, and E. Tassi. 2009. Hints in unification. In Theorem Proving in Higher Order Logics, S. Berghofer, T. Nipkow, C. Urban, and M. Wenzel (Eds.). Springer, 84--98.
[4]
A. Asperti, W. Ricciotti, C. Sacerdoti Coen, and E. Tassi. 2012. A bi-directional refinement algorithm for the calculus of (co)inductive constructions. Logical Methods in Computer Science 8, 1.
[5]
M. Boespflug, Q. Carbonneaux, and O. Hermant. 2012. The λΠ-calculus modulo as a universal proof language. In Proceedings of PxTP2012: Proof Exchange for Theorem Proving, D. Pichardie and T. Weber (Eds.). 28--43.
[6]
S. Berardi. 1990. Type dependence and Constructive Mathematics. PhD thesis, Dipartimento di Matematica, Università di Torino.
[7]
J. Blanchette, C. Kaliszyk, L. Paulson, and J. Urban. 2016. Hammering towards QED. Journal of Formalized Reasoning 9, 1, 101--148.
[8]
E. Brady. 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. Journal of Functional Programming 23, 5, 552--593.
[9]
D. Christiansen and E. Brady. 2016. Elaborator reflection: Extending idris in idris. In International Conference on Functional Programming, J. Garrigue, G. Keller, and E. Sumii (Eds.). ACM, 284--297.
[10]
D. Cousineau and G. Dowek. 2007. Embedding pure type systems in the lambda-pi-calculus modulo. In Typed Lambda Calculi and Applications, S. Ronchi Della Rocca (Ed.). Springer. 102--117.
[11]
Coq Development Team. 2015. The Coq Proof Assistant: Reference Manual. Technical report, INRIA.
[12]
C. Dunchev, F. Guidi, C. Sacerdoti Coen, and E. Tassi. 2015. ELPI: Fast, embeddable, lambda-prolog interpreter. In Logic for Programming, Artificial Intelligence, and Reasoning, M. Davis, A. Fehnker, A. McIver, and A. Voronkov (Eds.). 460--468.
[13]
L. de Moura, J. Avigad, S. Kong, and C. Roux. 2015. Elaboration in dependent type theory. Retrieved from https://arxiv.org/abs/1505.04324.
[14]
L. de Moura, S. Kong, J. Avigad, F. van Doorn, and J. von Raumer. 2015. The lean theorem prover (system description). In Automated Deduction, A. Felty and A. Middeldorp (Eds.). Springer, 378--388.
[15]
G. Ebner, S. Ullrich, J. Roesch, J. Avigad, and L. de Moura. 2017. A metaprogramming framework for formal verification. Proceedings of the ACM on Programming Languages, 1, ICFP, 34:1--34:29.
[16]
F. Ferreira and B. Pientka. 2014. Bidirectional elaboration of dependently typed programs. In Principles and Practice of Declarative Programming, O. Chitil, A. King, and O. Danvy (Eds.). 161--174.
[17]
W. Farmer and M. von Mohrenschildt. 2003. An overview of a formal framework for managing mathematics. Annals of Mathematics and Artificial Intelligence 38, 1--3, 165--191.
[18]
A. Gacek. 2008. The Abella interactive theorem prover (system description). In Automated Reasoning, A. Armando, P. Baumgartner, and G. Dowek (Eds.). Springer, 154--161.
[19]
F. Garillot, G. Gonthier, A. Mahboubi, and L. Rideau. 2009. Packaging mathematical structures. In Theorem Proving in Higher Order Logics, S. Berghofer, T. Nipkow, C. Urban, and M. Wenzel (Eds.). Springer, 327--342.
[20]
G. Gonthier and A. Mahboubi. 2008. A Small Scale Reflection Extension for the Coq System. Technical Report RR-6455, INRIA.
[21]
R. Harper, F. Honsell, and G. Plotkin. 1993. A framework for defining logics. Journal of the Association for Computing Machinery 40, 1, 143--184.
[22]
F. Horozal, M. Kohlhase, and F. Rabe. 2011. Extending OpenMath with sequences. In Intelligent Computer Mathematics, Work-in-Progress Proceedings, A. Asperti, J. Davenport, W. Farmer, F. Rabe, and J. Urban (Eds.). University of Bologna, 58--72.
[23]
F. Honsell, L. Liquori, P. Maksimovic, and I. Scagnetto. 2017. LLFP: A logical framework for modeling external evidence, side conditions, and proof irrelevance using monads. Logical Methods in Computer Science 13, 3.
[24]
R. Harper, D. Sannella, and A. Tarlecki. 1994. Structured presentations and logic representations. Annals of Pure and Applied Logic 67, 113--160.
[25]
M. Iancu and F. Rabe. 2012. Management of change in declarative languages. In Intelligent Computer Mathematics, J. Campbell, J. Carette, G. Dos Reis, J. Jeuring, P. Sojka, V. Sorge, and M. Wenzel (Eds.). Springer, 325--340.
[26]
M. Kohlhase, T. Mossakowski, and F. Rabe. 2009. The LATIN Project. Retrieved from https://trac.omdoc.org/LATIN/.
[27]
M. Kohlhase and I. Şucan. 2006. A search engine for mathematical formulae. In Artificial Intelligence and Symbolic Computation, T. Ida, J. Calmet, and D. Wang (Eds.). Springer, 241--253.
[28]
C. Kaliszyk and J. Urban. 2015. HOL(y)hammer: Online ATP service for HOL light. Mathematics in Computer Science 9, 1, 5--22.
[29]
M. Luther. 2001. More on implicit syntax. In Automated Reasoning, R. Goré, A. Leitsch, and T. Nipkow (Eds.). Springer, 386--400.
[30]
J. Meng and L. Paulson. 2008. Translating higher-order clauses to first-order clauses. Journal of Automated Reasoning 40, 1, 35--60.
[31]
U. Norell. 2005. The Agda WiKi. Retrieved from http://wiki.portal.chalmers.se/agda.
[32]
S. Owre, J. Rushby, and N. Shankar. 1992. PVS: A prototype verification system. In 11th International Conference on Automated Deduction (CADE’92), D. Kapur (Ed.). Springer, 748--752.
[33]
L. Paulson. 1994. Isabelle: A Generic Theorem Prover, volume 828 of Lecture Notes in Computer Science. Springer.
[34]
B. Pientka and J. Dunfield. 2010. Beluga: A framework for programming and reasoning with deductive systems (system description). In Automated Reasoning, J. Giesl and R. Hähnle (Eds.). Springer, 15--21.
[35]
B. Pientka. 2013. An insider’s look at LF type reconstruction: Everything you (n)ever wanted to know. Journal of Functional Programming 23, 1, 1--37.
[36]
F. Pfenning and C. Schürmann. 1999. System description: Twelf - a meta-logical framework for deductive systems. In Automated Deduction, H. Ganzinger (Ed.). 202--206.
[37]
A. Poswolsky and C. Schürmann. 2008. System description: Delphin - A functional programming language for deductive systems. In International Workshop on Logical Frameworks and Metalanguages: Theory and Practice, A. Abel and C. Urban (Eds.). ENTCS, 135--141.
[38]
F. Rabe. 2012. A query language for formal mathematical libraries. In Intelligent Computer Mathematics, J. Campbell, J. Carette, G. Dos Reis, J. Jeuring, P. Sojka, V. Sorge, and M. Wenzel (Eds.). Springer, 142--157.
[39]
F. Rabe. 2013. The MMT API: A generic MKM system. In Intelligent Computer Mathematics, J. Carette, D. Aspinall, C. Lange, P. Sojka, and W. Windsteiger (Eds.). Springer, 339--343.
[40]
F. Rabe. 2014. A logic-independent IDE. In Workshop on User Interfaces for Theorem Provers, C. Benzmüller and B. Woltzenlogel Paleo (Eds.). Elsevier, 48--60.
[41]
F. Rabe. 2015. Generic literals. In Intelligent Computer Mathematics, M. Kerber, J. Carette, C. Kaliszyk, F. Rabe, and V. Sorge (Eds.). Springer, 102--117.
[42]
F. Rabe. 2017. How to identify, translate, and combine logics? Journal of Logic and Computation 27, 6, 1753--1798.
[43]
F. Rabe and M. Kohlhase. 2013. A scalable module system. Information and Computation 230, 1, 1--54.
[44]
F. Rabe and C. Schürmann. 2009. A practical module system for LF. In Proceedings of the Workshop on Logical Frameworks: Meta-Theory and Practice (LFMTP’09), J. Cheney and A. Felty (Eds.). ACM Press, 40--48.
[45]
M. Wenzel. 1999. Isar - A generic interpretative approach to readable formal proof documents. In Theorem Proving in Higher Order Logics, Y. Bertot, G. Dowek, A. Hirschowitz, C. Paulin, and L. Théry (Eds.). Springer, 167--184.

Cited By

View all

Index Terms

  1. A Modular Type Reconstruction Algorithm

        Recommendations

        Comments

        Information & Contributors

        Information

        Published In

        cover image ACM Transactions on Computational Logic
        ACM Transactions on Computational Logic  Volume 19, Issue 4
        October 2018
        277 pages
        ISSN:1529-3785
        EISSN:1557-945X
        DOI:10.1145/3293495
        • Editor:
        • Orna Kupferman
        Issue’s Table of Contents
        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].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        Published: 08 December 2018
        Accepted: 01 June 2018
        Revised: 01 January 2018
        Received: 01 April 2017
        Published in TOCL Volume 19, Issue 4

        Permissions

        Request permissions for this article.

        Check for updates

        Author Tags

        1. MMT
        2. Type reconstruction
        3. dependent types
        4. logical framework
        5. modularity

        Qualifiers

        • Research-article
        • Research
        • Refereed

        Funding Sources

        Contributors

        Other Metrics

        Bibliometrics & Citations

        Bibliometrics

        Article Metrics

        • Downloads (Last 12 months)10
        • Downloads (Last 6 weeks)0
        Reflects downloads up to 21 Sep 2024

        Other Metrics

        Citations

        Cited By

        View all

        View Options

        Get Access

        Login options

        Full Access

        View options

        PDF

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        HTML Format

        View this article in HTML Format.

        HTML Format

        Media

        Figures

        Other

        Tables

        Share

        Share

        Share this Publication link

        Share on social media