Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Understanding why Qed is slow

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Understanding why Qed is slow


Chronological Thread 
  • From: Jason -Zhong Sheng- Hu <fdhzs2010 AT hotmail.com>
  • To: Matthieu Sozeau <matthieu.sozeau AT inria.fr>, "coq-club AT inria.fr" <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Understanding why Qed is slow
  • Date: Tue, 12 Feb 2019 00:11:24 +0000
  • Accept-language: en-CA, en-US
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=fdhzs2010 AT hotmail.com; spf=Pass smtp.mailfrom=fdhzs2010 AT hotmail.com; spf=Pass smtp.helo=postmaster AT NAM01-BY2-obe.outbound.protection.outlook.com
  • Ironport-phdr: 9a23:ezNPYhyf1n5x4HXXCy+O+j09IxM/srCxBDY+r6Qd2uITIJqq85mqBkHD//Il1AaPAd2Lraocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze+/94HQbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RSqt4LtqSB/wiScIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyeKfhwcb7Hfd4CRWRPQNtfVzBPDI2/YYsADfYOMulDoobnu1cCsQGzCRWwCO7vzDJDm3/43bc90+QkCQzI2BYvH8kJsHTSsd75LaQdUeCyzKnOwjXIcu5Y2Tfj54jOfRAtuOyHU7BtccHMzkQvGR7KjlWRqIz+IT+ZyvkBv3SA4upgUuKvl2snpBtwojir3Msjlo7JhocMx13C6C53w541KMW3RUJne9KpFIVcuzuHO4dsX88uX3xktD40yrIYupO3YC0HxZE8yBHDd/OKcI2F7Qn/WOuQIzp1gXxod6mliBuy9EWgxOzxW8q23VtMsyFLiMPDtmoX2BzW8sWHSuVy/kOm2TuXzw7e9uZKLVwpmabCNpMuwKA8moMUsUvYACD6gkL2jLKKdko//eio9uLnbaj8qp+ELY90jR3+PboylcyjAOQ4NQ4OU3Kc+eShyL3j+Ur5QLJJjvEsjqbZt5XaKdwapq6/HQBVzp4u5hmjAzu81NkUg2MLIE9fdB6ak4TlJknCIPXiAve+h1Ssni1rx/fDPrD5DJXCM3jDkbb6fbpj90JQ1RY/wMtf55JTFrEBJej8Wk71tNDCEhA5NAm0z/79CNphzoMeRX6PAqiBPaPJtl+J5/wgLPORZIIOuTf9Kv0l6OX0jXAjg1MdfK+p3YEWaH+iBPhmLV+Za2L2gtgdCWcKohY+TOvyhVKeVj5Tfm++UL445jEmE42rFpzDR4CogLyZxii3BJxWZmZcClCNC3jkbYuEW+1fIB6Vd+pojiAEVLW8A7QmxxynqUeuzrN7MurV9zBerpXx2dFoz+zVjxA7szJuWYDVmWqKViR/mn4Cbz4wxqF250JngB/X2q9hxvdcCNZ75vVTUw58O4SKnMJgDNWneAvaedHBDWSmRdOpSQoxQ9Q+hpcufg4pFdminAuZh3PyK78Si7mCBZhy+aXZiSuib/1hwmrLgfFyx2ItRdFCYCj/3vYmplrjQrXRmkDcrJ6EMKEV3SrD7mCGlDHcvEZEVQdxVePOWnVNPxKK/+S83VvLSvqVMZpiKhFIkJXQKqxWb9ToiRNNQ/KxYI2DMVL0oH+5AFOz/p3JbIfufDlCjgP0LRBd1ioipzOBPwV4ATq9qWXDCjAoDUjof07n7eh5rjW8U1MwyAaJKUZm0ujs9w==

Hi Matthieu,

thx. indeed, proving inductive principle separately works much better and the inductive principle itself only takes 8 seconds to close. I guess in the original case, it indeed tries to unfold the definition of the proposition itself, which in turn could be very expensive while quite unnecessary.

Sincerely Yours,

Jason Hu

From: coq-club-request AT inria.fr <coq-club-request AT inria.fr> on behalf of Matthieu Sozeau <matthieu.sozeau AT inria.fr>
Sent: February 11, 2019 9:49 AM
To: Coq Club
Subject: Re: [Coq-Club] Understanding why Qed is slow
 


> Le 11 févr. 2019 à 15:26, Jason -Zhong Sheng- Hu <fdhzs2010 AT hotmail.com> a écrit :
>
> Hi,
>
> I was proving a quite intuitive lemma the termination of which is quite obvious to me on paper. However, it took Coq almost 4 hours to close Qed.
>
> <infomsg>Finished transaction in 13391.78 secs (13357.157u,6.398s) (successful)
> </infomsg>
>
> It's not a direct structural induction in the sense that the structure does not decrease layer by layer, but just sometimes it decreases by two layers. Hence I define the lemma directly using Fixpoint and rely on termination checking for correctness. I suppose that's why Qed took so long to come back. However, I don't understand exactly why because the termination is almost immediate to me (and I suppose Qed passed termination checking for the same reason). Is there any way for me to optimize the Qed time?

Hi Jason,

  It could be that the guard checker is looking for recursive calls to check in parts of the proof that are not
really using the recursive function but still depend on it, potentially doing costly unfoldings of definitions. One way to avoid that is to clear the assumption as soon as you do not need it anymore. Another way is to prove your elimination principle separately or to switch to well-founded induction, to avoid guard checking entirely in your lemma.

Best,
— Matthieu



Archive powered by MHonArc 2.6.18.

Top of Page