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 条
  • [21] Training linear ranking SVMs in linearithmic time using red-black trees
    Airola, Antti
    Pahikkala, Tapio
    Salakoski, Tapio
    PATTERN RECOGNITION LETTERS, 2011, 32 (09) : 1328 - 1336
  • [22] Massively Concurrent Red-Black Trees with Hardware Transactional Memory
    Siakavaras, Dimitrios
    Nikas, Konstantinos
    Goumas, Georgios
    Koziris, Nectarios
    2016 24TH EUROMICRO INTERNATIONAL CONFERENCE ON PARALLEL, DISTRIBUTED, AND NETWORK-BASED PROCESSING (PDP), 2016, : 127 - 134
  • [23] Permission-Based Verification of Red-Black Trees and Their Merging
    Armborst, Lukas
    Huisman, Marieke
    2021 IEEE/ACM 9TH INTERNATIONAL CONFERENCE ON FORMAL METHODS IN SOFTWARE ENGINEERING (FORMALISE 2021), 2021, : 111 - 123
  • [24] Separating Separation Logic - Modular Verification of Red-Black Trees
    Schellhorn, Gerhard
    Bodenmueller, Stefan
    Bitterlich, Martin
    Reif, Wolfgang
    VERIFIED SOFTWARE. THEORIES, TOOLS AND EXPERIMENTS, VSTTE 2022, 2023, 13800 : 129 - 147
  • [25] Red-black interval trees in device-level analog placement
    Maruvada, SC
    Krishnamoorthy, K
    Balasa, F
    Ionescu, LM
    IEICE TRANSACTIONS ON FUNDAMENTALS OF ELECTRONICS COMMUNICATIONS AND COMPUTER SCIENCES, 2003, E86A (12) : 3127 - 3135
  • [26] Research on the red-black trees based on the large-scale algorithms
    Shuang, Wang
    Advances in Information Sciences and Service Sciences, 2012, 4 (02): : 175 - 181
  • [27] Using red-black interval trees in device-level analog placement with symmetry constraints
    Balasa, F
    Maruvada, SC
    Krishnamoorthy, K
    ASP-DAC 2003: PROCEEDINGS OF THE ASIA AND SOUTH PACIFIC DESIGN AUTOMATION CONFERENCE, 2003, : 777 - 782
  • [28] Brief Announcement: Concurrent Wait-Free Red-Black Trees
    Natarajan, Aravind
    Savoie, Lee
    Mittal, Neeraj
    DISTRIBUTED COMPUTING, DISC 2012, 2012, 7611 : 421 - 422
  • [29] A concurrent red-black tree
    Besa, Juan
    Eterovic, Yadran
    JOURNAL OF PARALLEL AND DISTRIBUTED COMPUTING, 2013, 73 (04) : 434 - 449
  • [30] Image saliency detection using red-black wavelet
    Zhao, Sanyuan, 1789, Institute of Computing Technology (26):