Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] performance question: replace autorewrite by reflection?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] performance question: replace autorewrite by reflection?


Chronological Thread 
  • From: Bas Spitters <b.a.w.spitters AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] performance question: replace autorewrite by reflection?
  • Date: Fri, 31 Jul 2020 19:51:22 +0200
  • 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-yb1-f171.google.com
  • Ironport-phdr: 9a23:23/nZB3whL8pkvmWsmDT+DRfVm0co7zxezQtwd8ZseIRKfad9pjvdHbS+e9qxAeQG9mCtbQa26GP6viocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmTuwbalzIRi1ogndq9QajZd/Iast1xXFpWdFdf5Lzm1yP1KTmBj85sa0/JF99ilbpuws+c1dX6jkZqo0VbNXAigoPGAz/83rqALMTRCT6XsGU2UZiQRHDg7Y5xznRJjxsy/6tu1g2CmGOMD9UL45VSi+46ptVRTlkzkMOSIn/27Li8xwlKNbrwynpxxj2I7ffYWZOONjcq/BYd8WQGxMVdtTWSNcGIOxd4QAD+QDMuhYoYfzpEYAowWiCgejH+7v1iZIi2Xq0aEmz+gsEwfL1xEgEdIUt3TUqc34OboIXuCu0aLG0C3Db/JK2Tfh9ofIaAshquyLUL1ra8be01MjFg3fglWLsYzlPi+V1vgTvGiB9OptTu2vi2s9pAFwpjij3Nsjio7Mho8MzF3P6Cp2zpovK9KiVE57fcCrEIFWtyyCNIZ4Qt4vT39rtSomxbMItpG1cSoXxZg7yRDRa/OKfomL7x7/W+udPTh1iX1rdb+7iBu8/lWtx+LhWsSpzVpHqixImcTPuHAVzxHf9NSLR/9n8kqi2TuDzR7f5vxALEwuiKbWKYMtz7gtnZQJq0vDBDX5mEDuga+WaEok/u+o5vziYrr8p5+cM5Z4iwHlPagzg8C/D/k0PwoTU2SB9uS807rj/UL9QLpUlPE5jq7ZsJXCKcQaoK62HRNV35495xqjCzqqytcVkHkdIF5bZR6Ki5LlN0zMLfzlFfu/hk6jkDZvx/DIJL3hBZDNI2DYn7v7Z7lx8UBdxBAozdBH5pJUFq0BL+zpWk/qr9HYARo5PBa1w+bjEtlyyoQeWWeXDq+DLKzSqUOI5v4oI+SUeIAVvy/9J+E56P7qkH82gkQQfbKp3JsScHC3BO5qI0SfYXr2g9cOC30GvgQkTL+itFrXejlKL122Qqh0sjo8EcetCZrJboGrmr2ImimhSM54fGdDX3qFCj/Tb4SYR/oWc2rGKIlo1CNCTqCgV5MszwqGuwrzyr4hJe3RrH5L/an/3cR4srWA3So58iZ5WoHEiznUEjNE21gQTjpz55hR5ExwzlDZj/p9iv1cUM1ZvrZHC1hjc5HbyON+Bpb5XQeTJo7VGmbjec2vBHQKdvx028UHOh8vFNCrjxSF1C2vUedMxu67Qacs+6eZ5EDfYsN0ynLIzq4k1gB0Tc5GNGngjal6pVHe

Is this paper about the current implementation of fiat-crypto?

Would there be any benefits from combining it when certicoq?

On Thu, Jul 30, 2020 at 4:52 AM Jason Gross <jasongross9 AT gmail.com> wrote:
>
> This is actually the topic of a recent draft of mine, recently
> (re)submitted to POPL 2021.
>
> Some background: One of the biggest bottlenecks in the rewrite tactics is
> the allocation of evars (in particular, the allocation of evar contexts)
> when instantiating lemmas. This shows up mostly when you have a large
> context or many binders in the goal, and issues such as #12524
> (setoid_rewrite and rewrite_strat are cubic in the number of binders even
> when there are no matches) and #12510 are about this. Separately, even
> when there are no matches and no binders, autorewrite, rewrite, rewrite!,
> and rewrite? are all quadratic in the size of the goal (#12600). So I
> would not say that autorewrite is already optimized, and I believe there
> are a number of relatively low-hanging fruit.
>
> Second: Getting a proof term that does not incur overhead which is
> quadratic (or worse) in the number of rewrites is highly non-trivial; you
> may find the "Performance Bottlenecks of Proof-Producing Rewriting" section
> (Appendix A) of the aforementioned paper enlightening.
>
> Given this, there is reason (and evidence) to expect that using a
> reflective procedure will speed things up for you. I believe Rtac (see,
> e.g., Gregory Malecha's thesis) has a general reflective rewriter (though I
> was not able to make it work in recent versions of Coq, and development
> seems to be abandoned), and the rewriting engine that I created for
> fiat-crypto, which is the subject of the aforementioned POPL submission, is
> another example of such a general engine. Unfortunately, I cannot in good
> conscience suggest that you use the framework that I built as anything
> other than an example; it suffers from a number of restrictions that could
> be lifted with engineering work (such as the fact that while any type
> without arguments is supported, the only type families supported are option
> and prod), and, more importantly, it's unmaintainable in its current form
> and should be rewritten from scratch.
>
> Hope this helps,
> Jason
>
>
> On Wed, Jul 29, 2020 at 7:14 PM jonikelee AT gmail.com <jonikelee AT gmail.com>
> wrote:
>>
>> Using Ltac profiling, it looks like about 40% of time spent in one
>> project I have is within autorewrite, the remainder primarily doing
>> proof search. The particular autorewrite hint dbs are not large (10 or
>> so rules each, one has only 3 rules) and the addition of rules ends
>> before the hint dbs are used. In such cases, would it be advantageous to
>> create a reflective procedure to replace use of autorewrite by a
>> particular hint db? Or is this unlikely to improve performance,
>> considering that autorewrite is already optimized (presumably)? I do
>> not beleive that Qeds are significantly time consuming in this project,
>> so I don't think shrinking the proof terms will have much benefit.
>>



Archive powered by MHonArc 2.6.19+.

Top of Page