基于 k - 归纳和不变式的嵌入式 C 软件模型检查
1. PIPS 不变式的翻译算法
1.1 算法概述
PIPS 不变式的翻译算法旨在将带有 PIPS 不变式的 C 代码转换为 C 程序支持的带有不变式的新代码。该算法主要分为三个部分:识别不变式中的 #init
、生成支持 #init
结构的代码以及修正不变式格式。
1.2 算法步骤
以下是该算法的详细步骤:
Algorithm 2 Translation algorithm of PIPS invariants
1: Input: PIPSCode - C code with PIPS invariants
2: Output: NewCodeInv - New code with invariant supported by C programs
// dictionary to identify #init
3: dict_variniteloc ←{ }
// list for the new code generated in the translation
4: NewCodeInv ←{ }
// Part 1 - identifying #init in the invariants
5: for all line of the PIPSCode do
6:
if is a PIPS comment in this pattern // P(w,x) {w == 0, x#init > 10} then
7: