coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Courtieu <pierre.courtieu AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Debugging an apparently diverging Coq program
- Date: Tue, 24 Sep 2019 10:04:55 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=pierre.courtieu AT gmail.com; spf=Pass smtp.mailfrom=pierre.courtieu AT gmail.com; spf=None smtp.helo=postmaster AT mail-io1-f44.google.com
- Ironport-phdr: 9a23:kk+8PBXK1Zkei+281bRzgdSy6NjV8LGtZVwlr6E/grcLSJyIuqrYbReHt8tkgFKBZ4jH8fUM07OQ7/m7HzZRqs/b4DgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrowjdrNcajI9tJqos1BfEoWZDdvhLy29vOV+dhQv36N2q/J5k/SRQuvYh+NBFXK7nYak2TqFWASo/PWwt68LlqRfMTQ2U5nsBSWoWiQZHAxLE7B7hQJj8tDbxu/dn1ymbOc32Sq00WSin4qx2RhLklDsLOjgk+2zMlMd+kLxUrw6gpxxnwo7bfoeVNOZlfqjAed8WXHdNUtpNWyBEBI6zaJYBD/caPeZAsYbyu0cOoxW5BQmpHuzvyzlIjWLy0aA11+ktFAfL1xEiEd0TqnTZtNr6NKkQXu61wqfGzijNYe1K1jrm8ofEbgosrOuQUb5sc8fcz1QkGQPfjlWXrIzoJymb1uUTvGiB9epvS/+khnAgqwFsuDiv2sYshZfUhokIzV3E7SR5z5gvJd2iVkF3e8KrEJxNtyGAK4t2Q90tQ3xztSY1z70Jo5+7fCwQxJs7wB7fbuWKfo6V6RztU+aRJC13hHNjeL+nmxmy9lKgyuviWcmw1FZGtDRKncTRtnwV1hzT7NKHSvpn8Uu71zaPzRjf6u5FIUAolarbNoUuzqQxlpoUqUjDES72mFn2jK+LbUoo4PSn6+PiYrjgu5SSNJd0hxngPqgynsGzG+c1PwgUU2SG+Omx1afv8EL2TbhMk/Y4iLPWsIrAKsQevqO5AxFa0oIk6xunCjepytUYnX0eIFJEfxKLkpHlO1/BLf33F/u/jFOskDBkx/DCILLtGInCLn/GkLv5fLZ97VBTyBYrwNxB+55ZDqsNLfHzV0PrqdDVDx40Pxa7zuvoENl905kRWWOLAq+XKqPStlqI6/o3I+mNeoAVoiz9JOY/6/Hyin85hEUdfbWo3ZQJdXC1BftmI0CDbnrthtcNC3sFvg07TODykl2NTSZTZ2quX6I7/jw0FIWmDZ7aSo+xhLyBwTy0E4ZNZmFGD1CMCW3ne5+FW/cKciKSI9VuniYKVbi7GMcd0kSFsxay4L56JKKA8SoB8JnnydJd5uvJlBh0+yYiXOqH1GTYd2B5hHkFDxQxwbpjoEFgggOb0KVimfEeHttO/e9IXxoSOpvVzug8ANf3DFGSNuyVQUqrF431SQo6Scg8lppTOh8gSeXntQjK2m+RO5FQl7GPA8ZpoKfV3ny0JsEkjniaiO8uiF4pRsYJPmqj1PYmplrjQrXRmkDcrJ6EMKEV3SrD7mCGlDPcs0RRUQo2WqLADylGOhnm6O/h70aHdIeATKw9O1IYm8GHI6pOLNbuiAceSQ==
Note that if you instantiate the three variables the computation is instantaneous also inside Coq. No need to extract to ocaml there.
(* Parameter atom : Type. *)
Definition atom := nat.
(* Parameter atomeq_dec : forall x y : atom, {x = y} + {x <> y}. *)
Definition atomeq_dec := Nat.eq_dec.
...
(* Parameter fresh : atoms -> atom. *)
Definition fresh (s:atoms): atom :=
set_fold_left (fun acc x => if le_gt_dec acc x then x else acc) s 0.
Le lun. 23 sept. 2019 à 19:47, William J. Bowman <wjb AT williamjbowman.com> a écrit :
Thanks all for the feedback!
This should give me plenty of places to continue debugging and some workarounds
if it's simply a limitation of the code generated by Program.
--
William J. Bowman
PS: Sorry for my mis-sent empty email.
On Mon, Sep 23, 2019 at 07:36:54PM +0200, Xavier Leroy wrote:
> On Mon, Sep 23, 2019 at 7:19 PM Jason -Zhong Sheng- Hu <
> fdhzs2010 AT hotmail.com> wrote:
>
> > have you tried to extract to ocaml or haskell to reduce noise from Prop?
> >
>
> "Program Fixpoint" produces terms that don't play well with extraction:
> https://github.com/coq/coq/issues/10757
>
> The problem could come from accessibility proofs that don't compute. The
> following trick can help:
> https://sympa.inria.fr/sympa/arc/coq-club/2013-09/msg00034.html
>
> - Xavier Leroy
>
>
> >
> > *Thanks,*
> > *Jason Hu*
> > *https://hustmphrrr.github.io/ <https://hustmphrrr.github.io/>*
> > ------------------------------
> > *From:* coq-club-request AT inria.fr <coq-club-request AT inria.fr> on behalf
> > of William J. Bowman <wilbowma AT ccs.neu.edu>
> > *Sent:* September 20, 2019 8:46 PM
> > *To:* coq-club AT inria.fr <coq-club AT inria.fr>
> > *Subject:* Re: [Coq-Club] Debugging an apparently diverging Coq program
> >
> > I don’t think that’s the problem. Another model does get stuck on that
> > equality and returns the if statement waiting for an interpretation of
> > “==“. I didn’t expect Program to be efficient, but I do expect it to
> > terminate quickly on this example, without using 20 GB of memory.
> >
> > I’ll see if I can reduce the other model to something as small.
> >
> > --
> > Sent from my phoneamajig
> >
> > On Sep 20, 2019, at 17:35, Abhishek Anand <abhishek.anand.iitg AT gmail.com>
> > wrote:
> >
> > Perhaps they forgot to instantiate the atom type? the computation would
> > get stuck on (x == x'). `Program` often produces humongous functions.
> >
> > -- Abhishek
> > http://www.cs.cornell.edu/~aa755/
> >
> >
> > On Fri, Sep 20, 2019 at 5:15 PM William J. Bowman <wjb AT williamjbowman.com>
> > wrote:
> >
> > All,
> >
> > At the following URL is a model of a language with capture-avoiding
> > substitution
> > that a student wrote:
> >
> > https://gist.github.com/wilbowma/acf125222c64ff715a33b26a0ce8b4ab
> >
> > The program looks (to me) like it ought to terminate quickly, and it's
> > proven
> > terminating using Program, yet when we run the substitution function on a
> > small
> > example... coqtop eats about 20 GB of memory and doesn't terminate within 5
> > minutes.
> > I'm using Coq 8.9.1 on MacOS 10.14.2; the same behavior is also observed on
> > Windows 10.
> >
> > I'd appreciate any help debugging this.
> >
> > --
> > William J. Bowman
> >
> >
- [Coq-Club] Debugging an apparently diverging Coq program, William J. Bowman, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Abhishek Anand, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Nathaniel Yazdani, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, William J. Bowman, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Jason -Zhong Sheng- Hu, 09/23/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Sylvain Boulmé, 09/23/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Sylvain Boulmé, 09/23/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Xavier Leroy, 09/23/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, William J. Bowman, 09/23/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Pierre Courtieu, 09/24/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, William J. Bowman, 09/23/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Sylvain Boulmé, 09/23/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Jason -Zhong Sheng- Hu, 09/23/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Jason -Zhong Sheng- Hu, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, William J. Bowman, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Xuanrui Qi, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Théo Winterhalter, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Gaëtan Gilbert, 09/21/2019
- Re: [Coq-Club] Debugging an apparently diverging Coq program, Abhishek Anand, 09/21/2019
Archive powered by MHonArc 2.6.18.