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 条
  • [31] Verification of Scapegoat Trees Using Dafny
    Wang, Jiapeng
    Chen, Sini
    Zhu, Huibiao
    NASA FORMAL METHODS, NFM 2024, 2024, 14627 : 118 - 135
  • [32] Pan-Sharpening Using Weighted Red-Black Wavelet
    Liu, Qingjie
    Wang, Yunhong
    Zhang, Zhaoxiang
    Liu, Lining
    2012 21ST INTERNATIONAL CONFERENCE ON PATTERN RECOGNITION (ICPR 2012), 2012, : 1908 - 1911
  • [33] Deletion: The curse of the red-black tree
    Germane, Kimball
    Might, Matthew
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2014, 24 (04) : 423 - 433
  • [34] Fuzzy time series model based on red-black trees for stock index forecasting
    Tavares, Thiago Henrique Barbosa de Carvalho
    Ferreira, Bruno Perez
    Mendes, Eduardo Mazoni Andrade Marcal
    APPLIED SOFT COMPUTING, 2022, 127
  • [35] On red-black SOR smoothing in multigrid
    Yavneh, I
    SIAM JOURNAL ON SCIENTIFIC COMPUTING, 1996, 17 (01): : 180 - 192
  • [36] RBTAT: Red-Black Table Aggregate Tree
    Gorawski, Marcin
    Bankowski, Slawomir
    Gorawski, Michal
    MAN-MACHINE INTERACTIONS, 2009, 59 : 605 - 613
  • [37] AN INCOMPLETE-FACTORIZATION PRECONDITIONING USING REPEATED RED-BLACK ORDERING
    BRAND, CW
    NUMERISCHE MATHEMATIK, 1992, 61 (04) : 433 - 454
  • [38] Red-black contrasts in the public health policy
    Jegodzinski, S
    RADIOLOGE, 2006, 46 (01): : M4 - M7
  • [39] The performance of concurrent red-black tree algorithms
    Hanke, S
    ALGORITHM ENGINEERING, 1999, 1668 : 286 - 300
  • [40] Red-Black Coins: Dai Without Liquidations
    Salehi, Mehdi
    Clark, Jeremy
    Mannan, Mohammad
    FINANCIAL CRYPTOGRAPHY AND DATA SECURITY, FC 2021, 2021, 12676 : 136 - 145