Mtac2:
Typed Tactics for Backward Reasoning in Coq
Jan-Oliver Kaiser Beta Ziliani
Robbert Krebbers Yann Régis-Gianas Derek Dreyer
Unfortunately, though, these tactic languages share a significant weakness. They do not offer the tactic programmer any static guarantees about the soundness of their custom tactics, making large tactic developments difficult to maintain. To address this limitation, Ziliani et al. previously proposed Mtac, a new typed approach to custom proof automation in Coq which provides the static guarantees that OCaml and Ltac are missing. However, despite its name, Mtac is really more of a metaprogramming language than it is a full-blown tactic language: it misses an essential feature of tactic programming, namely the ability to directly manipulate Coq’s proof state and perform backward reasoning on it.
In this paper, we present Mtac2, a next-generation version of Mtac that combines its support for typed metaprogramming with additional support for the programming of backward-reasoning tactics in the style of Ltac. In so doing, Mtac2 introduces a novel feature in tactic programming languages—what we call typed backward reasoning. With this feature, Mtac2 is capable of statically ruling out several classes of errors that would otherwise remain undetected at tactic definition time. We demonstrate the utility of Mtac2’s typed tactics by porting several tactics from a large Coq development, the Iris Proof Mode, from Ltac to Mtac2.
- Mtac2 is available in opam as coq-mtac2.
- Code is available in github.
- Publications and presentations:
-
Mtac2: Typed Tactics for Backward Reasoning in Coq
J.-O. Kaiser, B. Ziliani, R. Krebbers, Y. Régis-Gianas and D. Dreyer.
Presented in International Conference for Functional Programming (ICFP 2018) and published in PACMPL, Volume 2, Issue ICFP, September 2018 (doi) (video). -
A “destruct” tactic for Mtac2.
J.-O. Kaiser and B. Ziliani
In the 4th International Workshop on Coq for Programming Languages, CoqPL ’18, 2018 (abstract). - Introducing MetaCoq: A Safe Tactic Language for Coq.
B. Ziliani
In Type Theory Based Tools (TTT 2017) (pdf).
Mtac:
A Monad for Typed Tactic Programming in CoqBeta Ziliani
Derek Dreyer Neel Krishnaswami Aleksandar Nanevski Viktor Vafeiadis
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.- Start working with Mtac directly from the browser! (Thanks to Emilio Jesús Gallego Arias!)
- Documentation:
- Tutorial:
- v1.1 [html] [coq script]
- v1.0 [html] [coq script]
- Tutorial:
- Download
- New! Mtac v1.2 as a plugin for Coq 8.5 [plugin]
-
Mtac v1.2 [sources now in GitHub]
Release Date: 20 Jun 2014 [CHANGES]
Download the examples -
Mtac v1.1.1 [sources] [Ubuntu package]
Release Date: 29 Oct 2013 [CHANGES]
New! Fixed the bug preventing Ssreflect to compile.
With many thanks to Edward Z. Yang for the Ubuntu package! -
Mtac v1.0
Release Date: 3 Apr 2013
- Publications
-
Mtac: A Monad for Typed Tactic Programming in Coq.
In Journal of Functional Programming (JFP).
Special issue devoted to selected papers from ICFP 2013.
[pdf]
This is a significantly revised and expanded version of the ICFP paper. -
Mtac: A Monad for Typed Tactic Programming in Coq.
In Proceedings of the 18th ACM SIGPLAN-SIGACT International Conference on Functional Programming (ICFP 2013).
[pdf] [talk]
-
Mtac: A Monad for Typed Tactic Programming in Coq.
Don't miss any update! (Unless you have non-tracking add-ons on your browser.)
Follow @CoqMtac -
Mtac2: Typed Tactics for Backward Reasoning in Coq