Hostname: page-component-8448b6f56d-dnltx Total loading time: 0 Render date: 2024-04-16T21:05:06.628Z Has data issue: false hasContentIssue false

Mtac: A monad for typed tactic programming in Coq

Published online by Cambridge University Press:  24 August 2015

BETA ZILIANI
Affiliation:
Max Planck Institute for Software Systems (MPI-SWS), Kaiserslautern and Saarbrücken, Germany (e-mail: beta@mpi-sws.org)
DEREK DREYER
Affiliation:
Max Planck Institute for Software Systems (MPI-SWS), Kaiserslautern and Saarbrücken, Germany (e-mail: dreyer@mpi-sws.org)
NEELAKANTAN R. KRISHNASWAMI
Affiliation:
University of Birmingham, Birmingham, UK (e-mail: n.krishnaswami@cs.bham.ac.uk)
ALEKSANDAR NANEVSKI
Affiliation:
IMDEA Software Institute, Madrid, Spain (e-mail: aleks.nanevski@imdea.org)
VIKTOR VAFEIADIS
Affiliation:
Max Planck Institute for Software Systems (MPI-SWS), Kaiserslautern and Saarbrücken, Germany (e-mail: viktor@mpi-sws.org)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Articles
Copyright
Copyright © Cambridge University Press 2015 

References

Allen, S. F., Constable, R. L., Howe, D. J. & Aitken, W. E. (1990) The semantics of reflected proof. In IEEE Symposium on Logic in Computer Science (LICS). New York: IEEE.Google Scholar
Armand, M., Grégoire, B., Spiwack, A. & Théry, L. (2010) Extending Coq with imperative features and its application to SAT verification. In International Conference on Interactive Theorem Proving (ITP). Berlin: Springer.CrossRefGoogle Scholar
Artëmov, S. N. (1999) On explicit reflection in theorem proving and formal verification. In Conference on Automated Deduction (CADE). Berlin: Springer.CrossRefGoogle Scholar
Asperti, A., Ricciotti, W., Sacerdoti Coen, C. & Tassi, E. (2009) A compact kernel for the calculus of inductive constructions. Sadhana 34 (1), 71144.CrossRefGoogle Scholar
Baker, H. G. (1991) Shallow binding makes functional arrays fast. SIGPLAN Not. 26 (8), 145147.CrossRefGoogle Scholar
Barendregt, H. & Geuvers, H. (2001) Proof-assistants using dependent type systems. In Handbook of Automated Reasoning, Robinson, A. & Voronkov, A. (eds), Elsevier Science Publishers B. V., pp. 11491238CrossRefGoogle Scholar
Bertot, Y. & Castéran, P. (2004) Interactive Theorem Proving and Program Development: Coq'Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. An EATCS Series, Springer.CrossRefGoogle Scholar
Boutin, S. (1997) Using reflection to build efficient and certified decision procedures. In International Symposium on Theoretical Aspects of Computer Software (TACS). Berlin: Springer.CrossRefGoogle Scholar
Cave, A. & Pientka, B. (2012) Programming with binders and indexed data-types. In ACM Symposium on Principles of Programming Languages (POPL). New York: ACM.CrossRefGoogle Scholar
Chlipala, A. (2011a) Certified Programming with Dependent Types. MIT Press. http://adam.chlipala.net/cpdt/.Google Scholar
Chlipala, A. (2011b) Mostly-automated verification of low-level programs in computational separation logic. In ACM Conference on Programming Languages Design and Implementation (PLDI), pp. 234–245. New York: ACM.CrossRefGoogle Scholar
Claret, G., del Carmen González Huesca, L., Régis-Gianas, Y. & Ziliani, B. (2013) Lightweight proof by reflection using a posteriori simulation of effectful computation. In International Conference on Interactive Theorem Proving (ITP). Berlin: Springer.CrossRefGoogle Scholar
Constable, R. L. (1992) Metalevel programming in constructive type theory. In Programming and Mathematical Method, Broy, M. (ed), NATO ASI Series, vol. 88. New York: Springer-Verlag, pp. 4593.CrossRefGoogle Scholar
Devriese, D. & Piessens, F. (2013) Typed syntactic meta-programming. In International Conference on Functional Programming (ICFP). New York: ACM.CrossRefGoogle Scholar
Gonthier, G. (2008) Formal proof–-the four-color theorem. Not. AMS 55 (11), 1382–93.Google Scholar
Gonthier, G., Asperti, A., Avigad, J., Bertot, Y., Cohen, C., Garillot, F., LeRoux, S., Mahboubi, A., O'Connor, R., Ould Biha, S., Pasca, I., Rideau, L., Solovyev, A., Tassi, E. & Théry, L. (2013b) A machine-checked proof of the odd order theorem. In International Conference on Interactive Theorem Proving (ITP). Berlin: Springer.CrossRefGoogle Scholar
Gonthier, G., Mahboubi, A. & Tassi, E. (2008) A Small Scale Reflection Extension for the Coq System. Technical Report, INRIA.Google Scholar
Gonthier, G., Ziliani, B., Nanevski, A. & Dreyer, D. (2013a) How to make ad hoc proof automation less ad hoc. J. Funct. Program. (JFP) 23 (4), 357401.CrossRefGoogle Scholar
Grégoire, B. & Leroy, X. (2002) A compiled implementation of strong reduction. In International Conference on Functional Programming (ICFP). New York: ACM.CrossRefGoogle Scholar
Harper, R., Honsell, F. & Plotkin, G. (1993) A framework for defining logics. J. ACM (JACM) 40 (1), 143184.CrossRefGoogle Scholar
Harrison, J. (1995) Metatheory and Reflection in Theorem Proving: A Survey and Critique. Technical Report CRC-053. SRI Cambridge, Millers Yard, Cambridge, UK.Google Scholar
Howe, D. J. (1992) Reflecting the semantics of reflected proof. In Proof Theory. Cambridge University Press, pp. 227250.Google Scholar
Hur, C.-K., Neis, G., Dreyer, D. & Vafeiadis, V. (2013) The power of parameterization in coinductive proof. In ACM Symposium on Principles of Programming Languages (POPL). New York: ACM.CrossRefGoogle Scholar
Klein, G., Andronick, J., Elphinstone, K., Heiser, G., Cock, D., Derrin, P., Elkaduwe, D., Engelhardt, K., Kolanski, R., Norrish, M., Sewell, T., Tuch, H. & Winwood, S. (2010) seL4: Formal verification of an operating-system kernel. Commun. ACM (CACM) 53 (6), 107115.CrossRefGoogle Scholar
Launchbury, J. & Peyton Jones, S. L. (1994) Lazy functional state threads. In ACM Conference on Programming Languages Design and Implementation (PLDI). New York: ACM.CrossRefGoogle Scholar
Leroy, X. (2009) Formal verification of a realistic compiler. Commun. ACM (CACM) 52 (7), 107115.CrossRefGoogle Scholar
Malecha, G. & Bengtson, J. (2015) Rtac: A fully reflective tactic language. In International Workshop on Coq for PL (CoqPL).Google Scholar
Malecha, G., Chlipala, A. & Braibant, T. (2014) Compositional computational reflection. In International Conference on Interactive Theorem Proving (ITP). Berlin: Springer.CrossRefGoogle Scholar
Mendler, N. P. (1991) Inductive types and type constraints in the second-order lambda calculus. Ann. Pure Appl. Log. 51 (1–2), 159172.CrossRefGoogle Scholar
Miculan, M. & Paviotti, M. (2012) Synthesis of distributed mobile programs using monadic types in coq. In International Conference on Interactive Theorem Proving (ITP). Berlin: Springer.CrossRefGoogle Scholar
Miller, D. (1991) Unification of simply typed lamda-terms as logic programming. In International Conference on Logic Programming (ICLP). Berlin: Springer.Google Scholar
Nanevski, A. (2002) Meta-programming with names and necessity. In International Conference on Functional Programming (ICFP). New York: ACM.CrossRefGoogle Scholar
Nanevski, A., Morrisett, G. & Birkedal, L. (2008b) Hoare type theory, polymorphism and separation. J. Funct. Program. (JFP) 18 (5–6), 865911.CrossRefGoogle Scholar
Nanevski, A., Morrisett, G., Shinnar, A., Govereau, P. & Birkedal, L. (2008c) Ynot: Dependent types for imperative programs. In International Conference on Functional Programming (ICFP). New York: ACM.CrossRefGoogle Scholar
Nanevski, A., Pfenning, F. & Pientka, B. (2008a) Contextual modal type theory. ACM Trans. Comput. Log. (TOCL) 9 (3), 23:123:49.Google Scholar
Nanevski, A., Vafeiadis, V. & Berdine, J. (2010) Structuring the verification of heap-manipulating programs. In ACM Symposium on Principles of Programming Languages (POPL). New York: ACM.CrossRefGoogle Scholar
Pientka, B. (2008) A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions. In ACM Symposium on Principles of Programming Languages (POPL). New York: ACM.CrossRefGoogle Scholar
Pientka, B. & Dunfield, J. (2008) Programming with proofs and explicit contexts. In International Symposium on Principles and Practice of Declarative Programming (PPDP). New York: ACM.CrossRefGoogle Scholar
Pollack, R. (1995) On extensibility of proof checkers. In TYPES. Berlin: Springer.CrossRefGoogle Scholar
Poswolsky, A. & Schürmann, C. (2009) System description: Delphin – a functional programming language for deductive systems. In Electron. Notes Theor. Comput. Sci. (ENTCS) 228, 113120.CrossRefGoogle Scholar
Sacerdoti Coen, C. (2004) Mathematical Knowledge Management and Interactive Theorem Proving. PhD Thesis, University of Bologna.Google Scholar
Saïbi, A. (1997) Typing algorithm in type theory with inheritance. In ACM Symposium on Principles of Programming Languages (POPL). New York: ACM.CrossRefGoogle Scholar
Schürmann, C., Poswolsky, A. & Sarnat, J. (2005) The ∇-calculus. Functional programming with higher-order encodings. In International Conference on Typed Lambda Calculi and Applications (TLCA). Berlin: Springer.CrossRefGoogle Scholar
Ševčík, J., Vafeiadis, V., Zappa Nardelli, F., Jagannathan, S. & Sewell, P. (2013) CompCertTSO: A verified compiler for relaxed-memory concurrency. J. ACM (JACM) 60 (3), 22:122:50.CrossRefGoogle Scholar
Sozeau, M. (2007) Subset coercions in Coq. In TYPES. Berlin: Springer.Google Scholar
Sozeau, M. & Oury, N. (2008) First-class type classes. In International Conference on Theorem Proving in Higher Order Logics (TPHOLs). Berlin: Springer.CrossRefGoogle Scholar
Stampoulis, A. & Shao, Z. (2010) VeriML: Typed computation of logical terms inside a language with effects. In International Conference on Functional Programming (ICFP). New York: ACM.CrossRefGoogle Scholar
Stampoulis, A. & Shao, Z. (2012) Static and user-extensible proof checking. In ACM Symposium on Principles of Programming Languages (POPL). New York: ACM.CrossRefGoogle Scholar
The Coq Development Team. (2012) The Coq Proof Assistant Reference Manual–Version V8.4.Google Scholar
Vafeiadis, V. (2013) Adjustable references. In International Conference on Interactive Theorem Proving (ITP). Berlin: Springer.CrossRefGoogle Scholar
van der Walt, P. & Swierstra, W. (2013) Engineering proof by reflection in Agda. In Implementation and Application of Functional Languages (IFL).CrossRefGoogle Scholar
Ziliani, B., Dreyer, D., Krishnaswami, N. R., Nanevski, A. & Vafeiadis, V. (2013) Mtac: A monad for typed tactic programming in Coq. In International Conference on Functional Programming (ICFP). New York: ACM.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.