Exploiting the Sparseness of Control-Flow and Call Graphs for Efficient and On-Demand Algebraic Program Analysis

Author:

Conrado Giovanna Kobus1ORCID,Goharshady Amir Kafshdar1ORCID,Kochekov Kerim1ORCID,Tsai Yun Chen1ORCID,Zaher Ahmed Khaled1ORCID

Affiliation:

1. Hong Kong University of Science and Technology, Hong Kong, Hong Kong

Abstract

Algebraic Program Analysis (APA) is a ubiquitous framework that has been employed as a unifying model for various problems in data-flow analysis, termination analysis, invariant generation, predicate abstraction and a wide variety of other standard static analysis tasks. APA models program summaries as elements of a regular algebra . Suppose that a summary in A is assigned to every transition of the program and that we aim to compute the effect of running the program starting at line s and ending at line t . APA first computes a regular expression capturing all program paths of interest. In case of intraprocedural analysis, models all paths from s to t , whereas in the interprocedural case it models all interprocedurally-valid paths, i.e. ‍paths that go back to the right caller function when a callee returns. This regular expression is then interpreted over the algebra to obtain the desired result. Suppose the program has n lines of code and each evaluation of an operation in the regular algebra takes O ( k ) time. It is well-known that a single APA query, or a set of queries with the same starting point s , can be answered in O ( n · α( n ) · k ), where α is the inverse Ackermann function. In this work, we consider an on-demand setting for APA: the program is given in the input and can be preprocessed. The analysis has to then answer a large number of on-line queries, each providing a pair ( s , t ) of program lines which are the start and end point of the query, respectively. The goal is to avoid the significant cost of running a fresh APA instance for each query. Our main contribution is a series of algorithms that, after a lightweight preprocessing of O ( n · lg n · k ), answer each query in O ( k ) time. In other words, our preprocessing has almost the same asymptotic complexity as a single APA query, except for a sub-logarithmic factor, and then every future query is answered instantly, i.e. ‍by a constant number of operations in the algebra. We achieve this remarkable speedup by relying on certain structural sparsity properties of control-flow and call graphs (CFGs and CGs). Specifically, we exploit the fact that control-flow graphs of real-world programs have a tree-like structure and bounded treewidth and nesting depth and that their call graphs have small treedepth in comparison to the size of the program. Finally, we provide experimental results demonstrating the effectiveness and efficiency of our approach and showing that it beats the runtime of classical APA by several orders of magnitude.

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference76 articles.

1. Algorithms and Hardness Results for Computing Cores of Markov Chains;Ahmadi Ali;FSTTCS.,2022

2. Ali Ahmadi , Majid Daliri , Amir Kafshdar Goharshady, and Andreas Pavlogiannis . 2022 . Efficient approximations for cache-conscious data placement. In PLDI. 857–871. Ali Ahmadi, Majid Daliri, Amir Kafshdar Goharshady, and Andreas Pavlogiannis. 2022. Efficient approximations for cache-conscious data placement. In PLDI. 857–871.

3. How treewidth helps in verification

4. Noga Alon and Baruch Schieber. 1987. Optimal preprocessing for answering on-line product queries. https://citeseerx.ist.psu.edu/document?repid=rep1&doi=cf740240d3a7440e23e92a09bf590cb70544cf4f Noga Alon and Baruch Schieber. 1987. Optimal preprocessing for answering on-line product queries. https://citeseerx.ist.psu.edu/document?repid=rep1&doi=cf740240d3a7440e23e92a09bf590cb70544cf4f

5. Ali Asadi , Krishnendu Chatterjee , Amir Kafshdar Goharshady , Kiarash Mohammadi, and Andreas Pavlogiannis. 2020 . Faster Algorithms for Quantitative Analysis of MCs and MDPs with Small Treewidth. In ATVA. 253–270. Ali Asadi, Krishnendu Chatterjee, Amir Kafshdar Goharshady, Kiarash Mohammadi, and Andreas Pavlogiannis. 2020. Faster Algorithms for Quantitative Analysis of MCs and MDPs with Small Treewidth. In ATVA. 253–270.

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

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

www.globalauthorid.com

TOP

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