coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Courtieu <pierre.courtieu AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Macro for Ltac
- Date: Thu, 14 Dec 2017 13:46:26 +0100
- 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-oi0-f46.google.com
- Ironport-phdr: 9a23:lyh+WRcWuwjmd7Q8kXQ3ILpElGMj4u6mDksu8pMizoh2WeGdxcu9bR7h7PlgxGXEQZ/co6odzbaO6ua4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahfL9+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v9LlgRgP2hygbNj456GDXhdJ2jKJHuxKquhhzz5fJbI2JKPZye6XQds4YS2VcRMZcTy5OAo28YYUBDOQPIPhWoJXyqVYVsRu+HBOhCP/zxjNUhHL727Ax3eQ7EQHB2QwtB8gAsHXKo9XvLqcdT/2+wbfPzTXedfNWxTb955bVchs8pvyMRbNwftTLyUk1CQzJlEmfqYv4PzOPyuQNsnaU7/d7WOKgjm4osQBxojy1ysgwjYnJg5sYx1bZ/it62IY4PcO0RFJ/bNK+E5ZdtzuWO5VrTs4hWW1ltyc3x7sbspChZicK0o4oxxvHZvyHbYeI5hXjWf6UIThihXJlfKuzhxGz8US80+H8WMa53VdQoipKldnMsX8N1xjN5cSdVvR9+UKh1S6O1wDV9O5EPVg5mbTHJ5Ml2LI9lZoevV7dEiPrm0j6lqCbe0Q89uit8evnY7HmppGGN49zjwHzKrwums2hDuQiKAgBQXKX9vi71L3+5035XLRKgeMrkqTCv5DaIN4Upq+9AwNPzokj7BO/Ay+80NsEhXkHME5FeBWfgof1PFHOOen0Auu7g1Sxizhm3OvGP73kApXVNHfPirbhfbBn605d0gU/195f54gHQo0Gddn0QwfasMHSRksyNBXxyOL6Av180JkfUCSBGPnKHrnVtAqw5+81OeTET4gIoir8JuVts+bvgGUjlBkWerSzwZoadVi3G/1nJwOSZn+60YRJKnsDogdrFL+is1aFSzMGIi/qB68=
I come back to this question after some thinking about it.
Indeed uconstr does not fit in the suggestion I made. Something you
may be able to do in some cases (but not in your case I guess, see
below) is to use the String type where you need some specific non
typable format.
Inductive args :=
Step: args
| Iter: nat -> args
| Hyp: forall (A:Type) (t:A), args
| Trans: String -> args. (* <--- here *)
and hopefully you can analyse the string character by character to
implement the behaviour you want.
BUT it seems your uconstr has subparts that you want to consider as
real coq terms, and I am not aware of a way to take a String and
transform it into a constr by giving it to the coq parser.
What are the possible forms of your uconstr arguments? Maybe you can
describe them in a inductive type.
Best,
Pierre
2017-10-30 14:25 GMT+01:00 Dominique Larchey-Wendling
<dominique.larchey-wendling AT loria.fr>:
> Dear Pierre,
>
> Thx for the suggestion but there is a problem with
> the untyped argument <uconstr> which cannot be represented
> as a Coq typed term.
>
> Is there no way or extension for Tactic to manipulate
> text ?
>
> Dominique
>
> Le 30/10/2017 à 12:03, Pierre Courtieu a écrit :
>> Hi,
>> I guess you should define a tactic taking a list (coq lists) over some
>> inductive type describing the steps. Then some Tactic notation could get
>> you close to the syntax you want.
>>
>> Pierre
>>
>> Le lun. 30 oct. 2017 à 10:26, Dominique Larchey-Wendling
>> <dominique.larchey-wendling AT loria.fr
>> <mailto:dominique.larchey-wendling AT loria.fr>>
>> a écrit :
>>
>> Dear all,
>>
>> I am wondering if there is a way to define macros within the
>> tactic language.
>>
>> For instance, consider that I have already defined
>> tactic notations such as:
>>
>> wcbv step
>> wcbv iter <integer>
>> wcbv hyp
>> wcbv trans <uconstr>
>>
>> Then I would like to be able to write
>>
>> wcbv step, hyp, hyp, trans (t @ a), iter 2.
>>
>> instead of
>>
>> wcbv step; do 2 wcbv hyp; wcbv trans (t @ a); wcbv iter 2.
>>
>> Can I do this using Ltac and Tactic Notation ?
>> Because it seems neither can input <text> as an
>> argument (like latex or metapost macros would do)
>>
>> Thanks very much in advance for any hint
>>
>> Dominique
>>
>
- Re: [Coq-Club] Macro for Ltac, Pierre Courtieu, 12/14/2017
- Re: [Coq-Club] Macro for Ltac, Dominique Larchey-Wendling, 12/14/2017
- Re: [Coq-Club] Macro for Ltac, Pierre Courtieu, 12/14/2017
- Re: [Coq-Club] Macro for Ltac, Dominique Larchey-Wendling, 12/14/2017
Archive powered by MHonArc 2.6.18.