Inference of static semantics for incomplete C programs

Author:

Melo Leandro T. C.1,Ribeiro Rodrigo G.2,de Araújo Marcus R.1,Pereira Fernando Magno Quintão1

Affiliation:

1. Federal University of Minas Gerais, Brazil

2. Federal University of Ouro Preto, Brazil

Abstract

Incomplete source code naturally emerges in software development: during the design phase, while evolving, testing and analyzing programs. Therefore, the ability to understand partial programs is a valuable asset. However, this problem is still unsolved in the C programming language. Difficulties stem from the fact that parsing C requires, not only syntax, but also semantic information. Furthermore, inferring types so that they respect C's type system is a challenging task. In this paper we present a technique that lets us solve these problems. We provide a unification-based type inference capable of dealing with C intricacies. The ideas we present let us reconstruct partial C programs into complete well-typed ones. Such program reconstruction has several applications: enabling static analysis tools in scenarios where software components may be absent; improving static analysis tools that do not rely on build-specifications; allowing stub-generation and testing tools to work on snippets; and assisting programmers on the extraction of reusable data-structures out of the program parts that use them. Our evaluation is performed on source code from a variety of C libraries such as GNU's Coreutils, GNULib, GNOME's GLib, and GDSL; on implementations from Sedgewick's books; and on snippets from popular open-source projects like CPython, FreeBSD, and Git.

Funder

CNPq

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference51 articles.

1. ANSI-Standard. 1989. ANSI X3.159-1989 - The C Programming Language. ANSI-Standard. 1989. ANSI X3.159-1989 - The C Programming Language.

2. The GDSL Authors. 2017. The Generic Data Structures Library. http://home.gna.org/gdsl/ . The GDSL Authors. 2017. The Generic Data Structures Library. http://home.gna.org/gdsl/ .

3. Overhauling SC atomics in C11 and OpenCL

4. Sniff (abstract)

5. Mechanized Semantics for the Clight Subset of the C Language

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

1. Partial program analysis for staged compilation systems;Formal Methods in System Design;2024-06-13

2. SLaDe: A Portable Small Language Model Decompiler for Optimized Assembly;2024 IEEE/ACM International Symposium on Code Generation and Optimization (CGO);2024-03-02

3. Statistical Type Inference for Incomplete Programs;Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering;2023-11-30

4. LExecutor: Learning-Guided Execution;Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering;2023-11-30

5. Program representations for predictive compilation: State of affairs in the early 20’s;Journal of Computer Languages;2022-12

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

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

www.globalauthorid.com

TOP

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