Subject: Ssreflect Users Discussion List
List archive
- From: t x <>
- To: Guillaume Melquiond <>
- Cc: "" <>
- Subject: Re: rewrite-by
- Date: Tue, 3 Sep 2013 18:22:29 +0000
Georges: Thanks for the clarification. Pierre's solution of "first 1 [idtac] || by cheap_tactic" makes sense now. Thanks for explaining this.
Guillaume: in the above example, it fails because it binds 3 = 3 + 0
Goal 2: (related to "x=0")
1 = 0
1 = 0
Then, it fails with "impossible to unify 0 with 1."
This seems consistent with my belief -- "rewrite H by reflexivity" fails because it couldn't solve one of the required premises.
On Tue, Sep 3, 2013 at 4:49 PM, Guillaume Melquiond <> wrote:
Le 03/09/2013 14:01, Georges Gonthier a écrit :Is that so? If Coq was using cheap_tactic, I would expect the following script to succeed:
Hi,
The bracketing isn't quite right: this should read
rewrite some_rule; first 1 [idtac] || by cheap_tactic.
Note that you can write this using plain Coq tacticals, as
rewrite some_rule; [| by cheap_tactic..]
The two lines above are equivalent, but not quite equivalent to rewrite .. by, which you can still get while using ssreflect by writing
rewrite -> some_rule by cheap_tactic.
I believe the above can use the success of cheap_tactic to decide which occurrence to rewrite, while the top two only control whether the rewrite proceeds at all.
Goal (forall x y, x = 0 -> y + x = y) -> 3 + 1 = 3 + 0.
intros H.
rewrite H by reflexivity. (* fails because rewrite matched 3 + 1 *)
As far as I understand, there is no difference between "rewrite by" and "rewrite ;".
Best regards,
Guillaume
- Re: rewrite-by, (continued)
- Re: rewrite-by, t x, 09/03/2013
- Re: rewrite-by, t x, 09/03/2013
- Re: rewrite-by, Beta Ziliani, 09/03/2013
- Re: rewrite-by, t x, 09/03/2013
- Re: rewrite-by, Pierre-Yves Strub, 09/03/2013
- Re: rewrite-by, Pierre-Yves Strub, 09/03/2013
- Re: rewrite-by, Anders, 09/03/2013
- Re: rewrite-by, t x, 09/03/2013
- Re: rewrite-by, Pierre-Yves Strub, 09/03/2013
- RE: rewrite-by, Georges Gonthier, 09/03/2013
- Re: rewrite-by, Guillaume Melquiond, 09/03/2013
- Re: rewrite-by, t x, 09/03/2013
- Re: rewrite-by, Pierre-Yves Strub, 09/03/2013
- Re: rewrite-by, t x, 09/03/2013
- Re: rewrite-by, t x, 09/03/2013
Archive powered by MHonArc 2.6.18.