Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] how to represent the assumption of a finite set

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] how to represent the assumption of a finite set


chronological Thread 
  • From: Gyesik Lee <leegys AT gmail.com>
  • To: Thomas Strathmann <thomas AT pdp7.org>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] how to represent the assumption of a finite set
  • Date: Fri, 6 May 2011 23:49:07 +0900
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=sgDMkxkl9BL+bc4l3TqfVsedaslDfYLNhPIwaNJeBJ92rO/FSrWAdKkAQiEWUBY+9F 8zr9+cv8Kifh94inrLOGaHZzakMq836BRFljH960vLGR5kZsDqcZth+qZj1KtzA8G/PI srWu1BpBFr30wFScygZ8zGvbH3W8B87PbttqA=

Many thanks to all for valuable suggestions.
At a first glance, Thomas' suggestion seems very simple and intuitive for me.
(indeed it corresponds to the standard definition of finiteness in set 
theory.)
What I need is just an assumption of a finite set of symbols and not a
theory on it.
In this sense, I am not sure if I need the standard libraries such as
FSets (or MSets).

Gyesik



2011/5/6 Thomas Strathmann 
<thomas AT pdp7.org>:
> On 5/6/11 10:38 , Gyesik Lee wrote:
>>
>> many languages are based on a finite set of symbols.
>> I am wondering how to represent phrases such as "Let L be a finite set
>> of constants".
>> On paper, we usually say, L is indexed by numbers less than a natural
>> number.
>> Is there a simple, intuitive way to do the same thing in Coq?
>> Any help will be appreciated.
>
> You can do the latter in Coq by defining an inductive type of natural
> numbers less than n that you can use in much the same way as you would
> [nat].
>
> Inductive fin : nat -> Type :=
> | FO : forall n, fin (S n)
> | FS : forall n, fin n -> fin (S n).
> Implicit Arguments FO [n].
> Implicit Arguments FS [n].
>
>        Thomas
>




Archive powered by MhonArc 2.6.16.

Top of Page