coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: geng chen <chengeng4001 AT gmail.com>
- To: AUGER Cedric <Cedric.Auger AT lri.fr>
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Representation of bit sequence
- Date: Thu, 5 Aug 2010 09:45:53 +0800
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=RrHGkMPkw8S3EnHMmmjpbQ41L+n5nsEdYAL9sgOKDxUdfA9p+nVvTKSDBcrYeBsxWe sN3voKxo2uNtCAtLYajWwwaVFcyB8WY13eAMFZTspTnS49OouYUdAjfk9it23hMQixQS TaS+YAvawKWrfSvEZxJxCAbGbmtyl/CU1LBjk=
Thanks for helping! the Compcert Coq file Integers.v is what I need. Thanks
2010/8/4 AUGER Cedric <Cedric.Auger AT lri.fr>
Le Wed, 4 Aug 2010 14:39:10 +0800,
geng chen <chengeng4001 AT gmail.com> a écrit :
Can you precise your question?
> hi, everyone
> Recently, I need to represent the bit sequence in Coq and I need to
> transform the data into decimal number and vice versa. Is it
> implemented in the standard lib? I think the Bvector is not enough
> and hard to use.
>
> Best regards,
> Chen
What is "the data"?
What is "decimal number"?
Post your inductive types and we can see that.
(Co?)Inductive data: Type := ...
(Co?)Inductive decimal_number: Type := ...
In coq, number types already defined are:
- nat (but it is in "base 1")
- positive (positive numbers in base 2)
- Z (negative + zero + positive in base 2)
- Real (not relying on a notion of base afaik, but I never used them)
I don't know if it is standard, but I believe we have some library of
something looking as Int32 (in fact a dependant sum with a Z and a
proof of correct range).
For data, we have a string type
(list of ascii ~ {b0:bool;b1:bool;b2:bool;...;b7:bool}; I know it is
cheating as true ascii are only 7bits).
- [Coq-Club] Representation of bit sequence, geng chen
- Re: [Coq-Club] Representation of bit sequence,
AUGER Cedric
- Re: [Coq-Club] Representation of bit sequence, geng chen
- Re: [Coq-Club] Representation of bit sequence,
AUGER Cedric
Archive powered by MhonArc 2.6.16.