coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Beta Ziliani <beta AT mpi-sws.org>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Canonical Structures and Coercions?
- Date: Sat, 29 Feb 2020 13:06:30 -0300
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=beta AT mpi-sws.org; spf=Pass smtp.mailfrom=beta AT mpi-sws.org; spf=None smtp.helo=postmaster AT jupiter.mpi-klsb.mpg.de
- Ironport-phdr: 9a23:IR+Z8hOhgAkfDYcDoSkl6mtUPXoX/o7sNwtQ0KIMzox0Ivj8rarrMEGX3/hxlliBBdydt6sYzbOO6+uwBCQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vIxi6txjdutUKjYdtKas8ygbCr2dVdehR2W5nKlWfkgrm6Myt5pBj6SNQu/wg985ET6r3erkzQKJbAjo7LW07/dXnuhbfQwSB4HscSXgWnQFTAwfZ9hH6X4z+vTX8u+FgxSSVJ8z2TbQzWTS/86dmTQLjhSkbOzIl9mzcl9d9h7xHrh2/uxN/wpbUYICLO/p4YqPdZs4RSW5YUspMSyBNHoawYo0IAOQcIOZYtJH9qEUSohuiCwesA+bvxSVJhn/wwKY21+ssHAXD0AEmAtkAsmnbrM/tOagdX+C6zqnGwzvAYf1Lxzny9JPFfQo9rfyWR798bdbdxEspGgjYjluQs4vlPzaN2+kQrWeb8/BvXv+shG4mrwFxoyKgxsEtioLUgY8a0U7L9Tljz4suIN24UE97bce/EJperCGWLYx2QtktQ2xxvisx17MIuZm+fCcQyZQnwQbSa/OGc4iU4hLjSf2eLS15hHJifr+0mhW88VC4x+HhWMS51ExGojdBn9XWtX0A1gbf5tWHR/dl4EutxTKC2xrQ5+xEO0w4iKvWJpw7zrItlJcesULOFTLslkrslq+ZbEAk9/Co6+v5ZrXmoYeRN41pigHmM6QuhtKwAf4iPggLR2ib+P2w1L7n/U3iW7pGlPg2krHWsJzAOMsUuLa1Aw5T0ok99xayFyqq3dockHUdMV5IfAiLgovoNl3UPfz1De+zg1G2nzdqw/DGMKfhApLILnXbi7juY6p95FRHxQo21dBf5otYCqoPIfLoQEPxs8bYDhAhPwyu3+nnEMl91p8ZWW+XHqCZN7rSvUaU6eIrPumDf5QYuC39Kvgg//7hl2U1mV4bfamz3JsYcmq0Hvp8IxbRXX25qdAYWUwOowB2GOftkRiJVSNZT3e0RaM1oD8hXtGIF4DGE6qgnLXJ7ia/H5RQZygSAF2QGF/tb4TBQOgXLiWILZkywXQ/SbG9Rtp5hlmVvwjgxu8ic7ONpn8o8Kn73d0w3NX90Ako/GUvXcGF0iSWUHoymXkHFWdvjfJP5Hdlw1LG6pBWxvlRFNhd/fRMC1xoMIbdivdlEJb1QA2TJ47UGmbjec2vBHQKdvx0w9IKZBwgSde/lhHf0jDsBqcU0r+PH5Zy97rTmXT8dZ5w
Sounds like that would bloat the search space of CS. In this case is obvious, but how do you foresee if you need some coercion (and which one!)?
Written from mobile. Excuse my limited communication.
On Sat, Feb 29, 2020, 11:39 AM Gregory Malecha <gmalecha AT gmail.com> wrote:
Hello --Is there a way to get canonical structures and coercions to work together? Here's my toy example:Structure EX : Type :=
{ t :> Type
; GET : t -> Prop }.
Definition foo {e : EX} := e.(GET).
Canonical Structure TrueEX : EX :=
{| GET := fun _ : bool => true |}.
Definition to_bool (n : nat) :=
match n with
| 0 => false
| _ => true
end.
Coercion to_bool : nat >-> bool.
Check (foo true). (* works great! *)
Check (foo 1). (* fails *)Intuitively, I would expect the term [@foo boolEX (to_bool 1)] but instead I get a type error "the term 1 has type nat while it is expected to have type EX".Is there some way to make this work without making instances for, e.g. [natEX], which is the composition of [to_bool] and [foo]?Thanks.--gregory malecha
- [Coq-Club] Canonical Structures and Coercions?, Gregory Malecha, 02/29/2020
- Re: [Coq-Club] Canonical Structures and Coercions?, Beta Ziliani, 02/29/2020
- Re: [Coq-Club] Canonical Structures and Coercions?, Gregory Malecha, 02/29/2020
- Re: [Coq-Club] Canonical Structures and Coercions?, Bas Spitters, 02/29/2020
- Re: [Coq-Club] Canonical Structures and Coercions?, Gregory Malecha, 02/29/2020
- Re: [Coq-Club] Canonical Structures and Coercions?, Beta Ziliani, 02/29/2020
Archive powered by MHonArc 2.6.18.