skip to main content
10.1145/2500365.2500579acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Mtac: a monad for typed tactic programming in Coq

Published: 25 September 2013 Publication History

Abstract

Effective support for custom proof automation is essential for large scale interactive proof development. However, existing languages for automation via *tactics* either (a) provide no way to specify the behavior of tactics within the base logic of the accompanying theorem prover, or (b) rely on advanced type-theoretic machinery that is not easily integrated into established theorem provers.
We present Mtac, a lightweight but powerful extension to Coq that supports dependently-typed tactic programming. Mtac tactics have access to all the features of ordinary Coq programming, as well as a new set of typed tactical primitives. We avoid the need to touch the trusted kernel typechecker of Coq by encapsulating uses of these new tactical primitives in a *monad*, and instrumenting Coq so that it executes monadic tactics during type inference.

References

[1]
H. Barendregt and H. Geuvers. Proof-assistants using dependent type systems. In A. Robinson and A. Voronkov, editors, Handbook of automated reasoning. Elsevier, 2001.
[2]
Y. Bertot, P. Castéran, G. Huet, and C. Paulin-Mohring. Interactive theorem proving and program development : Coq'Art : the calculus of inductive constructions. Texts in theoretical computer science. Springer, 2004.
[3]
S. Boutin. Using reflection to build efficient and certified decision procedures. In TACS, volume 1281 of LNCS. Springer, 1997.
[4]
A. Cave and B. Pientka. Programming with binders and indexed data-types. In POPL 2012. ACM, 2012.
[5]
A. Chlipala. Certified programming with dependent types. http://adam.chlipala.net/cpdt, 2008.
[6]
A. Chlipala. Mostly-automated verification of low-level programs in computational separation logic. In PLDI 2011. ACM, 2011.
[7]
G. Claret, L. del Carmen González Huesca, Y. Régis-Gianas, and B. Ziliani. Lightweight proof by reflection using a posteriori simulation of effectful computation. In ITP 2013, volume 7998 of LNCS. Springer, 2013.
[8]
G. Gonthier. Formal proof -- the four-color theorem. Notices of the AMS, 55(11):1382--93, 2008.
[9]
G. Gonthier, A. Asperti, J. Avigad, Y. Bertot, C. Cohen, F. Garillot, S. Le Roux, A. Mahboubi, R. O'Connor, S. Ould Biha, I. Pasca, L. Rideau, A. Solovyev, E. Tassi, and L. Théry. A machine-checked proof of the odd order theorem. In ITP 2013, volume 7998 of LNCS. Springer, 2013.
[10]
G. Gonthier, A. Mahboubi, and E. Tassi. A small scale reflection extension for the Coq system. Technical report, INRIA, 2008.
[11]
G. Gonthier, B. Ziliani, A. Nanevski, and D. Dreyer. How to make ad hoc proof automation less ad hoc. In ICFP, 2011.
[12]
B. Grégoire and X. Leroy. A compiled implementation of strong reduction. In ICFP, 2002.
[13]
R. Harper, F. Honsell, and G. Plotkin. A framework for defining logics. J. ACM, 40(1):143--184, Jan. 1993.
[14]
C.-K. Hur, G. Neis, D. Dreyer, and V. Vafeiadis. The power of parameterization in coinductive proof. In POPL 2013. ACM, 2013.
[15]
G. Klein, J. Andronick, K. Elphinstone, G. Heiser, D. Cock, P. Derrin, D. Elkaduwe, K. Engelhardt, R. Kolanski, M. Norrish, T. Sewell, H. Tuch, and S. Winwood. seL4: Formal verification of an operating-system kernel. CACM, 53(6):107--115, 2010.
[16]
X. Leroy. Formal verification of a realistic compiler. CACM, 52(7):107--115, 2009.
[17]
N. P. Mendler. Inductive types and type constraints in the second-order lambda calculus. Annals of Pure and Applied Logic, 51(1-2):159--172, 1991.
[18]
D. Miller. Unification of simply typed lamda-terms as logic programming. In ICLP 1991. MIT Press, 1991.
[19]
A. Nanevski. Meta-programming with names and necessity. In ICFP 2002. ACM, 2002.
[20]
A. Nanevski, F. Pfenning, and B. Pientka. Contextual modal type theory. ACM Trans. Comput. Logic, 9(3), June 2008.
[21]
B. Pientka. A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions. In POPL 2008. ACM, 2008.
[22]
B. Pientka and J. Dunfield. Programming with proofs and explicit contexts. In PPDP 2008. ACM, 2008.
[23]
A. Poswolsky and C. Schürmann. System description: Delphin -- a functional programming language for deductive systems. ENTCS, 228:113--120, 2009.
[24]
C. Sacerdoti Coen. Mathematical Knowledge Management and Interactive Theorem Proving. PhD thesis, University of Bologna, 2004.
[25]
A. Saıbi. Typing algorithm in type theory with inheritance. In POPL 1997. ACM, 1997.
[26]
C. Schürmann, A. Poswolsky, and J. Sarnat. The nabla-calculus. Functional programming with higher-order encodings. In TLCA 2005, volume 3461 of LNCS. Springer, 2005.
[27]
M. Sozeau. Subset coercions in Coq. In TYPES 2006, volume 4502 of LNCS. Springer, 2007.
[28]
M. Sozeau and N. Oury. First-class type classes. In TPHOLs 2008, volume 5170 of LNCS. Springer, 2008.
[29]
A. Stampoulis and Z. Shao. VeriML: Typed computation of logical terms inside a language with effects. In ICFP 2010. ACM, 2010.
[30]
A. Stampoulis and Z. Shao. Static and user-extensible proof checking. In POPL 2012. ACM, 2012.
[31]
The Coq Development Team. The Coq Proof Assistant Reference Manual -- Version V8.4, 2012.
[32]
J. Sevcik, V. Vafeiadis, F. Zappa Nardelli, S. Jagannathan, and P. Sewell. CompCertTSO: A verified compiler for relaxed-memory concurrency. J. ACM, 60(3):22:1--22:50, June 2013.

Cited By

View all
  • (2020)FreeSpec: specifying, verifying, and executing impure computations in CoqProceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs10.1145/3372885.3373812(32-46)Online publication date: 20-Jan-2020
  • (2019)Dependent type systems as macrosProceedings of the ACM on Programming Languages10.1145/33710714:POPL(1-29)Online publication date: 20-Dec-2019
  • (2018)System DescriptionProceedings of the 20th International Symposium on Principles and Practice of Declarative Programming10.1145/3236950.3236960(1-10)Online publication date: 3-Sep-2018
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
September 2013
484 pages
ISBN:9781450323260
DOI:10.1145/2500365
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: 25 September 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. coq
  2. custom proof automation
  3. interactive theorem proving
  4. monads
  5. tactics
  6. typed meta-programming

Qualifiers

  • Research-article

Conference

ICFP'13
Sponsor:
ICFP'13: ACM SIGPLAN International Conference on Functional Programming
September 25 - 27, 2013
Massachusetts, Boston, USA

Acceptance Rates

ICFP '13 Paper Acceptance Rate 40 of 133 submissions, 30%;
Overall Acceptance Rate 333 of 1,064 submissions, 31%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)10
  • Downloads (Last 6 weeks)1
Reflects downloads up to 17 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2020)FreeSpec: specifying, verifying, and executing impure computations in CoqProceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs10.1145/3372885.3373812(32-46)Online publication date: 20-Jan-2020
  • (2019)Dependent type systems as macrosProceedings of the ACM on Programming Languages10.1145/33710714:POPL(1-29)Online publication date: 20-Dec-2019
  • (2018)System DescriptionProceedings of the 20th International Symposium on Principles and Practice of Declarative Programming10.1145/3236950.3236960(1-10)Online publication date: 3-Sep-2018
  • (2018)Prototyping a functional language using higher-order logic programming: a functional pearl on learning the ways of λProlog/MakamProceedings of the ACM on Programming Languages10.1145/32367882:ICFP(1-30)Online publication date: 30-Jul-2018
  • (2018)Mtac2: typed tactics for backward reasoning in CoqProceedings of the ACM on Programming Languages10.1145/32367732:ICFP(1-31)Online publication date: 30-Jul-2018
  • (2017)jsCoq: Towards Hybrid Theorem Proving InterfacesElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.239.2239(15-27)Online publication date: 24-Jan-2017
  • (2017)Hazelnut: a bidirectionally typed structure editor calculusACM SIGPLAN Notices10.1145/3093333.300990052:1(86-99)Online publication date: 1-Jan-2017
  • (2017)Hazelnut: a bidirectionally typed structure editor calculusProceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages10.1145/3009837.3009900(86-99)Online publication date: 1-Jan-2017
  • (2017)A comprehensible guide to a new unifier for CIC including universe polymorphism and overloadingJournal of Functional Programming10.1017/S095679681700002827Online publication date: 7-Feb-2017
  • (2017)Automatically Proving Equivalence by Type-Safe ReflectionIntelligent Computer Mathematics10.1007/978-3-319-62075-6_4(40-55)Online publication date: 28-Jun-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

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media