Automated Verification of Monotonic Data Structure Traversals in C
Matthew Sotoudeh
Abstract
Bespoke data structure operations are common in real-world C code. We identify one common subclass, monotonic data structure traversals (MDSTs), that iterate monotonically through the structure. For example, strlen iterates from start to end of a character array until a null byte is found, and a binary search tree insert iterates from the tree root towards a leaf. We describe a new automated verification tool, Shrinker, to verify MDSTs written in C. Shrinker uses a new program analysis strategy called scapegoating size descent, which is designed to take advantage of the fact that many MDSTs produce very similar traces when executed on an input (e.g., some large list) as when executed on a 'shrunk' version of the input (e.g., the same list but with its first element deleted). We introduce a new benchmark set containing over one hundred instances proving correctness, equivalence, and memory safety properties of dozens of MDSTs found in major C codebases including Linux, NetBSD, OpenBSD, QEMU, Git, and Musl. Shrinker significantly increases the number of monotonic string and list traversals that can be verified vs. a portfolio of state-of-the-art tools.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext b14fdefd-5f55-4acf-a52e-16907645aa1cCited by top-tier papers1
Ask how each one uses itBuilds on4
- Diffy: Inductive Reasoning of Array Programs Using Difference InvariantsSupratik Chakraborty, Ashutosh Gupta, Divyesh UnadkatCAV 2021 · 19 citations
- Deciding memory safety for single-pass heap-manipulating programsUmang Mathur, Adithya Murali, Paul Krogmeier, P. Madhusudan et al.POPL 2020 · 11 citations
- Logarithm and program testingKuen-Bang Hou (Favonia), Zhuyang WangPOPL 2022 · 6 citations
- Checking equivalence in a non-strict languageJohn C. Kolesar, Ruzica Piskac, William T. HallahanOOPSLA 2022 · 3 citations
Related papers
- Arithmetizing Shape AnalysisSebastian Wolff, Ekanshdeep Gupta, Zafer Esen, Hossein Hojjat et al.CAV 2025
- VST-A: A Foundationally Sound Annotation VerifierLitao Zhou, Jianxing Qin, Qinshi Wang, Andrew W. Appel et al.POPL 2024 · 12 citations
- Monotone Procedure Summarization via Vector Addition Systems and Inductive PotentialsNikhil Pimpalkhare, Zachary KincaidOOPSLA 2024 · 4 citations
- Reasoning about recursive tree traversalsYanjun Wang, Jinwei Liu, Dalin Zhang, Xiaokang QiuPPoPP 2021 · 4 citations
- Monotonicity and the Precision of Program AnalysisMarco Campion, Mila Dalla Preda, Roberto Giacobazzi, Caterina UrbanPOPL 2024 · 1 citation
