Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] (Computationally) Efficient Finite Maps

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] (Computationally) Efficient Finite Maps


Chronological Thread 
  • From: Gregory Malecha <gmalecha AT gmail.com>
  • To: Coq Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] (Computationally) Efficient Finite Maps
  • Date: Thu, 14 May 2020 13:41:33 -0400
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gmalecha AT gmail.com; spf=Pass smtp.mailfrom=gmalecha AT gmail.com; spf=None smtp.helo=postmaster AT mail-wr1-f43.google.com
  • Ironport-phdr: 9a23:b5cLmRMG3w9qjbXEGgMl6mtUPXoX/o7sNwtQ0KIMzox0I/3yrarrMEGX3/hxlliBBdydt6sZzbuI+Pm4BiQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagYb5+NhG7oATeusULnYdvKLs6xwfUrHdPZ+lY335jK0iJnxb76Mew/Zpj/DpVtvk86cNOUrj0crohQ7BAAzsoL2465MvwtRneVgSP/WcTUn8XkhVTHQfI6gzxU4rrvSv7sup93zSaPdHzQLspVzmu87tnRRn1gyocKTU37H/YhdBxjKJDoRKuuRp/w5LPYIqIMPZyZ77Rcc8GSWZEWMteUDFPAp6nb4sXEeUOIfpYoYf6p1sLtxS+BA+sD/7rxjJHgnL62Ks32PkjHw7bxgwtB90BsHrWo9v1OqkcUv27wrfUwjjYdfxaxS3w5ZLUfhw9o/yBW697f8rLyUkoEgPIllSeqZb7MDOa0eQNqWia5PdnW+21j24otR1+oji1ycwxjYTJiYcVxUrA9Spn3Ik1Jce3RVV0Yd6hCpRQtiWaO5FqTcMlRmFloSA3waAJtpCnZiYF0ognxwLBZPyddYiF+g7vWuaNLTl4i39oZb2xihiz/EWg1OHyWcu53UpUoidBltTAqn4D2RLS58SaRfVw+kas1DST2w3S7uxJL085mK7dJpU8zLAwkZ8Tvl7CHi/wgEj2g66Wdlkk+ui18OvreLTmppiaOoRpiQ/+KrwjltKjDek8KAQDXGiW9f6i2LH94EH1WrpHg/Mwn6LEqp7VP94bqbS8AwJN0oYs9RK/DzC+3dQdh3YHLVZFdAuJjojzJl3COf74APixjli2nzdrwPfGPrLlAprTNHTMjLDhfbNl505dzgo808xf6opKBr0dJP//QEz8udzCAhMnLQC43vzrBdpz248GXGKAGK6ZMKfcsV+S4eIvJvGBZIAQuDnnL/gq+eLhjX8jllIGcqmp2IEYaHG8Hvh8P0qZZn/sjs8bEWgWpgo+UPDqiFqaXDFPYHayRrsw6S0/CIK7FojOXZutgbyE3CejBJJafGFGClaWEXfpbYqIQfkMaDjBavNmxxcDTPCKT5IrnUWlsxa/wL56JMLV/DcZvNTtzo4myffUkEQd7zF7CN6Mm0SES2x/nmpAEzAz1aRyqkx04liG2Kl8xfdfEIoAtLtyTg4mOMuEnKRBANfoV1eEI47QGQSWB+6+CDR0deofhtoHYkJzAdKn10mR0C+jArtTnLuOVsVtrvDsmkPpLsM48E7okbE7hgB/EMRKPGyiwKV48lqLXtObowCij6+vMJ8k8mvN+WOElzfcuUhZVEtvS/yAUyxEIETRqtv96wXJSLr8Ubk=

Thanks for all the responses!

I  found that AVL trees in the standard library are pretty good, but I need to compress the proof term. Since the property is decidable it isn't too difficult to replace it with something like `Is_true (check_property ..)`.This means that you you re-check the property every time you do a computation. I'm interested in what impact it would have if proofs were fully transparent, but transitively making all definitions transparent seems like quite a task.

An alternative (which is what I'm doing now) is to provide a "canon : t -> t" function that essentially throws away the current proof term and replaces it with a smaller proof term that is not based on history. For example, I have a proof, `build_ok : Is_true (check k) -> is_bst k` and canon basically converts b into : {| this := b.(this) ; is_bst := build_ok ... |}. In practice this means that the data representation contains the tree twice (maybe hashcons'd?) and checks the property once.

On Thu, May 14, 2020 at 12:46 PM Andrew Appel <appel AT princeton.edu> wrote:
The MSets interface of the Coq standard library factors the program from the proof, and may solve the problem that's being discussed here.
It was intended as a replacement for FSets and FMaps.
There had been a plan to make MMaps also (finite maps instead of sets), but unfortunately I don't think that was ever done.

There are efficient implementations of MSets for AVL trees and Red-Black trees in the standard library.



--
gregory malecha



Archive powered by MHonArc 2.6.18.

Top of Page