Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] how to combine tactics

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] how to combine tactics


Chronological Thread 
  • From: Pierre Courtieu <pierre.courtieu AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>, Arnaud Spiwack <arnaud.spiwack AT gmail.com>
  • Subject: Re: [Coq-Club] how to combine tactics
  • Date: Tue, 20 Aug 2019 18:56:25 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-io1-f46.google.com
  • Ironport-phdr: 9a23:jx4/ihAb4EJJlRXQKTbdUyQJP3N1i/DPJgcQr6AfoPdwSPT4rsbcNUDSrc9gkEXOFd2Cra4d0ayP7/mrADRaqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba5sIBmssAncudQajYR/Jqot1BfCv2dFdflRyW50P1yYggzy5t23/J5t8iRQv+wu+stdWqjkfKo2UKJVAi0+P286+MPkux/DTRCS5nQHSWUZjgBIAwne4x7kWJr6rzb3ufB82CmeOs32UKw0VDG/5KplVBPklCEKPCMi/WrJlsJ/kr5UoBO5pxx+3YHUZp2VNOFjda/ZZN8WWHZNUtpUWyFHH4iybZYAD/AZMOlXoYnypVsAoxW9CwexGu3g1jBGi2Tq3a0jyektDR3K0BAiEt8IrX/arM/1NKAXUe2t1qfIzCvMb+lM2Tjj9YPFbBchoeyWXbJscMre11QvHB7Cg1WIqIzqISmV1v4TvGSB8+VgUv+vi3Q7qwFwvDev29whiobMho0Py1DE8T91z5oyJd29UUN2Z8OvHphItyyCKYd6XscvT3trtSs60LEKpJ+2cSkQxJkoxhPSbeGMfZKS7RL5TumRJC91hHJ7d7K7gBa/6U2gxff9VsmwyVpKry1FnsTVunAD2BHe69KLSvR6/kem1jaP0x7c5vtYLkAzkKrXM58hwrgumZoPqUnPADP6lUHsgKKVdkgo4PWk5uXmb7n8qZKRNpd4igTkPaQvnsy/D/44Mg8LX2WD4eS81aPs/VfjQLpUlPE5jq7ZsI3AJcQHp662HRJV350s6xa6FTim0dAYkWMbI1JCfRKLl5LpNE3WIPDkEfe/hEyhnytsx/DfJ7HuHpHNLmXYn7r6ZrZ860tcyBIpwtxF5pJUDKsBIPPpVUPrutzYFExxDwvh6OH+QP55y4lWDWmIG+qSNL7YmV6O/OMmZeeWMstdkSz7IuUpr8X2jGAwklxVKaCz25IKZDajBvV5Kk6aSXXpi9YFV2wNu1xtYvbtjQi6UDNJfXv6dKUh/C06BZ/uWZ/CS5q3jfqK2zqhApxbe0hJD1mNFTHjcIDSCKREUz6bPsI0ym9MbrOmUYJ0kEj27FarmYoiFfLd/2gjjbym0dF04+PJkhRrrG57Cs2c1yeGSGQmxzpVFQ9z57h2pAlG8nnG0aV8hKYFR9la5vcMUwBjcJCAkap1DNf9Xg+HddCMGg7/HoeWRAopR9d0+OcgJl5nEoz73B/G1iuuRbQSku7TCQ==

Hi, it is obviously the same syntactic factor, the match ... end
acting like the parenthesis here.

Actually you have to make a choice, either you use ";[]" (i.e. what
you did but mistakenly wrote ";[>]") and you lose associativity. Or
you use "[>]" and ";" and you have associativity but it is a bit more
verbose to apply tactics locally like you did.

So either you write

induction h; (eapply derivI;[ NLrule_I | ]).
but you need the parenthesis.
or
induction h; [> eapply derivI;[> NLrule_I | ]..].
which is a shortcut for this:
induction h; eapply derivI;[> NLrule_I | | NLrule_I | | NLrule_I | |
NLrule_I | | NLrule_I | |NLrule_I | |NLrule_I | ].
which is not intuitive but associative:
induction h; (eapply derivI;[> NLrule_I | | NLrule_I | | NLrule_I | |
NLrule_I | | NLrule_I | |NLrule_I | |NLrule_I | ]).
(induction h; eapply derivI);[> NLrule_I | | NLrule_I | | NLrule_I | |
NLrule_I | | NLrule_I | |NLrule_I | |NLrule_I | ].

You can also write it like this:
induction h; eapply derivI; only 1,3,5,7,9,11,13:NLrule_I.

all of these formulation being associative.

Most people use ;[] as it is how we think about tactic composition.
And being non associative is generally not a problem.

Hope this helps

Pierre

Le jeu. 15 août 2019 à 19:52, David Holland
<dholland-coq AT netbsd.org>
a écrit :
> I have also found that you can work around these problems by inserting
> a dummy match, along these lines:
>
> induction H;
> match goal with
> | [ |- _ ] => eapply derI; [ apply NLrule_I | ]
> end.
>
> After reading the rest of this thread I'm now not sure if this is a
> consequence of the same syntactic factors or whether the matching
> does actually changes the way the goals are processed like I
> originally thought it did. :-/



Archive powered by MHonArc 2.6.18.

Top of Page