KRust: A Formal Executable Semantics of Rust

04/28/2018
by   Feng Wang, et al.
0

Rust is a new and promising high-level system programming language. It provides both memory safety and thread safety through its novel mechanisms such as ownership, moves and borrows. Ownership system ensures that at any point there is only one owner of any given resource. The ownership of a resource can be moved or borrowed according to the lifetimes. The ownership system establishes a clear lifetime for each value and hence does not necessarily need garbage collection. These novel features bring Rust high performance, fine low-level control of C and C++, and unnecessity in garbage collection, which differ Rust from other existing prevalent languages. For formal analysis of Rust programs and helping programmers learn its new mechanisms and features, a formal semantics of Rust is desired and useful as a fundament for developing related tools. In this paper, we present a formal executable operational semantics of a realistic subset of Rust, called KRust. The semantics is defined in K, a rewriting-based executable semantic framework for programming languages. The executable semantics yields automatically a formal interpreter and verification tools for Rust programs. KRust has been thoroughly validated by testing with hundreds of tests, including the official Rust test suite.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/17/2018

K-Rust: An Executable Formal Semantics for Rust

Rust is a system programming language designed for providing better memo...
research
06/07/2017

Decoding Lua: Formal Semantics for the Developer and the Semanticist

We provide formal semantics for a large subset of the Lua programming la...
research
11/14/2022

A Formal CHERI-C Semantics for Verification

CHERI-C extends the C programming language by adding hardware capabiliti...
research
05/12/2018

π: Towards a Simple Formal Semantic Framework for Compiler Construction

This paper proposes π, a formal semantic framework for compiler construc...
research
10/27/2022

Formal Semantics for the Halide Language

We present the first formalization and metatheory of language soundness ...
research
06/07/2018

Rust Distilled: An Expressive Tower of Languages

Rust represents a major advancement in production programming languages ...
research
05/13/2017

Learning Semantic Correspondences in Technical Documentation

We consider the problem of translating high-level textual descriptions t...

Please sign up or login with your details

Forgot password? Click here to reset