Skip to main content
Erschienen in: Journal of Automated Reasoning 1/2023

01.03.2023

Efficient Extensional Binary Tries

verfasst von: Andrew W. Appel, Xavier Leroy

Erschienen in: Journal of Automated Reasoning | Ausgabe 1/2023

Einloggen

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Lookup tables (finite maps) are a ubiquitous data structure. In pure functional languages they are best represented using trees instead of hash tables. In pure functional languages within constructive logic, without a primitive integer type, they are well represented using binary tries instead of search trees. In this work, we introduce canonical binary tries, an improved binary-trie data structure that enjoys a natural extensionality property, quite useful in proofs, and supports sparseness more efficiently. We provide full proofs of correctness in Coq. We provide microbenchmark measurements of canonical binary tries versus several other data structures for finite maps, in a variety of application contexts; as well as measurement of canonical versus original tries in two big, real systems. The application context of data structures contained in theorem statements imposes unusual requirements for which canonical tries are particularly well suited.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Fußnoten
1
All proofs mentioned in this paper are machine-checked unless explicitly noted otherwise.
 
2
Persistent arrays give a functional semantics layered on an imperative (destructive-update) implementation, but these are not suitable because they would require extending the logic’s kernel of axioms.
 
3
In fact, no programming language has a primitive integer type with constant-time comparisons; they typically have a range-limited integer type \(-2^k\le i < 2^k\) or a modular integer type \((i \bmod 2^k)\). Most versions of Coq 2005-present have not had a built-in integer type with fast comparisons; and relying on them would increase the size of the trusted base, that is, Coq kernel code, Coq axioms, Coq extraction to OCaml, and OCaml operations upon which we rely.
 
4
In OCaml, an arity-k constructor applied to arguments takes \(k+1\) words, including one for the constructor-tag. In Coq, an arity-k constructor is represented as one arity-2 OCaml construction plus one length-k array, which take (respectively) 3 words and \(k+1\) words as represented in OCaml within the Coq kernel. The arity-2 OCaml construction also points to a description of the constructor, but that description is shared among all its uses so we don’t count it.
 
5
Andreas Abel, personal communications, Aug-Sept 2022. Examples of problematic unifications can be found at https://​github.​com/​agda/​agda/​issues/​483.
 
6
In table 1, performance of PTrees in VST could be predicted in row “Coq execution, vm_compute, Sparse test,” column Sigma versus columns Original and Canonical; whereas PTree performance in CompCert could be predicted in row “Extraction to OCaml, Sparse test”, same columns.
 
8
https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figjs_HTML.gif , https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figjt_HTML.gif , https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figju_HTML.gif , https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figjv_HTML.gif , https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figjw_HTML.gif , https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figjx_HTML.gif , https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figjy_HTML.gif
 
9
Measurements were performed on a Lenovo t440p laptop with Intel Core i7-4810MQ @ 2.8GHz with 32GB memory, using Coq 8.14/8.15.1 in 32-bit mode with virtual-memory limit of 1GB. The Clight abstract-syntax-tree files were produced by https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figjz_HTML.gif in its default https://static-content.springer.com/image/art%3A10.1007%2Fs10817-022-09655-x/MediaObjects/10817_2022_9655_Figka_HTML.gif mode.
 
Literatur
4.
Zurück zum Zitat Appel, A.W., Dockins, R., Hobor, A., Beringer, L., Dodds, J., Stewart, G., Blazy, S., Leroy, X.: Program logics for certified compilers. Cambridge University Press, Cambridge (2014)CrossRefMATH Appel, A.W., Dockins, R., Hobor, A., Beringer, L., Dodds, J., Stewart, G., Blazy, S., Leroy, X.: Program logics for certified compilers. Cambridge University Press, Cambridge (2014)CrossRefMATH
10.
Zurück zum Zitat Gordon, M.J., Milner, R., Wadsworth, C.P.: Edinburgh LCF: A Mechanised Logic of Computation. Lecture Notes in Computer Science, vol. 78. Springer, New York (1979) Gordon, M.J., Milner, R., Wadsworth, C.P.: Edinburgh LCF: A Mechanised Logic of Computation. Lecture Notes in Computer Science, vol. 78. Springer, New York (1979)
Metadaten
Titel
Efficient Extensional Binary Tries
verfasst von
Andrew W. Appel
Xavier Leroy
Publikationsdatum
01.03.2023
Verlag
Springer Netherlands
Erschienen in
Journal of Automated Reasoning / Ausgabe 1/2023
Print ISSN: 0168-7433
Elektronische ISSN: 1573-0670
DOI
https://doi.org/10.1007/s10817-022-09655-x

Weitere Artikel der Ausgabe 1/2023

Journal of Automated Reasoning 1/2023 Zur Ausgabe