Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] run recursive programs in coq

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] run recursive programs in coq


Chronological Thread 
  • From: Bas Spitters <b.a.w.spitters AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] run recursive programs in coq
  • Date: Thu, 1 Nov 2018 17:21:23 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=b.a.w.spitters AT gmail.com; spf=Pass smtp.mailfrom=b.a.w.spitters AT gmail.com; spf=None smtp.helo=postmaster AT mail-yw1-f49.google.com
  • Ironport-phdr: 9a23:wo2BvhFEU+7C82pwnzJVO51GYnF86YWxBRYc798ds5kLTJ7zpc+wAkXT6L1XgUPTWs2DsrQY07WQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmDiwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VC+85Kl3VhDnlCYHNyY48G7JjMxwkLlbqw+lqxBm3oLYfJ2ZOP94c6jAf90VWHBBU95eWCxPAIyyb4UBAekcM+hGs4bwvEcOoQekCAWwGO/j1j1Fi3nr1qM6yeQhFgTG0RQ9Et0Uq3Tfscj7NL8TUeCp0KnH0y/Db+hL0jr684fEaAoureuCXL5qasrR0UgvFx/ZjlqOs4zlJCiY1usIs2eB7upgUfijhHIgqwF0uzWiwNonhIfOhoIQ0F/E9CN5zZ4vKt2iR097YMCkHIFXtyGAOIt6WswiQ2B0uCY6170JooS3czQNyJQiwRPUdv+Jc5CQ7x79SOqcJS10iXFldb6lmhq/8FWsxvfzW8Sw1ltBszBLncPWtn8X0hze8siHReV5/kemwTuP0hrc6uBAIUwtlavaJYMtzqc+lpcctUnPBCD2mELxjK+ZckUr5PKk5PjgYrXjvpOcNol0hR/iMqk2hMCzHeA1PhINUmWb4+iwybzu8VDjTLhFivA6iqzZv4rbJcQfqK65GQhV0oM75hmkFTupys4UnHcdIFJeYBKHjpTpO03QL/DiFveymFuskDJxyPDHOr3tGInCLn/GkLv5Z7Zy91ZcyBYvzdBY/59bFrYBIOvqVkDtsNzYEwQ2Phevw+fnDdV9zpkRVXiOAq+fKqPSsEWH6vghI+mWN8cpv2PWLOFtzPrzhzdtklgEOKKtwJE/aXaiH/0gLV/PMlT2hdJUO24R9jEmTfD2hUeZGWpZIX/0QOQn/jAnFI+8Fq/MQ4mshPqK2yLtTc4eXXxPFl3ZSSSgTI6DQfpZLXvKepYwwAxBbqCoTsoa7T/rsQb7z7R9Ke+No38XsJvi0J5+4OiBzEhupwwxNNyU1iS2d08xhnkBHmZk06V2oEg7wVCGg/Ah3q5oUOdL7vYMaT8UcJ7Ry+sgVoL3UwPFO8aWEROoHoTgDjY2QdY8hdQJZhQlFg==

We have a bit of discussion on avoiding evaluation of such
propositions in section 4.4. of our paper on real number computation
here.
A trick is to wrap it in a /-abstraction. We observe that this would
not be needed if Coq evaluated propositions lazily.

Type classes for efficient exact real arithmetic in Coq
Robbert Krebbers, Bas Spitters
https://arxiv.org/abs/1106.3448
On Thu, Nov 1, 2018 at 5:13 PM Peter E Schmidt-Nielsen
<snp AT mit.edu>
wrote:
>
> Using a fuel quantity seems like a reasonable solution whenever you can
> easily produce a default value when you run out of fuel. Here's an example
> of performing this transformation generically on a recursive function,
> using a nat to track the fuel:
>
> https://gist.github.com/petersn/361c40b3394a3ad9721b738ac61d48b1
>
> Of course, if we switched to using a binary number for the fuel then we
> could trivially just pass in 2^300 for the fuel and get a definition which
> won't run out of fuel before the heat death of the universe.
>
> However, some library theorems (N.lt_pred_l and N.lt_wf_0) are opaque,
> blocking the binary version in the above gist from computing. I'm
> wondering if anyone more experienced here knows if there're some
> transparent versions elsewhere I don't know about, or if I'm missing
> something silly?
>
> -snp
>
> On Thu, 1 Nov 2018, Klaus Ostermann wrote:
>
> > It's maybe not particularly elegant or sophisticated, but what about
> > just adding "fuel" as an additional argument
> > and initializing with a sufficient amout of fuel?
> >
> > Klaus
> >
> >
> > Am 01.11.18 um 12:21 schrieb Thorsten Altenkirch:
> >>
> >> Is there a way to run possibly non-terminating programs in the coq
> >> type checker. In Agda you can just switch off the termination checker.
> >>
> >>
> >>
> >> I think this is useful if you want to use something whose termination
> >> you haven't yet proven but want to exploit reduction.
> >>
> >>
> >>
> >> Hence it is not enough to add the assumption that it terminates as an
> >> axiom because this won't reduce.
> >>
> >> Thorsten
> >>
> >> This message and any attachment are intended solely for the addressee
> >> and may contain confidential information. If you have received this
> >> message in error, please contact the sender and delete the email and
> >> attachment.
> >>
> >> Any views or opinions expressed by the author of this email do not
> >> necessarily reflect the views of the University of Nottingham. Email
> >> communications with the University of Nottingham may be monitored
> >> where permitted by law.
> >>
> >>
> >>
> >
> >



Archive powered by MHonArc 2.6.18.

Top of Page