- Main
Flux: Liquid Types for Rust
- Lehmann, Nico
- Advisor(s): Jhala, Ranjit
Abstract
Languages like C and C++ have been the default for building low-level system software due to their fine-grained control over hardware. However, this control comes at the cost of memory safety, leading to bugs such as buffer overflows and use-after-free errors. Rust addresses these issues by providing similar low-level control while enforcing memory safety through its ownership-based type system. Yet, Rust cannot eliminate all software bugs—logic errors such as array bounds violations and integer overflows can still occur. We introduce FLUX, a static verifier for Rust built on the Liquid Types framework. FLUX enhances Rust’s type system with logical refinements, enabling the specification and automated verification of rich program invariants. By leveraging syntax-directed typing rules and SMT-based reasoning, FLUX can statically prove properties that lie beyond the guarantees of Rust’s native type system. We detail the integration of refinements with FLUX’s ownership model, demonstrate its applicability to generic code through the use of traits, and showcase FLUX’s effectiveness by verifying critical security properties in a real-world embedded operating system.