Author:
Mohan Anshuman,Leow Wei Xiang,Hobor Aquinas
Abstract
AbstractWe develop machine-checked verifications of the full functional correctness of C implementations of the eponymous graph algorithms of Dijkstra, Kruskal, and Prim. We extend Wang et al.’s CertiGraph platform to reason about labels on edges, undirected graphs, and common spatial representations of edge-labeled graphs such as adjacency matrices and edge lists. We certify binary heaps, including Floyd’s bottom-up heap construction, heapsort, and increase/decrease priority.Our verifications uncover subtle overflows implicit in standard textbook code, including a nontrivial bound on edge weights necessary to execute Dijkstra’s algorithm; we show that the intuitive guess fails and provide a workable refinement. We observe that the common notion that Prim’s algorithm requires a connected graph is wrong: we verify that a standard textbook implementation of Prim’s algorithm can compute minimum spanning forests without finding components first. Our verification of Kruskal’s algorithm reasons about two graphs simultaneously: the undirected graph undergoing MSF construction, and the directed graph representing the forest inside union-find. Our binary heap verification exposes precise bounds for the heap to operate correctly, avoids a subtle overflow error, and shows how to recycle keys to avoid overflow.
Publisher
Springer International Publishing
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Formalização e Verificação em Coq do Algoritmo de Dijkstra;Anais do IX Encontro de Teoria da Computação (ETC 2024);2024-07-21
2. Rooting for Efficiency: Mechanised Reasoning about Array-Based Trees in Separation Logic;Proceedings of the 13th ACM SIGPLAN International Conference on Certified Programs and Proofs;2024-01-09
3. Formally Verifying an Efficient Sorter;Lecture Notes in Computer Science;2024
4. A Relational Program Logic with Data Abstraction and Dynamic Framing;ACM Transactions on Programming Languages and Systems;2022-12-31
5. Specification and verification of a transient stack;Proceedings of the 11th ACM SIGPLAN International Conference on Certified Programs and Proofs;2022-01-11