coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Daniel Schepler <dschepler AT gmail.com>
- To: Richard Dapoigny <richard.dapoigny AT univ-savoie.fr>
- Cc: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] problem with destruct
- Date: Thu, 30 Jan 2014 14:02:00 -0800
A type class with one field and no curly braces is implemented via a simple alias definition. So, to give a silly example:
Class Commutative {A:Type} (op : A -> A -> A) : Prop :=
commutativity : forall x y:A, op x y = op y x.
Lemma silly : Commutative Peano.minus -> False.
Proof.
intros.
red in H. (* or unfold Commutative in H. *)
discriminate (H 0 1).
Qed.
Class Commutative' {A:Type} (op : A -> A -> A) : Prop := {
commutativity' : forall x y:A, op x y = op y x
}.
Lemma silly' : Commutative' Peano.minus -> False.
Proof.
intros.
destruct H.
discriminate (commutativity'0 0 1).
Qed.
--
Daniel Schepler
On Thu, Jan 30, 2014 at 12:09 PM, Richard Dapoigny <richard.dapoigny AT univ-savoie.fr> wrote:
Hi everybody,
While "destruct" works fine with type classes having multiple fields I do not succeed to get the field if there is only a single field.
Does anyone knows some tactic to extract the field in an operational type class?
Thanks in advance,
Rich.
--
Attachment:
Sign.jpg
Description: JPEG image
- [Coq-Club] More simple examples, Thomas Knight, 01/24/2014
- Re: [Coq-Club] More simple examples, Adam Chlipala, 01/27/2014
- Re: [Coq-Club] More simple examples, Daniil Frumin, 01/27/2014
- Re: [Coq-Club] More simple examples, Kevin Sullivan, 01/27/2014
- Re: [Coq-Club] More simple examples, Thomas Knight, 01/28/2014
- Re: [Coq-Club] More simple examples, Kevin Sullivan, 01/29/2014
- Re: [Coq-Club] More simple examples, Thomas Knight, 01/29/2014
- [Coq-Club] problem with destruct, Richard Dapoigny, 01/30/2014
- Re: [Coq-Club] problem with destruct, Daniel Schepler, 01/30/2014
- Re: [Coq-Club] More simple examples, Kevin Sullivan, 01/29/2014
- Re: [Coq-Club] More simple examples, Thomas Knight, 01/28/2014
- Re: [Coq-Club] More simple examples, Thomas Knight, 01/28/2014
- Re: [Coq-Club] More simple examples, Kevin Sullivan, 01/27/2014
- Re: [Coq-Club] More simple examples, Nuno Gaspar, 01/27/2014
- Re: [Coq-Club] More simple examples, Thomas Knight, 01/28/2014
Archive powered by MHonArc 2.6.18.