关系型对象不变量的自动推断
Automatic Inference of Relational Object Invariants
AI总结:
本文提出一种基于抽象解释的对象不变量推断方法,通过内存库与MRU对象分离抽象及数值-相等性复合抽象域,在CRAB中实现并显著提升了关系性质的可扩展性,且能有效辅助SEABMC消除断言并加速运行。
摘要:
关系型对象不变量(或表示不变量)是(内存)对象在其整个生命周期中其字段所保持的关系性质。例如,缓冲区的长度永远不会超过其容量。自动推断这些不变量尤其具有挑战性,因为它们常常在字段更新期间被暂时破坏。在本文中,我们提出了一种基于抽象解释的解决方案来推断对象不变量。我们的关键见解是一种新的内存对象抽象,其中内存被划分为多个内存库,每个库包含若干对象。在每个库内,通过分离最近最常使用(MRU)的对象来进一步抽象对象,该对象以强更新精确表示,而其余对象则被汇总。为了有效实现这一方法,我们引入了一个新的复合抽象域,它形成数值子域和相等性子域的约简积。这种设计能够高效地表达少量变量(例如,同一抽象对象的字段)之间的关系。我们在CRAB抽象解释器中实现了新域,并在若干内存安全基准上对其进行了评估。我们表明,对于关系性质,我们的方法比CRAB的现有实现具有显著更高的可扩展性。为了评估精度,我们将我们的分析作为预处理步骤集成到SEABMC有界模型检查器中,并表明它在预处理期间消除断言以及显著提高SEABMC运行时间方面都是有效的。
英文摘要:
Relational object invariants (or representation invariants) are relational properties held by the fields of a (memory) object throughout its lifetime. For example, the length of a buffer never exceeds its capacity. Automatic inference of these invariants is particularly challenging because they are often broken temporarily during field updates. In this paper, we present an Abstract Interpretation-based solution to infer object invariants. Our key insight is a new object abstraction for memory objects, where memory is divided into multiple memory banks, each containing several objects. Within each bank, the objects are further abstracted by separating the most recently used (MRU) object, represented precisely with strong updates, while the rest are summarized. For an effective implementation of this approach, we introduce a new composite abstract domain, which forms a reduced product of numerical and equality sub-domains. This design efficiently expresses relationships between a small number of variables (e.g., fields of the same abstract object). We implement the new domain in the CRAB abstract interpreter and evaluate it on several benchmarks for memory safety. We show that our approach is significantly more scalable for relational properties than the existing implementation of CRAB. For evaluating precision, we have integrated our analysis as a pre-processing step to SEABMC bounded model checker, and show that it is effective at both discharging assertions during pre-processing, and significantly improving the run-time of SEABMC.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。