coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jonathan Leivent <jonikelee AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] gprogress tactical?
- Date: Mon, 26 Jan 2015 14:36:03 -0500
On 01/26/2015 12:05 PM, Jonathan Leivent wrote:
On 01/26/2015 11:48 AM, Jason Gross wrote:
A built-in [any] tactical lets you easily build [gprogress] (and many
others) in ltac, while otherwise a dedicated [gprogress]-like tactic
written in ocaml is needed for each tactic you want to have a global
version of.
A case other than for use with [progress] where an [any] tactical would be useful is for solver tactics that fail if they don't solve the goal. Such as: [any omega] - as that would tell you if omega succeeded in any focused goal or failed in all.
-- Jonathan
If one wants the most general such tactical (and perhaps not to have to revisit this) - it would probably be [nany N tac], where N is the number of focused goals where tac must succeed. That way, [any tac] is [nany 1 tac]. But, there is also then a global try via [nany 0 tac]. And a not-any via [let N:=numgoals in nany N (not tac)] - as the normally written "not" tactic would lose global focus and so [not any tac] would not work.
Alternatively, since there is now the guard tactical, perhaps have instead a "numsuc" tactical, which would behave by returning the number of focused goals on which it succeeds. That way, [any tac] is [let n:=numsuc tac in guard n=1], numgoals is identical to [numsuc idtac], global try is [let x:=numsuc tac in idtac], not any is [let n:=numsuc tac in guard n=0]. One can also then do things like [let n:=numsuc tac in guard n > 2].
-- Jonathan
- Re: [Coq-Club] gprogress tactical?, (continued)
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/24/2015
- Re: [Coq-Club] gprogress tactical?, Pierre-Marie Pédrot, 01/25/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/25/2015
- Re: [Coq-Club] gprogress tactical?, Jason Gross, 01/25/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/25/2015
- Re: [Coq-Club] gprogress tactical?, Arnaud Spiwack, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Arnaud Spiwack, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Jason Gross, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Jason Gross, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Arnaud Spiwack, 01/26/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/25/2015
- Re: [Coq-Club] gprogress tactical?, Pierre-Marie Pédrot, 01/25/2015
- Re: [Coq-Club] gprogress tactical?, Jonathan Leivent, 01/24/2015
Archive powered by MHonArc 2.6.18.