skip to main content
research-article

Mtac: a monad for typed tactic programming in Coq

Published:25 September 2013Publication History
Skip Abstract Section

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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Boutin. Using reflection to build efficient and certified decision procedures. In TACS, volume 1281 of LNCS. Springer, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Cave and B. Pientka. Programming with binders and indexed data-types. In POPL 2012. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Chlipala. Certified programming with dependent types. http://adam.chlipala.net/cpdt, 2008.Google ScholarGoogle Scholar
  6. A. Chlipala. Mostly-automated verification of low-level programs in computational separation logic. In PLDI 2011. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Gonthier. Formal proof -- the four-color theorem. Notices of the AMS, 55(11):1382--93, 2008.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Gonthier, A. Mahboubi, and E. Tassi. A small scale reflection extension for the Coq system. Technical report, INRIA, 2008.Google ScholarGoogle Scholar
  11. G. Gonthier, B. Ziliani, A. Nanevski, and D. Dreyer. How to make ad hoc proof automation less ad hoc. In ICFP, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. B. Grégoire and X. Leroy. A compiled implementation of strong reduction. In ICFP, 2002.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. Harper, F. Honsell, and G. Plotkin. A framework for defining logics. J. ACM, 40(1):143--184, Jan. 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. C.-K. Hur, G. Neis, D. Dreyer, and V. Vafeiadis. The power of parameterization in coinductive proof. In POPL 2013. ACM, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. X. Leroy. Formal verification of a realistic compiler. CACM, 52(7):107--115, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.Google ScholarGoogle ScholarCross RefCross Ref
  18. D. Miller. Unification of simply typed lamda-terms as logic programming. In ICLP 1991. MIT Press, 1991.Google ScholarGoogle Scholar
  19. A. Nanevski. Meta-programming with names and necessity. In ICFP 2002. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. A. Nanevski, F. Pfenning, and B. Pientka. Contextual modal type theory. ACM Trans. Comput. Logic, 9(3), June 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. B. Pientka. A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions. In POPL 2008. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. B. Pientka and J. Dunfield. Programming with proofs and explicit contexts. In PPDP 2008. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. A. Poswolsky and C. Schürmann. System description: Delphin -- a functional programming language for deductive systems. ENTCS, 228:113--120, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. C. Sacerdoti Coen. Mathematical Knowledge Management and Interactive Theorem Proving. PhD thesis, University of Bologna, 2004.Google ScholarGoogle Scholar
  25. A. Saıbi. Typing algorithm in type theory with inheritance. In POPL 1997. ACM, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Sozeau. Subset coercions in Coq. In TYPES 2006, volume 4502 of LNCS. Springer, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Sozeau and N. Oury. First-class type classes. In TPHOLs 2008, volume 5170 of LNCS. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. A. Stampoulis and Z. Shao. VeriML: Typed computation of logical terms inside a language with effects. In ICFP 2010. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. Stampoulis and Z. Shao. Static and user-extensible proof checking. In POPL 2012. ACM, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. The Coq Development Team. The Coq Proof Assistant Reference Manual -- Version V8.4, 2012.Google ScholarGoogle Scholar
  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. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Mtac: a monad for typed tactic programming in Coq

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!