Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] How to access the elements of a record in coq

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] How to access the elements of a record in coq


Chronological Thread 
  • From: Eddy Westbrook <westbrook AT kestrel.edu>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] How to access the elements of a record in coq
  • Date: Thu, 13 Nov 2014 16:06:48 -0800

The fields of a record become projection functions. So, in your definition, universe has type ToyModel -> Set, i.e., when applied to a ToyModel, universe projects out and returns the universe component of it. Similarly with the other fields you have defined.

From there, you should hopefully be able to write your definition. :)

-E

On Nov 13, 2014, at 3:43 PM, Namio Namelander <verifying AT ndtvmail.com> wrote:

Suppose I have a record

    Record ToyModel:={
    universe:Set;
    aNiceProperty:universe->Prop;
    color:universe->nat
    }.

I would like to define a notion of compatibility for
elements of type ToyModel.

    Definition Compatible(T1 T2: ToyModel):=
    if there is an element of T1.universe with color a then there
    exists an element of T2.universe with color a.

How can I write this in coq? The problem is that I don't know
how to access the elements inside a record.






Archive powered by MHonArc 2.6.18.

Top of Page