coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Edwin Westbrook <westbrook AT kestrel.edu>
- To: Jason Gross <jasongross9 AT gmail.com>
- Cc: "Soegtrop, Michael" <michael.soegtrop AT intel.com>, "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] autorewrite for hypothesis?
- Date: Wed, 13 Nov 2013 15:16:17 -0800
Here is autorewrite using just hypotheses (it may loop, just like autorewrite):repeat match goal with| [ H : _ |- _ ] => rewrite Hend.-JasonOn Wed, Nov 13, 2013 at 4:24 AM, Soegtrop, Michael <michael.soegtrop AT intel.com> wrote:
Dear Coq users,
I wonder if there is something like autorewrite, which can use hypothesis. This would be handy e.g. in the proof below from the SW foundations course. Something like “Hint Rewrite Hd1 Hd2: base“ doesn’t seem to work. I know that autorewrite can be dangerous because it can loop forever, but couldn’t one make an autorewrite tactic, which uses all equality hypothesis but only such that the goal gets shorter, possibly using only hypothesis with no or trivial pre-conditions? Then it would be guaranteed to terminate and this might be handy in quite a few situations.
Best regards,
Michael
Theorem bool_fn_applied_thrice:
forall (f : bool -> bool) (b : bool),
f (f (f b)) = f b.
Proof.
intros.
destruct (f true) eqn:Hd1.
destruct (f false) eqn:Hd2.
destruct b.
rewrite -> Hd1. rewrite -> Hd1. rewrite -> Hd1. reflexivity.
rewrite -> Hd2. rewrite -> Hd1. rewrite -> Hd1. reflexivity.
destruct b.
rewrite -> Hd1. rewrite -> Hd1. rewrite -> Hd1. reflexivity.
rewrite -> Hd2. rewrite -> Hd2. rewrite -> Hd2. reflexivity.
destruct (f false) eqn:Hd2.
destruct b.
rewrite -> Hd1. rewrite -> Hd2. rewrite -> Hd1. reflexivity.
rewrite -> Hd2. rewrite -> Hd1. rewrite -> Hd2. reflexivity.
destruct b.
rewrite -> Hd1. rewrite -> Hd2. rewrite -> Hd2. reflexivity.
rewrite -> Hd2. rewrite -> Hd2. rewrite -> Hd2. reflexivity.
Qed.
P.S.: I know that this can be done shorter, but this way the proof is closer to how I would do it mentally.
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), (continued)
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Ilmārs Cīrulis, 11/06/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), AUGER Cédric, 11/07/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Ilmārs Cīrulis, 11/07/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Cedric Auger, 11/07/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Ilmārs Cīrulis, 11/13/2013
- [Coq-Club] autorewrite for hypothesis?, Soegtrop, Michael, 11/13/2013
- Re: [Coq-Club] autorewrite for hypothesis?, Jason Gross, 11/13/2013
- RE: [Coq-Club] autorewrite for hypothesis?, Soegtrop, Michael, 11/13/2013
- Re: [Coq-Club] autorewrite for hypothesis?, Eric Mullen, 11/13/2013
- RE: [Coq-Club] autorewrite for hypothesis?, Soegtrop, Michael, 11/14/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Cedric Auger, 11/07/2013
- Re: [Coq-Club] autorewrite for hypothesis?, Edwin Westbrook, 11/14/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Ilmārs Cīrulis, 11/07/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), AUGER Cédric, 11/07/2013
- Message not available
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Ilmārs Cīrulis, 11/25/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Rui Baptista, 11/26/2013
- Re: [Coq-Club] Posting my first bigger stuff (for experience/training), Ilmārs Cīrulis, 11/06/2013
Archive powered by MHonArc 2.6.18.