An Assertional Proof of Red-Black Trees Using Dafny

被引:4
|
作者
Pena, Ricardo [1 ]
机构
[1] Univ Complutense Madrid, Comp Sci Sch, C Jose Garcia Santesmases 9, E-28040 Madrid, Spain
关键词
Data structures; Balanced trees; Verification platforms;
D O I
10.1007/s10817-019-09534-y
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Red-black trees are convenient data structures for inserting, searching, and deleting keys with logarithmic costs. However, keeping them balanced requires careful programming, and sometimes to deal with a high number of cases. In this paper, we present a functional version of a red-black tree variant called left-leaning, due to R. Sedgewick, which reduces the number of cases to be dealt with to a few ones. The code is rather concise, but reasoning about its correctness requires a rather large effort. We provide formal preconditions and postconditions for all the functions, prove their termination, and that the code satisfies its specifications. The proof is assertional, and consists of interspersing enough assertions among the code in order to help the verification tool to discharge the proof obligations. We have used the Dafny verification platform, which provides the programming language, the assertion language, and the verifier. To our knowledge, this is the first assertional proof of this data structure, and also one of the few ones including deletion.
引用
收藏
页码:767 / 791
页数:25
相关论文
共 50 条
  • [41] Improved adjoin-list for quality-guided phase unwrapping based on red-black trees
    Cruz-Santos, William
    Lopez-Garcia, Lourdes
    Rueda-Paz, Juvenal
    Redondo-Galvan, Arturo
    [J]. INTERFEROMETRY XVIII, 2016, 9960
  • [42] THE RED-BLACK EFFECT IN GA(AS1-XPX)
    HOLONYAK, N
    BEVACQUA, SF
    [J]. SOLID-STATE ELECTRONICS, 1964, 7 (06) : 488 - 488
  • [43] Red-Black Tree Based NeuroEvolution of Augmenting Topologies
    Arellano, William R.
    Silva, Paul A.
    Molina, Maria F.
    Ronquillo, Saulo
    Ortega-Zamorano, Francisco
    [J]. ADVANCES IN COMPUTATIONAL INTELLIGENCE, IWANN 2019, PT II, 2019, 11507 : 678 - 686
  • [44] Red-Black Heuristics for Planning Tasks with Conditional Effects
    Katz, Michael
    [J]. THIRTY-THIRD AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE / THIRTY-FIRST INNOVATIVE APPLICATIONS OF ARTIFICIAL INTELLIGENCE CONFERENCE / NINTH AAAI SYMPOSIUM ON EDUCATIONAL ADVANCES IN ARTIFICIAL INTELLIGENCE, 2019, : 7619 - 7626
  • [45] Red-Black Strategy for Mobile Robot Path Planning
    Saudi, Azali
    Sulaiman, Jumat
    [J]. INTERNATIONAL MULTICONFERENCE OF ENGINEERS AND COMPUTER SCIENTISTS (IMECS 2010), VOLS I-III, 2010, : 2215 - 2220
  • [46] Frequency restricted red-black wavelet transform for image restoration
    Xu, Ting-Fa
    Qi, Jin-Gang
    Zhou, Sheng-Bing
    Ni, Guo-Qiang
    Yao, Jian-Min
    [J]. Beijing Ligong Daxue Xuebao/Transaction of Beijing Institute of Technology, 2007, 27 (05): : 446 - 450
  • [47] Red-black response matrix acceleration by transformation of interface variables
    Lewis, EE
    Palmiotti, G
    [J]. NUCLEAR SCIENCE AND ENGINEERING, 1998, 130 (02) : 181 - 193
  • [48] A nearly optimal preconditioning based on recursive red-black orderings
    Notay, Y
    Amar, ZO
    [J]. NUMERICAL LINEAR ALGEBRA WITH APPLICATIONS, 1997, 4 (05) : 369 - 391
  • [49] Generic Red-Black Tree and its C# Implementation
    Wiener, Richard
    [J]. JOURNAL OF OBJECT TECHNOLOGY, 2005, 4 (02): : 59 - 80
  • [50] The Directional Adaptive Red-Black Wavelet Transform for Image Coding
    Zhao, Xiujuan
    Wang, Shengqian
    Zhang, Lin
    Deng, Chengzhi
    [J]. PROCEEDINGS OF THE FIRST INTERNATIONAL WORKSHOP ON EDUCATION TECHNOLOGY AND COMPUTER SCIENCE, VOL I, 2009, : 148 - +