coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Xuanrui Qi <xqi01 AT cs.tufts.edu>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Certified insertion
- Date: Sat, 08 Dec 2018 17:19:56 -0500
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=xqi01 AT cs.tufts.edu; spf=None smtp.mailfrom=xqi01 AT cs.tufts.edu; spf=None smtp.helo=postmaster AT vm-delivery1.eecs.tufts.edu
- Ironport-phdr: 9a23:WYZ2hRwqmlBtfHnXCy+O+j09IxM/srCxBDY+r6Qd1OsXIJqq85mqBkHD//Il1AaPAd2Lraocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze+/94HQbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDwULs6Wymt771zRRHrlSkJNyA3/m/Vhcx+kK1Urh2uqRNkzo7IYoyYLuZycr/HcN4YQ2dKQ8ZfVzZGAoO5d4YADvcBMvxer4nnulsOrAa1CxKtBOjyzTJJiWb23awm3+g8CgzJwBcgE8gSsHTJotX1KLwSXfqrw6bV0DXOdvVb0ir+5ojQah0tvP+BUa5qfcfQxkQjDR3Jg1uKpYHrPT6ZzvoBv3Sf4uZ6VO+jkWEqpg9rrjSyx8ohiI/EjZ8PxF/e7yV22oM1KMW4SEFlZd6kF4Ndtz+fN4dvX8wtXWVouCckyrIYo566fDUGxI45yBHBd/OHaJKE4g7+VOafPTd4n2hpd6yiiBav6USgy+v8Wdeo0FtSsyZInMXAumoM2hHc8MSLVPVw8l2v1DuNzwzT7/tLIUEwlarVMZ4hxbswm4IcsETaHy/6hFj6gbSKeUU/4OSo9/nnYrv6pp+HLYN7lBzxMrk2lsylHes4KhQOX3Sc+emkyLLj+lT5TKxWgf0yj6nWq4vXJd8bp668Gw9ayJwv6xe5Dze80dQXh2MLLFxfeEHPs4+8MFbXZfv8EP2XglK2kT4tyeqVEKfmB8D9M3HFiqrgNY98oxpM0QtrlPhU/NRIF78dO7T+VlKn54+QNQMwLwHhm7WvM956zI5LATveUJ/cC7vbtBqz3sxqJuCNYIEPvzOkd6ou/LjykHElghkQcbT7hcJLOkD9JexvJgCiWVSpms0ISDtYtRF4UPHklEbEXDJONS7rAvAMowojAYfjNr/tA4CghLvbjXWlG9haa2RHFF2WAC6ueoiPQLEQdSyOOYlsniFWDbU=
Adding to Adam's comment:
> There should be a high standard of justification for any
> explicit dependent types (which are sometimes the right tool for a
> job). It tends to be painful to define and reason about such
> programs.
> Experts generally avoid it.
Adam is definitely the expert here, and his words are very true.
I tend to use dependent types in Coq when (1) I want to encode
something using dependent types (usually just a type indexed by a few
nat's) and (2) the invariants are too complex to prove without tactics.
Subset types are difficult to reason with even with `Program Fixpoint`
or `Function`! Sometimes, you can't even define the functions you want
with `Program Fixpoint`, which makes it just a total mess. There are
various workarounds (like defining your program using tactics), but
it's totally not worth the trouble to get into, unless absolutely
necessary.
Besides, if you want a certified ML program, dependent types will
extract to really dirty code with `Obj.magic` everywhere, which is not
ideal. So, Coq is really not designed for dependently-typed programming
(although you can do it), and avoiding it would be the wise thing to
do. In my opinion, this is a serious flaw in the design Coq.
-Ray
On Sat, 2018-12-08 at 20:57 +0100, Klaus Ostermann wrote:
> Hi Adam,
> > It actually isn't idiomatic to program with subset types in Coq! I
> > recommend avoiding explicit dependently typed programming whenever
> > possible. There should be a high standard of justification for any
> > explicit dependent types (which are sometimes the right tool for a
> > job). It tends to be painful to define and reason about such
> > programs. Experts generally avoid it.
> >
> thanks for your advice. I actually guessed that much by now. However,
> my
> intention here was to experience and understand the nature of the
> pain :)
>
> Klaus
- [Coq-Club] Certified insertion, Klaus Ostermann, 12/08/2018
- Re: [Coq-Club] Certified insertion, Jason -Zhong Sheng- Hu, 12/08/2018
- Re: [Coq-Club] Certified insertion, Xuanrui Qi, 12/08/2018
- Re: [Coq-Club] Certified insertion, Adam Chlipala, 12/08/2018
- Re: [Coq-Club] Certified insertion, Klaus Ostermann, 12/08/2018
- Re: [Coq-Club] Certified insertion, Xuanrui Qi, 12/08/2018
- Re: [Coq-Club] Certified insertion, Jonathan Leivent, 12/09/2018
- Re: [Coq-Club] Certified insertion, Klaus Ostermann, 12/08/2018
- Re: [Coq-Club] Certified insertion, David Holland, 12/19/2018
- Re: [Coq-Club] Certified insertion, Jason -Zhong Sheng- Hu, 12/08/2018
Archive powered by MHonArc 2.6.18.