coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Cyprien Mangin <cyprien.mangin AT m4x.org>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] goal selectors; tactic expressions
- Date: Fri, 25 Jan 2019 00:00:58 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=Pass smtp.pra=cyprien.mangin AT m4x.org; spf=Pass smtp.mailfrom=SRS0=/Dqu=QA=m4x.org=cyprien.mangin AT bounces.m4x.org; spf=Pass smtp.helo=postmaster AT mx1.polytechnique.org
- Ironport-phdr: 9a23:7InJZxDqZJDYMMMrCWvIUyQJP3N1i/DPJgcQr6AfoPdwSPT5psbcNUDSrc9gkEXOFd2Cra4c26yO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhzexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoIODA5/2PXhMJ+j6xVvQyvqABkzoHOfI2YLuBzcr/Bcd4YQ2dKQ8ZfVzZGAoO5d4YCEeoAPf5Cr4n8uVQOqwa1Cw62C+PpxT9Ih3n21rA93us9EQDGxBYgH9MQv3TSttn1Mb0dUea6zKnJyzXOdPZW1Djy6YTSdRAhu/6MUKt2fMHMx0cvEAbFgU+RqYzjJz6ayP0Ns3OB4+V9UuKijXMspQJpojW328sglI3EipgIxlzY+ih12og4KcGiREN1btOoCIVcuz2eOodsQc4vQ3tktDgmxrAFo5K2fDQGxZI6zBDFcfOHaZKH4hf7WeaRPzh4gHVldaq6hxe97ESs0PX8Vs6w0FdKsipKjMXDtnAL1xzS88iHV+Vy8l2m2TaV2ADf8uBEIUYqmqrHM5Mt36A8m54JvUjeAiP7l1/6gaGKekk+9OWl5PzrYrD8qZ+dM490hBv+MqMrmsGnHOo2LhUAU3SD9Oin2rPj5FD5Ta1RgPAqiqTZtZ/XJMsBqq6+GQ9V3Z4u5Aq/Dje+ytQYnGcILFRfdBKClYfpPV7OIPH+DfqkmFuslyprx/baMbL/GZXBNH3DnbjufLpn7E5c0gUzwchF551IErEBPO7zWkjpudPECR85KhW4zPrjCNVgzYwTQnmPA6+cMKPKq1CE/OMvI++WZI8UojnxMfYl5+S9xUM+zFQaZOyi2YYdQHG+BPVvZUuDMlT2hdJUOnYSpAszSqTPgVuNUDgbM32jR7g96zd9DYugAobFboXxkPqGxijtTc4eXXxPFl3ZSSSgTI6DQfpZMHvDcP8kqSQNUP2ac6Fk0BivsAHgzL8+cbje/TAevp/4kt0p96vUjx5grGUoXfTY6HmESiRPpk1NXyU/jfJ6/Vw7zU2Mg/Eh3q5oUOdL7vYMaT8UcJ7Ry+sgUIL3SluHZtCNWUqrSdWgACgsQ5Q22dBcOks=
Hi Jeremy,
The confusing thing to understand is that there is always a toplevel goal selector being applied to a tactic.
By default it is "1 : ", so when you write "repeat (only 2 : solve_eqs)", it is equivalent to "1 : repeat (only 2 : solve_eqs)", meaning the inner part will fail due to it having only one goal under focus.
The syntax error you get comes from the fact that a toplevel selector like "1 : " or "all :" cannot be used inside a tactic _expression_, so "repeat (2 : solve_eqs)" is not a valid _expression_.
What you probably meant is something like "all : repeat solve_eqs", or if you want to target specifically the goals 1 and 2, "1-2 : repeat solve_eqs".
Alternatively, "all : repeat (only 1-2 : solve_eqs)." might work, but it might do weird things if the number of goals changes.
Cyprien
On Thu, Jan 24, 2019 at 11:16 PM Jeremy Dawson <Jeremy.Dawson AT anu.edu.au> wrote:
OK, well, no doubt I didn't try for quite the right way of expressing it
but surely being misled on this point wouldn't lead to syntax errors,
would it?
How do I correctly write the tactic I tried to write as
repeat (only 1 : solve_eqs || only 2 : solve_eqs).
And what should
repeat (only 2 : solve_eqs).
do? I'm guessing that it means the second and subsequent invocations of
apply to the second subgoal produced by the previous invocation of
solve_eqs, but that doesn't explain why nothing happens on the first
invocation.
And what should
repeat (only 1-2 : try solve_eqs).
do? Again, shouldn't the first invocation of
only 1-2 : try solve_eqs
apply solve_eqs to each of the two subgoals?
Anyway, what I would like to know how to do is to apply a tactic
repeatedly to all the goals in turn, until they are all solved or there
is no further progress
Thanks,
Jeremy
On 01/24/2019 11:05 PM, Laurent Thery wrote:
>
>
> On 1/24/19 5:35 AM, Jeremy Dawson wrote:
>> ow do I write a tactic to repeatedly apply solve_eqs to goals 1 and 2
>> until either both are solved or there is no further progress?
>
> Maybe you are mislead by the fact that the goal numbering is local but
> not global
>
> For example:
>
> Goal (True /\ True) /\ (False /\ True).
> split; only 2 : (split; only 2 : trivial).
>
> solves the 3th goal
>
- [Coq-Club] goal selectors; tactic expressions, Jeremy Dawson, 01/24/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Laurent Thery, 01/24/2019
- Re: [Coq-Club] goal selectors; tactic expressions, David Holland, 01/24/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jeremy Dawson, 01/24/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Cyprien Mangin, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jeremy Dawson, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Gaëtan Gilbert, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jeremy Dawson, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jason -Zhong Sheng- Hu, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jeremy Dawson, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jason -Zhong Sheng- Hu, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Gaëtan Gilbert, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Théo Zimmermann, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Pierre Courtieu, 01/28/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jeremy Dawson, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jeremy Dawson, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Gaëtan Gilbert, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Jeremy Dawson, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Cyprien Mangin, 01/25/2019
- Re: [Coq-Club] goal selectors; tactic expressions, Laurent Thery, 01/24/2019
Archive powered by MHonArc 2.6.18.