coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Ralf Jung <jung AT mpi-sws.org>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Gradual use of Program
- Date: Sun, 20 Mar 2016 17:32:46 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jung AT mpi-sws.org; spf=Pass smtp.mailfrom=jung AT mpi-sws.org; spf=None smtp.helo=postmaster AT hera.mpi-klsb.mpg.de
- Ironport-phdr: 9a23:ge+HtBL5ycKv/LNT+NmcpTZWNBhigK39O0sv0rFitYgUKf3xwZ3uMQTl6Ol3ixeRBMOAu6IC07ud6vi6EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35Txj7H5osWJKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FppIZ8VvDxeL19RrhFBhwnNXo07Yvlr0rtVwyKs0EVVmtesAdODECR7gz8Ub/0qiq/rfVmni6AMpulHvgPRT2+4vIzG1fTgyAdOmth/Q==
Hi all,
Is there some way to use some, but not all features of Program? The
opening of goals for "_" is sometimes really useful, while I find the
automatic introduction of eq_rect fairly disturbing -- not to mention
that it makes debugging pretty much impossible, since Coq will just
accept completely broken definitions and then expect you to show
impossible equivalences.
For example, consider this definition:
==============
Require Import Program.
Inductive tt : nat -> Type :=
| TT (n CTX : nat) : tt (CTX + n).
Program Definition t n : tt 5 := match n with
| O => TT 6 1
| S n => TT 0 5
end.
Next Obligation.
(* Goal: 7 = 5. This is not going to work out... *)
===============
What happens here is that Program inserts an eq_rect in the first arm of
the match, and then has me prove the necessary inequality. I'd much
rather explicitly call a cast function when coercions over equalities
are necessary. With eq_rect being inserted, there may be coercions in
places where you don't expect them (if Program solves that obligation
automatically), so I find myself manually checking "Print my_def" for
unexpected occurrences of eq_rect (and I found some!). Furthermore, in
case of a typo one does not get an error message (stating the expected
and actual type), but an impossible to prove and also often impossible
to parse goal. For some definitions the best I can do is watch the
number of obligations that are created; if it's 4, then I have a type
error somewhere (where? no idea), if it's 2, the definition is all
right. That is a pretty horrible way to write complex definitions.
It would be nice if there was a way to gradually use some of the
features of Program, without being forced to use others. Is that possible?
Kind regards,
Ralf
- [Coq-Club] Gradual use of Program, Ralf Jung, 03/20/2016
- Re: [Coq-Club] Gradual use of Program, Pierre-Marie Pédrot, 03/20/2016
- Re: [Coq-Club] Gradual use of Program, Jonathan Leivent, 03/20/2016
- Re: [Coq-Club] Gradual use of Program, Ralf Jung, 03/20/2016
- Re: [Coq-Club] Gradual use of Program, Jonathan Leivent, 03/20/2016
- Re: [Coq-Club] Gradual use of Program, Matthieu Sozeau, 03/25/2016
- Re: [Coq-Club] Gradual use of Program, Jonathan Leivent, 03/20/2016
- Re: [Coq-Club] Gradual use of Program, Ralf Jung, 03/20/2016
Archive powered by MHonArc 2.6.18.