coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Robert Rand <rrand AT seas.upenn.edu>
- To: coq-club AT inria.fr
- Cc: Jennifer Paykin <jpaykin AT gmail.com>
- Subject: [Coq-Club] Cascading tactics
- Date: Fri, 31 Mar 2017 17:59:20 -0400
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=rrand AT seas.upenn.edu; spf=Pass smtp.mailfrom=rrand AT seas.upenn.edu; spf=None smtp.helo=postmaster AT fox.seas.upenn.edu
- Ironport-phdr: 9a23:soaiiBPBwNl3iRpsIzol6mtUPXoX/o7sNwtQ0KIMzox0Lfj8rarrMEGX3/hxlliBBdydsKMYzbKO+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZPebgFHiTanfb9+MAi9oBnMuMURnYZsMLs6xAHTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKHw65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0vRz+s87lkRwPpiCcfNj427mfXitBrjKlGpB6tvgFzz5LIbI2QMvd1Y6HTcs4ARWdZXshfWS9PDJ6iYYQTFOcOJ/pUopPnqlcSsRezBw+hD/7vxD9SgX/22LU33fgmEQ7dwgMgBc4Ou2nIotrvMqcdTP2+wa7SzTXZdfxW3yry5ZPTch8/u/6MRqh8cdfJyUYxEQPFiE+cppL4MDOIz+kAtXWQ4el4Ve+3lmIqqwJ8riKyysoiloXFnIAYxk3e+Slk3oo4JcW0RFBnbdOgCpddtCGXO5FoTs8/QGxkoik3x7kAtJWmZiYF0o4nyATaa/Gfc4iH/BbjVOGJLDd2g3Jkd6izhw2s/ke60e3wTNS00E5UoSpDlNnArG4C2AHO6sSfS/t9+Fmu2SqX2gzO6uxJIlo4mbfVJpI92LI9lIcfvV7eEiPomEj6lKqWeV8l+uis5eTneLLmppqEOo9ukAHxKKIuldGkDOQjLAcBRXOb9f6h1L3740L5RrNKguconabErZDWPd4bqbKhAw9JzoYj7A6yACuh0NQBhHUIMFZFeA+cgIXyIFHPIPX4De+ljFi2kTdrwerGPrz7DZnXIHjDiuSpQbEo4ElFjQE30Np35pROC7hHLuigdFX2sYniCRU0KRD8+e/hBJ0pzJkXX26nGaKQK+XPqVKO4KQiL/TaN9xdgyr0N/Vwv62mtnQ+g1JIOPDxhZY=
Hi all,
I'm trying to use Ltac to apply a tactic called type_check_once to all goals until no further progress can be made. Often this requires a cascade: type_check_once might instantiate a existential variable in goal #6 which then allows us to solve goal #3. No new goals are generated in this process.
The problem is that the tactics seem to focus on a single goal, and does not cascade properly.
In Coq 8.5 the following code worked but it fails in 8.6 (that is, we now have to call "all: type_check" multiple times in a row to solve all goals).
Ltac type_check := let n := numgoals in do n type_check_once.
(I've also tried using [> type_check_once..] in place of type_check, but this doesn't seem to buy us anything.)
The following two approaches seemed to show promise, but both fail in some cases, for reasons unclear to me:
Ltac type_check_num :=
let pre := numgoals in
type_check_once;
let post := numgoals in
tryif (guard post < pre) then type_check_num else idtac.
Ltac type_check_circ :=
intros; compute;
try (progress [> type_check_once ..]; type_check_circ)
Any suggestions?
Bonus question: These goals are generated using refine. Ideally, I'd like to use Program here, but that forces me to solve the generated obligations in order (since each is deemed to depend on the previous one). Is there any way around this (that is, to replace earlier obligations with evars and proceed to subsequent ones)?
Thanks,
Robert Rand
- [Coq-Club] Cascading tactics, Robert Rand, 03/31/2017
Archive powered by MHonArc 2.6.18.