arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2110.05875cs.SE
收藏

逆向工程代码解释:将基于整数的可变性转换为命题逻辑

Reverse Engineering Code Dependencies: Converting Integer-Based Variability to Propositional Logic

Adam Krafczyk, Sascha El-Sharkawy, Klaus Schmid

摘要:

存在许多用于软件产品线的基于SAT的分析概念和工具,其从产品线的源代码资产中提取命题逻辑中的代码依赖性。在这些提取的条件下,SAT求解器用于推理变异性。然而,在实践中,许多软件产品线使用基于整数的可变性。可变性变量保存整数值,条件中使用整数运算符。大多数现有的分析工具不能处理这种可变性;他们期望纯布尔条件。本文介绍了一种将基于整数的可变性条件转换为命题逻辑的方法。在基于整数的产品线上运行这种方法作为准备,允许现有的基于SAT的分析在没有任何修改的情况下工作。我们的方法构建的纯布尔公式作为基于整数的条件的替代,在可满足性方面大多等同于原始条件。我们的方法是由一个真实的工业案例研究的背景下,这样的准备是必要的,以分析的变异性的动机和实施。我们的贡献是一种方法来转换的条件,使用整数变量,到命题公式,使SAT求解器的结果容易使用。它在受限变量(即允许值范围很小的变量)上工作得很好;不受限制的整数变量处理得不太精确,但仍然保留有用的可变性信息。

英文摘要:

A number of SAT-based analysis concepts and tools for software product lines exist, that extract code dependencies in propositional logic from the source code assets of the product line. On these extracted conditions, SAT-solvers are used to reason about the variability. However, in practice, a lot of software product lines use integer-based variability. The variability variables hold integer values, and integer operators are used in the conditions. Most existing analysis tools can not handle this kind of variability; they expect pure Boolean conditions. This paper introduces an approach to convert integer-based variability conditions to propositional logic. Running this approach as a preparation on an integer-based product line allows the existing SAT-based analyses to work without any modifications. The pure Boolean formulas, that our approach builds as a replacement for the integer-based conditions, are mostly equivalent to the original conditions with respect to satisfiability. Our approach was motivated by and implemented in the context of a real-world industrial case-study, where such a preparation was necessary to analyze the variability. Our contribution is an approach to convert conditions, that use integer variables, into propositional formulas, to enable easy usage of SAT-solvers on the result. It works well on restricted variables (i.e. variables with a small range of allowed values); unrestricted integer variables are handled less exact, but still retain useful variability information.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑