A trustworthy mechanized formalization of R

Author:

Bodin Martin1,Diaz Tomás1,Tanter Éric1

Affiliation:

1. University of Chile, Chile

Abstract

The R programming language is very popular for developing statistical software and data analysis, thanks to rich libraries, concise and expressive syntax, and support for interactive programming. Yet, the semantics of R is fairly complex, contains many subtle corner cases, and is not formally specified. This makes it difficult to reason about R programs. In this work, we develop a big-step operational semantics for R in the form of an interpreter written in the Coq proof assistant. We ensure the trustworthiness of the formalization by introducing a monadic encoding that allows the Coq interpreter, CoqR, to be in direct visual correspondence with the reference R interpreter, GNU R. Additionally, we provide a testing framework that supports systematic comparison of CoqR and GNU R. In its current state, CoqR covers the nucleus of the R language as well as numerous additional features, making it pass a significant number of realistic test cases from the GNU R and FastR projects. To exercise the formal specification, we prove in Coq the preservation of memory invariants in selected parts of the interpreter. This work is an important first step towards a robust environment for formal verification of R programs.

Funder

Millenium Institute for Foundational Research on Data (IMFD Chile).

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Graphics and Computer-Aided Design,Software

Reference35 articles.

1. Karthikeyan Bhargavan Antoine Delignat-Lavaud and Sergio Maffeis. 2013. Language-Based Defenses Against Untrusted Browser Origins. In Usenix security symposium. Karthikeyan Bhargavan Antoine Delignat-Lavaud and Sergio Maffeis. 2013. Language-Based Defenses Against Untrusted Browser Origins. In Usenix security symposium.

2. Martin Bodin Arthur Charguéraud Daniele Filaretti Philippa Gardner Sergio Maffeis Daiva Naudinien Alan Schmitt and Gareth Smith. 2014. A Trusted Mechanised JavaScript Specification. In POPL. 10.1145/2535838.2535876 Martin Bodin Arthur Charguéraud Daniele Filaretti Philippa Gardner Sergio Maffeis Daiva Naudinien Alan Schmitt and Gareth Smith. 2014. A Trusted Mechanised JavaScript Specification. In POPL. 10.1145/2535838.2535876

3. Patrick Burns. 2011. The R Inferno. Patrick Burns. 2011. The R Inferno.

4. Arthur Charguéraud Alan Schmitt and Thomas Wood. 2018. JSExplain: A Double Debugger for JavaScript. In The web conference. 10.1145/3184558.3185969 Arthur Charguéraud Alan Schmitt and Thomas Wood. 2018. JSExplain: A Double Debugger for JavaScript. In The web conference. 10.1145/3184558.3185969

5. ECMA International. 2010. Test262. https://github.com/tc39/test262 . ECMA International. 2010. Test262. https://github.com/tc39/test262 .

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

1. An Executable Semantics for Faster Development of Optimizing Python Compilers;Proceedings of the 16th ACM SIGPLAN International Conference on Software Language Engineering;2023-10-23

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

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

www.globalauthorid.com

TOP

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