coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "Lucian M. Patcas" <lucian.patcas AT gmail.com>
- To: Stéphane Glondu <steph AT glondu.net>
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] How to make the tactic ring use my ring structure?
- Date: Mon, 27 Jun 2011 16:08:12 -0400
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=BVzG72WSDKY6myDPJ7pvV8wXdIi4M6+3D5zIoCO9Rblp23JamrBa0zFZMaOryRvXuV Is48G7fWF7cIylCJwpH0fDJ7arUxZ5a03l9XRvTpeJXk2V2PlU5SlHmZwBoWJnuusE7G 3R/UJU6f1Q1w14nzbBbwlOHDKmGBHGdI/sM6k=
On Mon, Jun 27, 2011 at 13:55, Stéphane Glondu <steph AT glondu.net> wrote:
I've tried to replicate what they did in the standard library in Coq.setoid_ring.ArithRing for nat, but I'm stuck proving the Lemma
Inductive my_r :=
| origin : my_r
| next : my_r -> my_r.
Fixpoint my_r_plus (n m : my_r) : my_r :=
match n with
| origin => m
| next p => next (my_r_plus p m)
end.
Fixpoint my_r_mult (n m : my_r) : my_r :=
match n with
| origin => origin
| next p => my_r_plus m (my_r_mult p m)
end.
Check semi_ring_theory origin (next origin).
Lemma my_r_th : semi_ring_theory origin (next origin) my_r_plus my_r_mult (@eq my_r).
Add Ring my_r : my_r_th.
It's just me not knowing how to prove that Lemma or I am missing something and registering a ring doesn't work this way?
Thanks,
Lucian
Le 27/06/2011 19:47, Lucian M. Patcas a écrit :
> I need to define a ring structure and convince the ring tactic to use> at how nat is "registered" as a ring inCoq.setoid_ring.ArithRing, but I
> it. I looked in the manual and in the module Ring_theory. I also looked
> still don't know how exactly to define a ring structure and how to useCan you give an example of what you think should work, but doesn't?
> Add Ring.Perhaps I'm missing something. Can someone help out?
I've tried to replicate what they did in the standard library in Coq.setoid_ring.ArithRing for nat, but I'm stuck proving the Lemma
Inductive my_r :=
| origin : my_r
| next : my_r -> my_r.
Fixpoint my_r_plus (n m : my_r) : my_r :=
match n with
| origin => m
| next p => next (my_r_plus p m)
end.
Fixpoint my_r_mult (n m : my_r) : my_r :=
match n with
| origin => origin
| next p => my_r_plus m (my_r_mult p m)
end.
Check semi_ring_theory origin (next origin).
Lemma my_r_th : semi_ring_theory origin (next origin) my_r_plus my_r_mult (@eq my_r).
Add Ring my_r : my_r_th.
It's just me not knowing how to prove that Lemma or I am missing something and registering a ring doesn't work this way?
Thanks,
Lucian
- [Coq-Club] How to make the tactic ring use my ring structure?, Lucian M. Patcas
- Re: [Coq-Club] How to make the tactic ring use my ring structure?,
Stéphane Glondu
- Re: [Coq-Club] How to make the tactic ring use my ring structure?, Lucian M. Patcas
- Re: [Coq-Club] How to make the tactic ring use my ring structure?,
Laurent Théry
- Re: [Coq-Club] How to make the tactic ring use my ring structure?, Lucian M. Patcas
- Re: [Coq-Club] How to make the tactic ring use my ring structure?,
Laurent Théry
- Re: [Coq-Club] How to make the tactic ring use my ring structure?, Lucian M. Patcas
- Re: [Coq-Club] How to make the tactic ring use my ring structure?,
Adam Chlipala
- Re: [Coq-Club] How to make the tactic ring use my ring structure?, Lucian M. Patcas
- Re: [Coq-Club] How to make the tactic ring use my ring structure?,
Stéphane Glondu
Archive powered by MhonArc 2.6.16.