Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] A fast "eq" predicate for Gallina?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] A fast "eq" predicate for Gallina?


Chronological Thread 
  • From: Adam Chlipala <adamc AT csail.mit.edu>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] A fast "eq" predicate for Gallina?
  • Date: Wed, 20 Jan 2021 14:45:40 -0500
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=adamc AT csail.mit.edu; spf=Pass smtp.mailfrom=adamc AT csail.mit.edu; spf=None smtp.helo=postmaster AT outgoing-stata.csail.mit.edu
  • Ironport-phdr: 9a23:VAkC7BV/lq7UY5a/tddm3y8fSUbV8LGtZVwlr6E/grcLSJyIuqrYbBKEt8tkgFKBZ4jH8fUM07OQ7/mxHzVaqs/Y6ThCKMUKC0Zaz51O3kQJO42sMQXDNvnkbig3ToxpdWRO2DWFC3VTA9v0fFbIo3e/vnY4ExT7MhdpdKyuQtaBx8u42Pqv9JLNfg5GmCSyYa9oLBWxsA7dqtQajZFtJ6oszhbFuGZEd/pZyW91OF6fggv36sOs8JJ+6ShdtO8t+sxaXanmY6g0SKFTASg7PWwy+MDlrwTIQxGV5nsbXGUWkx5IDBbA4RrnQJr/sTb0u/Rk1iWCMsL4Ub47WTK576d2UxDokzsINyQ48G7MlMN9ir9QrQ+7qBx+x47UZ5yVNOZ7c6jAc94WWXZNU8BMXCFHH4iybZYAD/AZMOhFsYf9qVsAoxiwCwaiC+zgyCNHi2Ts0qEmyeksCx3K0QIiEt8IrX/arM/1NKAXUe2t0KTH0C/Mb/ZL0jrj6IjIdhEhoemWUrJ0a8Xa1E4iGBnYgVqKrIzqIyiY2fgWs2eB7upgUfiji2smqwFtuDSg2NojipTQi48T11vL+jl3zpwvKt2kVE50f8SkEJ1IuiyYNIZ7XN0uTn12tCg61rALuoC2cSkExpkl2RPSdvOJfYiK7x/sSeqcITh1inJqdb+7mhu+70mtx+/zWMS031tHqDdOnNrUtn0VyhDf9MuKRuFz80u9wzqDyRrf5v9ZLUwojabWKZAszqQumpYOtUnPBC77lUXsgKOLaEko5u6l4Pn9bLr8vJ+TLYp0hxn+Mqswnsy/Bvw1Mg8TX2iH9uS807zj/Uv2QLlTlf02jrPWsIzAKsgBuqG5GBVa0ocn6xqlCjem0cgYkWMZI11YZRKLl4npO1fQL/DkFfqznkqgnTRxy/3IIrHtGIvBImLdnLv8Ybpx80tcxxAyzdBb6ZJUELYBIPfrV0DrqdPXFBo5PBCvzun7E9VyzIIeWWaVDq+cMaPSrUWE6fwyLOmRfIMVoiryK+A55/7yin80gUMSfa6w3ZcOdH+4GulmLF6CbHr3gtYBFH8KsRAkQOzrjl2CSz9TaGyoU6Iy/DFoQL6hWIzEX8WmhKGL9Ca9BJxfIG5cWX6WFnK9XomNXr8naCaTOsZlm3RQXLSoToQJ3gqntQu8zrt7aOfY53tL5trYyNFp6riLxlkJ/jtuApHFijDffyRPhmoNAgQO8uV6qE15xE2E1PEl0fdDHN1XofZITkE3OYOOlrUmWeC3YRrIe5KycHjjWs+vWGxjRck4wttIZkdhXdiuk0Kbhnf4M/ouj7WOQacM3Ofc0nz2fJ4vzGva264giVZjWddGKWTgjbV29gyVAo/V1UiVivTyeA==

I've seen some recent work in Lean along these lines, I believe, but I, for one, am glad not to see that kind of feature complicating the trusted core of Coq!  To start with, taken literally, your proposal sounds logically inconsistent, since there could be two definitionally equal values that trigger different behavior for the "eq" operation.

Also, if you really want good performance, why not verify a program in some deeply embedded language?  I've found performance predictability to be quite treacherous within normalization of Gallina terms.  I'd much rather generate a C program with a proof that it computes the answer I want.  Many potential target languages allow your proposed optimization to be proved from first principles.

On 1/20/21 2:18 PM, jonikelee AT gmail.com wrote:
Is there any fast "eq" predicate in Gallina?

By fast, I mean that it tests references only - returning true iff the
two arguments refer to the same reference.  Hence it is analogous to
the Lisp "eq" predicate, whereas the standard equality in Gallina is
analogous to Lisp "equal".  

One would also need the associated lemmas, such as 
eq x y = true -> x = y.

Also, one would need to know about when two references might be eq.
For instance, it is possible to create a highly wasteful functional
language without any reference sharing (such that eq would be false in
all non-reflexive cases), but hopefully Gallina is not that, and that
the ways in which Gallina is not that can be described in a useful way.





Archive powered by MHonArc 2.6.19+.

Top of Page