coq-club AT inria.fr
Subject: The Coq mailing list
List archive
Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint)
Chronological Thread
- From: mukesh tiwari <mukeshtiwari.iiitm AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint)
- Date: Sat, 2 Sep 2023 18:49:19 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mukeshtiwari.iiitm AT gmail.com; spf=Pass smtp.mailfrom=mukeshtiwari.iiitm AT gmail.com; spf=None smtp.helo=postmaster AT mail-yw1-f182.google.com
- Ironport-data: A9a23:WEqpJqwCpc5IkafDeK16t+f4xyrEfRIJ4+MujC+fZmUNrF6WrkUEm zcWUWuFPvaINjCnLtt3bY+yoUwBvsLdyNM1TFZk+1hgHilAwSbnLYTAfx2oZ0t+DeWaERk5t 51GAjXkBJppJpMJjk71atANlVEliefSAOCU5NfsYkhZXRVjRDoqlSVtkus4hp8AqdWiCmthg /uryyHkEAHjg2Qc3l48sfrZ80s+5K6q4Vv0g3RnDRx1lA+G/5UqJMlHTU2BByOQapVZGOe8W 9HCwNmRlo8O10pF5nuNy94XQ2VSKlLgFVDmZkl+B8BOtiN/Shkaic7XAhazhXB/0F1ll/gpo DlEWAfZpQ0BZsUgk8xFO/VU/r0X0QSrN9YrLFDm2fF/wXEqfFPRnNM2EREmP7Eh3cgnXmF3r KE8Bm0kO0Xra+KemNpXS8Fpj8Unadj0ZcYR4yE6iz7eCvkiTNbIRKCiCd1whm9hwJATW6+EN 4xAOWAHgBfoO3WjPn8SFZEzh+e0h2b2aTweqVOUua8f7G3azQg327/oWDbQUoXQGZ0Oxh3G/ Aoq+UzmAh0rK9XH1QDc0X3xp/DhjDnkG747QejQGvlCxQf7KnYoIBYRTB6wpeSzolWvXspWb U0S4Csn66YonHFHVfH4Vhy85W+b51sSAooKVeI97w6Jx+zf5APx6nU4cwOtoecO7KceLQHGH HfT9z9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q+ZPKEbxZd9Nm5xGxh66Hc e+WnidwbzhChNsKwjfTxb4T0UR36WkmfiSxEbkGqS/GTb7B0q5RARkBbipvNcxOp6si1whJM MTfh5v7zLl9xvIyDl5EUxTmlKTLLYQSJHqhMVrcGEuRHLGPJDmO0t6uJK3lGecWg+JTuBm9/ z2cFg6rPziOkSXoSwH6MexIi3L+XlQWs4W8fxBxTGn7GYi+O1vrbZku121wmO1u1RaofSYGP DNxcl1AtOiV5CJc2LBkHnBZq2BiJq+CkjqY6O/RLtAXt+FqC2J6jbE/gjxyxr1L4SVDXPEwl jHVq4skpkyln/KP1jt4WQBP7DdKhZ6OlUpnMKTdsJJHXDyXmXBFpXXVEBkMq9Z/X5f3vLtMz 9HUiK/pADJL8taR7NRFQsaNeJjBP30mPh7kXjXTCUFWKFzjfXGajEtbnvaI83STpZVvsZngl q0FTbpDXUA0HPcXYqyENNkLIZMyTyx91LDC3JRO6n25ox3cAs5du8KfPhp9KfrqITedy7JDY klRqVsdBYsWP4z/nUdlbwsi9Lk=
- Ironport-sdr: 64f375b8_T0AZ149kRsOoyflf3ZOJr4QqDam+jn+OhFjrdDXi8X/ykL5 cd7HFEN+wjAd4XujVLgS52Hhawj1Gmu8VsjRnVA==
Btw, I am wondering if we could have two versions of the same proof, one closed by Qed and the other by Defined, in the Coq standard library, it would make life easier for many people. Depending on the need, they can pick the Qed or Defined. Are there any cons for this, other than duplicating a massive codebase?
Best,
Mukesh
On Sat, Sep 2, 2023 at 6:38 PM mukesh tiwari <mukeshtiwari.iiitm AT gmail.com> wrote:
Hi everyone,I spoke too early and my solution, turning every Qed into Defined, works. Here is the proof [1].Best,MukeshOn Sat, Sep 2, 2023 at 3:13 PM Dominique Larchey-Wendling <dominique.larchey-wendling AT loria.fr> wrote:Hi all,My 2 cents. Why not write all_parse_treesas a fully specified term, relating the outputto the input in a way that characterizes theoutput uniquely, ieall_parse_trees : forall (l : list A) (n : nat) (p : Regex * nat) -> { o : list parse_tree | all_parse_trees_spec l n p o }If all_parse_trees_spec mimics the computation of all_parse_trees at the level of Prop,this is usually an easy task to fullfil.Then prove properties of all_parse_trees from that spec. In general, this worksaround having to evaluate the proofs of the propositions that contribute to the proofof the Acc(essibility) argument.D.De: "mukesh tiwari" <mukeshtiwari.iiitm AT gmail.com>
À: "coq-club" <coq-club AT inria.fr>
Envoyé: Samedi 2 Septembre 2023 13:20:08
Objet: Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint)Hi everyone,I was under the impression that Agnishom's code is not simplifying because of the opaque proof terms but I was wrong because I have turned every Qed into Defined [1] involved in the proof of wellfounded [3] and it is still not simplifying [2]. Now, I am curious about how to prove this theorem [2].Best,MukeshOn Sat, Sep 2, 2023 at 9:53 AM Castéran Pierre <pierre.casteran AT gmail.com> wrote:A version using Equations is on https://gist.github.com/Casteran/cb26e7fa8b185aa7f99f8b8048c6658eThe remaining Admitted should be trivial (just converting the well-roundedness of your order into an instance).PierreLe 2 sept. 2023 à 03:26, Agnishom Chattopadhyay <agnishom AT cmi.ac.in> a écrit :Hi all;I have a function I am trying to define whose well-foundedness is not obvious. I am trying to do it in two different ways: (1) using Program Fixpoint and (2) using Function. In both cases, I am using the fixannot {wf ...}However,(1) When I try Program Fixpoint, the function can be defined. But it is opaque to `simpl`. How do I get around this? I need to be able to prove things about this function.(2) When I use Function, I am getting a strange error message. The error message is not helpful because it references some variable names which I have not used.Here is the Coq code: https://gist.github.com/Agnishom/1150d29732a6c727396fb6c118dbf375Any help with this would be appreciated. I originally posted this on StackExchange, but I am corssposting here because I think this would be better suited for a threaded discussion rather than a Q/A style one.Thanks!--Agnishom
- [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Agnishom Chattopadhyay, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Wendlasida Ouedraogo, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), mukesh tiwari, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Castéran Pierre, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), mukesh tiwari, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Dominique Larchey-Wendling, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), mukesh tiwari, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), mukesh tiwari, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Jim Fehrle, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Agnishom Chattopadhyay, 09/03/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Meven Lennon-Bertrand, 09/04/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Jim Fehrle, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), mukesh tiwari, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), mukesh tiwari, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), Dominique Larchey-Wendling, 09/02/2023
- Re: [Coq-Club] Non obvious recursion (Issue with Function + Can't unfold Program Fixpoint), mukesh tiwari, 09/02/2023
Archive powered by MHonArc 2.6.19+.