coq-club AT inria.fr
Subject: The Coq mailing list
List archive
Re: [Coq-Club] A formalization in Coq of puzzles involving scales and fake coins.
Chronological Thread
- From: Gabriel Scherer <gabriel.scherer AT gmail.com>
- To: Coq Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] A formalization in Coq of puzzles involving scales and fake coins.
- Date: Sat, 14 Nov 2015 23:46:30 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer AT gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer AT gmail.com; spf=None smtp.helo=postmaster AT mail-io0-f169.google.com
- Ironport-phdr: 9a23:gSfjrBbY1RjDJTvDWCMY8D//LSx+4OfEezUN459isYplN5qZpcuzbnLW6fgltlLVR4KTs6sC0LqL9f28EjVbsd6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDvvcCPKFwT1HKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGY2zRakzTKRZATI6KCh1oZSz7ViQBTeIs1AbSy09lgdCS1zO6wi/VZPsuAP7sPB80W+UJ5ulY6ozXGGN5q1xSRLswBwMNzMj/Xuf3sN5hrharRbnvBd/zpTZeqmaMfN/euXWetZMFjkJZdpYSyEUWtD0VIAIFedUeL8A94Q=
Congratulations!
I see that your proof script do not use billets (- + * { }).Use bullets!
Bullets are the one most important change of Coq 8.4 in terms of readability and maintenability of proof scripts. Bullets make the structure of your scripts more readable, but, even more importantly, they make it significantly easier to figure where you are when a proof breaks because you changed a definition or tactic it uses.
http://poleiro.info/posts/2013-06-27-structuring-proofs-with-bullets.html
Bullets are to be used whenever a tactic creates several subgoals that are on equal footing. For tactics that have one or several "side-proofs" and one "main continuation of the argument", use braces around the side-proofs and continue the argument at the same indentation level.
Use bullets!
On Sat, Nov 14, 2015 at 11:36 PM, Fred Smith <fsmith1024 AT gmail.com> wrote:
Hi,I jus completed my first unguided formalization in Coq. That is, I formalized a result that I was initially not sure was true, and whose proof was not known to me in advance.The result concerns a familiar type of puzzle involving scales. In these puzzles, one is tasked with finding a fake coin amongst a collection of real coins using only a balance scale. The goal is to use the balance scale as few times as possible.The just-completed proof shows that the given algorithm is optimal for any number of coins where there is exactly one fake. The source code and details are here:Although the proof only involves elementary facts, this proof was very challenging for me. It ends up clocking in at 5000 lines of proof code; far beyond what I expected this exercise to require.Having no prior exposure to Coq and pursuing this activity in spurts in off hours, most of the proofs are done in SWAT team style -- what do I need to establish, kick down the door, and flail around hoping that once the dust clears no hypotheses remain.Having powered my way through brute force to the finish line, I am now not quite sure what to do with it. So if you find it amusing, enjoy.If you have suggestions for improvement I would welcome those.Best,Fred Smith
- [Coq-Club] A formalization in Coq of puzzles involving scales and fake coins., Fred Smith, 11/14/2015
- Re: [Coq-Club] A formalization in Coq of puzzles involving scales and fake coins., Gabriel Scherer, 11/14/2015
- Re: [Coq-Club] A formalization in Coq of puzzles involving scales and fake coins., Fred Smith, 11/14/2015
- [Coq-Club] proof prettifier (was Re: A formalization in Coq of puzzles involving scales and fake coins.), Jonathan Leivent, 11/15/2015
- Re: [Coq-Club] A formalization in Coq of puzzles involving scales and fake coins., Gabriel Scherer, 11/14/2015
Archive powered by MHonArc 2.6.18.