Flux: Liquid Types for Rust

Author:

Lehmann Nico1ORCID,Geller Adam T.2ORCID,Vazou Niki3ORCID,Jhala Ranjit1ORCID

Affiliation:

1. University of California at San Diego, USA

2. University of British Columbia, Canada

3. IMDEA Software Institute, Spain

Abstract

We introduce Flux, which shows how logical refinements can work hand in glove with Rust's ownership mechanisms to yield ergonomic type-based verification of low-level pointer manipulating programs. First, we design a novel refined type system for Rust that indexes mutable locations, with pure (immutable) values that can appear in refinements, and then exploits Rust's ownership mechanisms to abstract sub-structural reasoning about locations within Rust's polymorphic type constructors, while supporting strong updates. We formalize the crucial dependency upon Rust's strong aliasing guarantees by exploiting the Stacked Borrows aliasing model to prove that "well-borrowed evaluations of well-typed programs do not get stuck". Second, we implement our type system in Flux, a plug-in to the Rust compiler that exploits the factoring of complex invariants into types and refinements to efficiently synthesize loop annotations-including complex quantified invariants describing the contents of containers-via liquid inference. Third, we evaluate Flux with a benchmark suite of vector manipulating programs and parts of a previously verified secure sandboxing library to demonstrate the advantages of refinement types over program logics as implemented in the state-of-the-art Prusti verifier. While Prusti's more expressive program logic can, in general, verify deep functional correctness specifications, for the lightweight but ubiquitous and important verification use-cases covered by our benchmarks, liquid typing makes verification ergonomic by slashing specification lines by a factor of two, verification time by an order of magnitude, and annotation overhead from up to 24% of code size (average 14%), to nothing at all.

Funder

NSF

HORIZON EUROPE European Research Council

Office of Naval Research

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference50 articles.

1. L^3: a linear language with locations;Ahmed Amal;Fundamenta Informaticae,2007

2. Compiling with Continuations

3. Vytautas Astrauskas , Aurel Bílý , Jonáš Fiala , Zachary Grannan , Christoph Matheja , Peter Müller , Federico Poli , and Alexander J . Summers . 2022 . The Prusti Project: Formal Verification for Rust. In NASA Formal Methods, Jyotirmoy V. Deshmukh, Klaus Havelund, and Ivan Perez (Eds.). Springer International Publishing , Cham. 88–108. isbn:978-3-031-06773-0 https://link.springer.com/chapter/10.1007/978-3-031-06773-0_5 Vytautas Astrauskas, Aurel Bílý, Jonáš Fiala, Zachary Grannan, Christoph Matheja, Peter Müller, Federico Poli, and Alexander J. Summers. 2022. The Prusti Project: Formal Verification for Rust. In NASA Formal Methods, Jyotirmoy V. Deshmukh, Klaus Havelund, and Ivan Perez (Eds.). Springer International Publishing, Cham. 88–108. isbn:978-3-031-06773-0 https://link.springer.com/chapter/10.1007/978-3-031-06773-0_5

4. Leveraging rust types for modular specification and verification

5. Predicate Abstraction for Linked Data Structures

Cited by 5 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Mechanizing Refinement Types;Proceedings of the ACM on Programming Languages;2024-01-05

2. Borrowable Fractional Ownership Types for Verification;Lecture Notes in Computer Science;2023-12-30

3. Focusing on Refinement Typing;ACM Transactions on Programming Languages and Systems;2023-12-20

4. On the Practicality and Soundness of Refinement Types;Electronic Proceedings in Theoretical Computer Science;2023-11-17

5. Weighted Refinement Types for Counterpoint Composition;Proceedings of the 11th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design;2023-08-30

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3