coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gregory Malecha <gmalecha AT cs.harvard.edu>
- To: Jason Gross <jasongross9 AT gmail.com>
- Cc: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] eval change
- Date: Fri, 22 Mar 2013 21:25:09 -0400
Yes, I think I remember hearing that [change] is hacked together to some extent. (For example, I think you can use question marks and holes in [change], but only if it's not inside of some other Ltac code.)
I think you could also do something like
Ltac foo x A B :=
match x with
| appcontext C[A] => let C' := context C[B] in
foo C' A B
| _ => x
end.which has the (debatable) advantage of not using continuations, but the disadvantage of using context (and of being recursive) which you said you didn't want.
What's the intended use case?
-Jason
On Mar 22, 2013 4:20 PM, "Gregory Malecha" <gmalecha AT eecs.harvard.edu> wrote:That would work, it seems very heavy-handed though.On Fri, Mar 22, 2013 at 3:07 PM, Jason Gross <jasongross9 AT gmail.com> wrote:
Can do something like (untested):
Ltac do_change x A B tac :=
let H := fresh in
pose x as H;
change A with B in x;
let x' := eval unfold H in H;
clear H;
tac x'.?
-Jason
On Mar 22, 2013 2:18 PM, "Gregory Malecha" <gmalecha AT eecs.harvard.edu> wrote:Hello --Is there a way in Ltac to run [change] on a term? For example, I'd like to do:let x := eval change A with B in x in ....in order to change all of the uses of A with B.Ideally I would be able to do this without a [match ... with context [ A ] => ... end].--gregory malecha
- [Coq-Club] eval change, Gregory Malecha, 03/22/2013
- Re: [Coq-Club] eval change, Jason Gross, 03/22/2013
- Re: [Coq-Club] eval change, Gregory Malecha, 03/22/2013
- Re: [Coq-Club] eval change, Jason Gross, 03/22/2013
- Re: [Coq-Club] eval change, Gregory Malecha, 03/23/2013
- Re: [Coq-Club] eval change, Jason Gross, 03/22/2013
- Re: [Coq-Club] eval change, Gregory Malecha, 03/22/2013
- Re: [Coq-Club] eval change, Jason Gross, 03/22/2013
Archive powered by MHonArc 2.6.18.