Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Question

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Question


Chronological Thread 
  • From: Gregory Malecha <gregory AT bedrocksystems.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Question
  • Date: Sun, 6 Sep 2020 22:42:31 -0400
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gregory AT bedrocksystems.com; spf=None smtp.mailfrom=gregory AT bedrocksystems.com; spf=None smtp.helo=postmaster AT mail-pg1-f181.google.com
  • Ironport-phdr: 9a23:sByRYhbuhlnHTHInY7qz+o7/LSx+4OfEezUN459isYplN5qZr8uybnLW6fgltlLVR4KTs6sC17OI9fm6BSdQuN6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vLRi6txjdutcZjIdtKas91wbCr2dVdehR2W5mP0+YkQzm5se38p5j8iBQtOwk+sVdT6j0fLk2QKJBAjg+PG87+MPktR/YTQuS/XQcSXkZkgBJAwfe8h73WIr6vzbguep83CmaOtD2TawxVD+/4apnVAPkhSEaPDM/7WrZiNF/jLhDrR2uqRxwwY7abo+WOvRjYK3SYcgXSnBdUstLTSFNHp+wYokJAuEcPehYtY79p14WoBW/HwmjGuzvyjhShn72wKY01P4uEQXY0wM8H9IBqmnfodL6NKcIT++1w67IzS/Dbv5Nwjjy9pXHcgomof6QXrJwasrQyVIzFwzbi1WQspbpMC+S1uQIqmWW6fdrWu2zhWA9sQ5xviSvydk2ionPno8Y1k7J+Tt6zYs3K9O1SU12bN+4HZZNuSyXNpZ6TM0+T2xntig316MKtJy7cSUKx5kqxhDSZfKEfoWW/x/uVeacLDFlj3xrf7K/ggy98UmmyuDkS8m01ldKrjRcntnXs3ACzAbf6sadSvZ740yv2i6P2hjN5u1YJU04j6nWJp47zrIui5YesV7PEjL1lUnriqKda18q9fKy6+v9Z7Xrvp+cOJFwigH5Kqkun9awAeU8MgQXR2ib9vmw2KTt/UHkQ7hGk+c6kqbesJDdKsQborC2DxVJ3YYk7hazFzam0NIGknkbNF9JZg6LgozzN1zNIP30F+mzj0msnTtx2vzLPaDtDo3ILnfZkbfhebh961RbyAo21d1f6IhUBa8OIPL0QE/wtMfVAQQnPAOp2ebnD8ly1oAFWWOPGa+ZLL3dsVqT5u41P+aMY4oVtC7nK/c5//7ukWM5mVgFcKa12psXcWm0EehiI0WEenXhmcwBEGcPvgomVuPmklyCUThJZ3azRa0w/D87CJj1RbvEE4uqmfmK2DqxNpxQfGFPTF6WQlnycIDRdO0BZyWIM4dEmzgJXrioA9suzxyhsxXr47BqIvDT8S4DpIn/2d1uoebUkEdhpnRPE82B3jTVHClPlWQSSmpuhf0tkQlG0l6GlJNArblYGNhUva0bVw47MdvEwLU/BYmiA0TOedCGTFvgSdKjU2loEoABhuQWakM4IO2MywjZ1nDyUbUYm6aMD58v47nA0n3qYc16ziSejfhzvxwdWsJKcFaeqOt6/gnXCZTOlh/Bxayneb4b1y3W5XyfwG+V+kpfVVwoXA==

Hi Richard --

I would hope that there is a nicer solution to your problem, but there isn't enough context in your email for me to know exactly where you're going. In general, if you want Coq to use information of this sort, you need to express it explicitly using a dependent pattern match. In many cases, you can wrap this up in a definition, but essentially what it would look like is the eliminator for the equality type:

About eq_rect.
eq_rect : forall (A : Type) (x : A) (P : A -> Type), P x -> forall y : A, x = y -> P y

Note that here you get to pick anything that you want for [P]. In your context, you would set [P := fun x => x], and the equality proof would be the one that you want to "use". Depending on what way you want to use it, you can either use [eq_sym] to swap the order, or rewrite the equality to be the other direction.

Hope this helps.

Just as an FYI, the last time that I worked on encoding objects inside Coq, was before universe polymorphism and at that point I quickly ran into universe issues. I think it should be more tractable at this point though.

On Sun, Sep 6, 2020 at 3:14 PM richard Dapoigny <richard.dapoigny AT univ-smb.fr> wrote:

Dear Coq users,

I have the following problem with the code fragment:

Record object : Type := {

ob_class : Type;

ob : ob_class}.

Class Lives : Type := {

n01 : nationalities;

h01 : house;

pr01 : lives h01 = n01

}.

Class hasColor : Type := {

h02 : house;

c01 : color;

pr03 : Color c01 = h02

}.

Hypothesis A001 : forall (x:hasColor)(y:Lives)(Xob:object), @ob_class Xob = house /\ @h02 x = @ob Xob /\ Color Red = (@h02 x) /\ lives (@h02 x) = Englishman.

I get the following error: Illegal application (Non-functional construction):
The _expression_ "ob" of type "house" cannot be applied to the term  "Xob" : "object"

The problem is that the type of @ob Xob is @ob_class Xob which is equal to house from the first assertion. The second assertion cannot take this assertion in account. So the question is: is there a way to overcome this behavior?

Thanks in advance for your answer,

Richard


--
Richard Dapoigny
Associate Professor - LISTIC Laboratory
University Savoie Mont-Blanc
5, chemin de Bellevue
Po. Box 80439
Annecy-le-Vieux 74940
FRANCE
https://www.listic.univ-smb.fr/en/presentation-en/members/lecturers/richard-dapoigny-en/

****** People who don't know history are condemned to repeat it. ******



--

Gregory Malecha

Mail: gregory AT bedrocksystems.com

BedRock

Systems Inc
UNBREAKABLE FOUNDATION FOR

FORMALLY SECURED COMPUTING


  • [Coq-Club] Question, richard Dapoigny, 09/06/2020
    • Re: [Coq-Club] Question, Gregory Malecha, 09/07/2020

Archive powered by MHonArc 2.6.19+.

Top of Page