Affiliation:
1. ETH Zurich, Switzerland
2. University of British Columbia, Canada
Abstract
Closures are a language feature supported by many mainstream languages, combining the ability to package up references to code blocks with the possibility of capturing state from the environment of the closure's declaration. Closures are powerful, but complicate understanding and formal reasoning, especially when closure invocations may mutate objects reachable from the captured state or from closure arguments.
This paper presents a novel technique for the modular specification and verification of closure-manipulating code in Rust. Our technique combines Rust's type system guarantees and novel specification features to enable formal verification of rich functional properties. It encodes higher-order concerns into a first-order logic, which enables automation via SMT solvers. Our technique is implemented as an extension of the deductive verifier Prusti, with which we have successfully verified many common idioms of closure usage.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference42 articles.
1. How do programmers use unsafe rust?
2. Leveraging rust types for modular specification and verification
3. Boogie: A Modular Reusable Verifier for Object-Oriented Programs
4. Functional translation of a calculus of capabilities
5. Ernie Cohen Mark A. Hillebrand Stephan Tobies Michał Moskal and Wolfram Schulte. 2015. Verifying C Programs: A VCC Tutorial. https://bit.ly/32BkCWN Working draft version 0.2. Ernie Cohen Mark A. Hillebrand Stephan Tobies Michał Moskal and Wolfram Schulte. 2015. Verifying C Programs: A VCC Tutorial. https://bit.ly/32BkCWN Working draft version 0.2.
Cited by
14 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Staged Specification Logic for Verifying Higher-Order Imperative Programs;Lecture Notes in Computer Science;2024-09-11
2. RefinedRust: A Type System for High-Assurance Verification of Rust Programs;Proceedings of the ACM on Programming Languages;2024-06-20
3. Is unsafe an Achilles' Heel? A Comprehensive Study of Safety Requirements in Unsafe Rust Programming;Proceedings of the IEEE/ACM 46th International Conference on Software Engineering;2024-04-12
4. A Context-Sensitive Pointer Analysis Framework for Rust and Its Application to Call Graph Construction;Proceedings of the 33rd ACM SIGPLAN International Conference on Compiler Construction;2024-02-17
5. PropProof: Free Model-Checking Harnesses from PBT;Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering;2023-11-30