coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Durward McDonell <Durward.McDonell AT jhuapl.edu>
- To: <coq-club AT inria.fr>
- Subject: [Coq-Club] Accessing Class members
- Date: Tue, 12 Jan 2016 10:01:48 -0500
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=Durward.McDonell AT jhuapl.edu; spf=Pass smtp.mailfrom=Durward.McDonell AT jhuapl.edu; spf=Pass smtp.helo=postmaster AT piper.jhuapl.edu
- Ironport-phdr: 9a23:dXutHxMHVbNovBJ8NJ8l6mtUPXoX/o7sNwtQ0KIMzox0KPjyrarrMEGX3/hxlliBBdydsKIazbqK+Pi+EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35rxh7z5o8ObSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6Lpyv/JHBPHxeL19RrhFBhwnNXo07Yvlr0+QYxGI4y4wT38JmwBESy3OwBb8U5P1+n/Wq/Bi0TOWe+j9YbcyVDCmx6VrVRbwjGEKOyNvozKfsdB5kK8O+EHpnBd42YOBOIw=
Hello.
I am trying to use the ZModulo library, and having some difficulty
accessing ops and specs. Here are some relevant bits:
In CyclicAxioms.v we have
Module ZnZ.
Class Ops (t:Type) := MkOps {
...
compare : t -> t -> comparison; (* e.g. *)
...
}.
(* And something similar for Specs. *)
End ZnZ.
In ZModulo.v we have
Section ZModulo.
Variable digits : positive.
Hypothesis digits_ne_1 : digits <> 1%positive.
...
(* Definitions for everything in ZnZ.Ops and ZnZ.Specs. *)
...
Instance zmod_ops : ZnZ.Ops Z := ZnZ.MkOps (* Here is a list of
previous definitions. *).
Instance zmod_specs : ZnZ.Specs zmod_ops := ZnZ.MkSpecs (* Here is a
list of previous definitions. *).
End ZModulo.
Module Type PositiveNotOne.
Parameter p : positive.
Axiom not_one : p <> 1%positive.
End PositiveNotOne.
Module ZModuloCyclicType (P:PositiveNotOne) <: CyclicType.
Definition t := Z.
Instance ops : ZnZ.Ops t := zmod_ops P.p.
Instance specs : ZnZ.Specs ops := zmod_specs P.not_one.
End ZModuloCyclicType.
In foo.v, I have put (omitting scopes and imports)
Module PNO : PositiveNotOne.
Definition p := 3%positive. (* I.e., we want 3-bit numbers with
cyclic addition. *)
Lemma not_one : p <> 1%positive.
Proof.
unfold p.
discriminate.
Qed.
End PNO.
Module ZMCT := ZModuloCyclicType PNO.
But now I cannot access, e.g., ZMCT.ops.compare (or ZMCT.ops.(compare),
or (compare ZMCT.ops)).
How do I do something interesting with ZMCT?
--
Durward McDonell
durward.mcdonell AT jhuapl.edu
240-228-2690 (DC)
443-778-2690 (Balt.)
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
- [Coq-Club] Accessing Class members, Durward McDonell, 01/12/2016
- Re: [Coq-Club] Accessing Class members, John Wiegley, 01/12/2016
- Re: [Coq-Club] Accessing Class members, Durward McDonell, 01/12/2016
- Re: [Coq-Club] Accessing Class members, Sosuke MORIGUCHI, 01/12/2016
- Re: [Coq-Club] Accessing Class members, Durward McDonell, 01/13/2016
- Re: [Coq-Club] Accessing Class members, Durward McDonell, 01/12/2016
- Re: [Coq-Club] Accessing Class members, Arnaud Spiwack, 01/13/2016
- Re: [Coq-Club] Accessing Class members, Durward McDonell, 01/13/2016
- Re: [Coq-Club] Accessing Class members, Arnaud Spiwack, 01/13/2016
- Re: [Coq-Club] Accessing Class members, John Wiegley, 01/12/2016
Archive powered by MHonArc 2.6.18.