K-Rust: An Executable Formal Semantics for Rust

04/17/2018
by   Shuanglong Kan, et al.
0

Rust is a system programming language designed for providing better memory safety whilst maintaining performance. Formalizing Rust is a necessary way to prove its memory safety and construct formal analysis tools for Rust. In this paper, we introduce an executable formal semantics of Rust using K-Framework (K), called K-Rust. K-Rust includes two parts: (1) the formal model of the ownership system, which is one of Rust's most compelling features for realizing its memory safety and zero-coast abstraction; (2) the formal operational semantics of Rust based on a core-language. The formal models are tested against various programs and compared with Rust's compiler to ensure the semantics consistency between K-Rust and the compiler. Through the construction of K-Rust we detected inconsistencies of the ownership mechanism between the Rust compiler and the specification in The Rust Programming Language.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/28/2018

KRust: A Formal Executable Semantics of Rust

Rust is a new and promising high-level system programming language. It p...
research
04/04/2018

P4K: A Formal Semantics of P4 and Applications

Programmable packet processors and P4 as a programming language for such...
research
08/29/2022

MSWasm: Soundly Enforcing Memory-Safe Execution of Unsafe Code

Most programs compiled to WebAssembly (Wasm) today are written in unsafe...
research
01/31/2022

A Formal Model of Checked C

We present a formal model of Checked C, a dialect of C that aims to enfo...
research
02/08/2022

K-ST: A Formal Executable Semantics of PLC Structured Text Language

Programmable Logic Controllers (PLCs) are responsible for automating pro...
research
07/17/2017

FabULous Interoperability for ML and a Linear Language

Instead of a monolithic programming language trying to cover all feature...
research
09/08/2023

A Grounded Conceptual Model for Ownership Types in Rust

Programmers learning Rust struggle to understand ownership types, Rust's...

Please sign up or login with your details

Forgot password? Click here to reset