coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Valentin Robert <valentin.robert.42 AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Issues mixing Ltac, anonymous tactics, eta-expansion
- Date: Fri, 31 Mar 2017 23:42:40 +0000
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=valentin.robert.42 AT gmail.com; spf=Pass smtp.mailfrom=valentin.robert.42 AT gmail.com; spf=None smtp.helo=postmaster AT mail-vk0-f51.google.com
- Ironport-phdr: 9a23:KO0tBhFNYWll0dCQx/gvgZ1GYnF86YWxBRYc798ds5kLTJ78rsiwAkXT6L1XgUPTWs2DsrQf2raQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbQhFgDWwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VC+85Kl3VhDnlCYHNyY48G7JjMxwkLlbqw+lqxBm3oLYfJ2ZOP94c6jAf90VWHBBU95eWCxPAIyyb4UBAekcM+hGs4bwvEEBoQekCAS2GO/j1j1Fi3nr1qM6yeQhFgTG0RQvEN0UtHTbstP1NLsTUeCz0aLG0TLDYOhI1jfn9IjDbxcsoe+WUrJ0b8XRz1UvFwLDjlmKs4zlOCia2foXs2iH9eZtWvyjhnUoqwF0uDevx8MshpPViYISz1DJ7CN0y5s2K92gUEN3f8KoHZ9KuyyZN4Z6WN0uT3xmtSogyrAKpJi2dzUQxps93R7QcfmHfpCI4h39UOaRJi91hHd/d7K+gxa+6Fagyu7gWsWt3lZHrjdJnsPDtnAK0BzT5cyHReVn8ki93jaP0hjf6uBCIU8qiarWM4AtzqI0m5YJsknOHjX6lFvrgKKYbEkp+vWk5/ziYrr8p5+cM4F0ihv5MqQrgsG/H/43MgwQUGid5eS81bvj8VfjQLVNlfI5jLPZsIzAKckUuKK0GABV0oM55Ba+CzeqysgXnX4CLF5dYhKIk5DpO03SIPD/Ffqwn1OskC5yy//aOr3hH47CI2PYkLbheLZ981RTxBAyzdBZ/ZJUC6sOLOj9Wk/r55TkCUoSNBX86OL6Ap0p3YQHHGmLH6WxMaXIsFbO6Ph5cMeWY4pAhj/5Jv455vimt3gzlEUBNf231J8abmy5GLJ8JE+Ue2aq3o0pHmIDvw54R+vv3g7RGQVPbmq/CvpvrgowD5irWMKaHtig
Ah, I thought I had tried it earlier, but indeed, it was as simple as this.
Thanks Pierre.
- Valentin
On Fri, Mar 31, 2017 at 3:41 PM Pierre Courtieu <pierre.courtieu AT gmail.com> wrote:
Did you try to replace your (fun x => ...) by ltac:(fun x => ...)?
Because fun is also the syntax of lambda abstraction in terms.
Not in front of my laptop to check.
Best,
P
2017-04-01 0:18 GMT+02:00 Valentin Robert <valentin.robert.42 AT gmail.com>:
> Hello,
>
> I was essentially trying to write some tactic combinator that would accept a
> one-argument tactic as input, and call this tactic with some hypothesis. My
> problem is that I have managed to make it work with pre-defined tactics, but
> not with on-the-fly anonymous tactics. See:
>
> Ltac idtac' := idtac.
>
> Ltac idtac'' x := idtac x.
>
> Ltac silly tactic arg := tactic arg.
>
> Goal forall (T : Type), False.
> intros.
>
> (* 0: Illegal tactic application *)
> Fail silly idtac T.
>
> (* 1: Illegal tactic application *)
> Fail silly idtac' T.
>
> (* 2: OK *)
> silly idtac'' T.
>
> (* 3: The reference idtac was not found in the current environment. *)
> Fail silly (fun x => idtac x) T.
>
> (* 4: x not found *)
> Fail silly (fun x => ltac:(idtac x)) T.
>
> (* 5: The reference idtac' was not found in the current environment. *)
> Fail silly (fun x => idtac' x) T.
>
> (* 6: Illegal tactic application *)
> Fail silly (fun x => ltac:(idtac' x)) T.
>
> (* 7: The reference idtac'' was not found in the current environment. *)
> Fail silly (fun x => idtac'' x) T.
>
> (* 8: Cannot infer the type of x in environment:
> T : Type *)
> Fail silly (fun x => ltac:(idtac'' x)) T.
>
> (* 9: Cannot infer an internal placeholder of type "Type" in environment:
> T : Type
> x : Type *)
> Fail silly (fun (x : Type) => ltac:(idtac'' x)) T.
>
> I think by the end of this (attempts 8 and 9), I'm actually confused as to
> what I am manipulating, and what the internal placeholder is.
>
> Is there a way to make such a combinator so that I can call:
>
> silly (fun x => ltac:(someTactic x)).
>
> Or is there some fundamental issue with manipulating anonymous tactics?
>
> Best regards,
> - Valentin
- [Coq-Club] Issues mixing Ltac, anonymous tactics, eta-expansion, Valentin Robert, 04/01/2017
- Re: [Coq-Club] Issues mixing Ltac, anonymous tactics, eta-expansion, Pierre Courtieu, 04/01/2017
- Re: [Coq-Club] Issues mixing Ltac, anonymous tactics, eta-expansion, Valentin Robert, 04/01/2017
- Re: [Coq-Club] Issues mixing Ltac, anonymous tactics, eta-expansion, Pierre Courtieu, 04/01/2017
Archive powered by MHonArc 2.6.18.