期刊文献+

基于区间线性模版约束的程序分析

Program Analysis Based on Interval Linear Template Constraints
下载PDF
导出
摘要 抽象解释是一种对程序语义进行可靠近似的通用理论,该理论在保证可靠性的前提下,可为程序变量的值范围分析提供一个通用的框架.抽象域是抽象解释框架的核心,在该框架下面向数值性质分析的数值抽象域得到了广泛的关注.其中,模板多面体抽象域的表达能力覆盖了程序分析中常用的弱关系型抽象域,如区间抽象域、八边形抽象域等.该文对经典的基于线性模版约束的模版多面体抽象域进行扩展,以支持区间线性模版约束,从而得到一个新的数值抽象域——区间线性模版约束抽象域,可以用来推导变量间形如"∑k[a_k,b_k]x_k≤c"的区间线性不等式关系(其中区间系数[a_k,b_k]为分析前预先确定的常量).该抽象域采用"弱解"作为区间线性约束的解语义,可以表达某类非凸(甚至非联通)性质,因而比经典的模版多面体抽象域表达能力更强.区间线性模板约束抽象域的域元素可以看作是一系列模版多面体的析取,几何上,其域元素与每个象限的交均是一个凸的模板多面体(可以为空).该文给出了区间线性模版约束抽象域的域表示和域操作,基于该抽象域的静态分析算法主要基于区间线性规划来实现.进一步,该文讨论了基于区间线性模版约束抽象域中区间线性模版的生成方法.最后,该文在开源数值抽象库APRON中实现了区间线性模版约束抽象域,并开展了程序分析实验.初步的实验结果表明区间线性模版约束抽象域可以有效地分析程序中的析取行为. Abstract The problem of automatically inferring numerical invariants in a program has received wide attention in the analysis and verification of programs. Abstract interpretation is a general theory to soundly approximate program semantics. It provides a general framework to analyze value ranges of program variables, guaranteeing the soundness of the analysis. Abstract domain is key to the framework of abstract interpretation, which achieves a trade-off between efficiency and precision, and especially various numerical abstract domains have been proposed under this framework. In particular, the expressiveness of the template constraint matrix domain (TCM) subsumes most weakly relational abstract domains that are commonly used in practical programanalysis, for example, interval abstract domain (a≤x≤b), octagon abstract domain (±x±y≤c),etc. During the analysis and verification of real-life systems, due to uncertainty, the application data in the model or program may not be known exactly, which is then often provided or modelled in terms of intervals. Moreover, in practice, floating-point arithmetic and non-linear expressionsare often abstracted into linear expressions with interval coefficients. In other words, interval coefficients appear naturally during program analysis in practice. Hence, abstract domains that can infer interval linear relationships among variables are desired. This paper extends classical template constraint matrix domain which is based on linear template constraints, to support interval linear template constraints, and proposes a new numerical domain--interval template constraint matrix domain (itvTCM), which could infer interval linear inequality relations among variables inthe program in the form of "∑k[ak,bk]xk≤c" (where the interval coefficient [ak, bk ] is determinedbefore analysis), itvTCM makes use of "weak solution" as the semantics of the solution of interval linear constraints, which could represent certain non-convex (even non-connected) properties, and thus it is more expressive than TCM. Each itvTCM element could be considered as a disjunction of multiple TCMs but without using any explicit disjunctive operations. From the geometric point of view, each itvTCM element maps each orthant to a convex polyhedron (maybe an empty polyhedron). This paper provides domain representation and domain operations (such as join, meet, widening, etc. ) of itvTCM, and most domain operations of itvTCM are implemented based on interval linear programming. Theoretically, the complexity of some domain operations of itvTCM is at worst exponential of that of the corresponding domain operations in classic TCM. However, in practice, we could alleviate this problem through restricting the number of interval coefficients. In this paper, we also discuss how to generate templates for itvTCM. Finally, we have implemented itvTCM in the numerical abstract domain library APRON, and conducted experiments. The preliminary experimental results show that itvTCM is useful to capture disjunctive behaviors of a program.
出处 《计算机学报》 EI CSCD 北大核心 2018年第3期545-557,共13页 Chinese Journal of Computers
基金 国家"九七三"重点基础研究发展规划项目基金(2014CB340703) 国家自然科学基金(61532007) 上海市高可信计算重点实验室开放基金(07dz22304201504)资助
关键词 抽象解释 区间线性模版约束 区间线性规划 程序静态分析 非凸性质 abstract interpretation interval linear template constraint interval linear programming program static analysis non-convex property
  • 相关文献

参考文献3

二级参考文献50

  • 1姬孟洛,王怀民,李梦君,董威,齐治昌.一种基于抽象解释和通用单调数据流框架的值范围分析方法[J].计算机研究与发展,2006,43(11):2020-2026. 被引量:10
  • 2Harrison W H. Compiler analysis of the value ranges for variables. IEEE Transactions on Software Engineering, 1977, 3(3): 243 -250.
  • 3Simon A. Value-Range Analysis of C Programs: Towards Proving the Absence of Buffer Overflow Vulnerabilities. Berlin: Springer, 2008.
  • 4Cousot P, Cousot R. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints//Proceedings of the 4th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'77). Los Angeles, California, USA, 1977:238-252.
  • 5Cousot P, Cousot R. Static determination of dynamic properties of programs//Proceedings of the 2nd International Symposium on Programming, Paris, France, 1976:106-130.
  • 6Blanchet B, Cousot P, Cousot R, Feret J, Mauborgne L, Mine A, Monniaux D, Rival X. A static analyzer for large safety-critical software//Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation (PLDI' 03). San Diego, California, USA, 2003:196-207.
  • 7Cousot P, Halbwachs N. Automatic discovery of linear restraints among variables of a program//Proceedings of the 5th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL' 78). Tucson, Arizona, USA, 1978:84- 97.
  • 8Mine A. The octagon abstract domain. Higher-Order and Symbolic Computation, 2006, 19(1): 31-100.
  • 9Mine A. Symbolic methods to enhance the precision of numerical abstract domains//Proceedings of the 7th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI ' 06). Charleston, South Carolina, USA, 2006:348-363.
  • 10Chen L, Mine A, Cousot P. A sound floating-point polyhedra abstract domain//Proceedings of the 6th Asian Symposium on Programming Languages and Systems (APLAS' 08). Bangalore, India, 2008: 3-18.

共引文献12

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部