A Complete, Formal Semantics for Rust Source Code
Daniel Drodt
Abstract
Formally reasoning about Rust programs requires a rigorous formal semantics, especially in the context of deductive verification and concurrent programming. We present a modular, flexible semantics for a significant subset of (close to) source code level Rust, based on the recent locally abstract, globally concrete semantics framework, separating local evaluation of expressions from their composition into concrete traces. The semantics is extended to model Rust's asynchronous programming features and Rust's most popular async runtime, Tokio. Based on our more abstract formalization, we establish the fairness of Tokio's scheduler. Further, we show the applicability of our semantics to deductive verification of Rust by providing soundness proofs for a Rust program logic.
Create a lesson
Related papers
Predicting Program Exit Code with LLMs and Programming Language Semantics
Shared title terminology · Lara Marinov, Aditya Thimmaiah, Jayanth Srinivasa et al.
Python Code Generation for Isabelle/HOL
Shared title terminology · Nikolaus Huber, Roly Perera, Dominic Orchard
SAFE: Formal Specification and Implementation of a Scalable Analysis Framework for ECMAScript
Shared title terminology · Hongki Lee, Sooncheol Won, Joonho Jin et al.
CompCert4Lean: Porting a Verified C Compiler to Lean in Six Weeks with Parallel Coding Agents
Shared title terminology · Cong Wang, Zhiyang Chen, Fan Long et al.
Partial Borrows in Rust
Shared title terminology · Sasha Pak, Richard Willie, Umang Mathur et al.
Formalizing einsum with Named Tensor Notation
Shared title terminology · Yafei Yang, Chung-chieh Shan