We present a novel and well automatable approach to formal verification of C programs with underspecified semantics, i.e., a language semantics that leaves open the order of certain evaluations. First, we reduce this problem to non-determinism of concurrent systems, automatically extracting a distributed Active Object model from underspecified, sequential C code. This translation process provides a fully formal semantics for the considered C subset. In the extracted model every non-deterministic choice corresponds to one possible evaluation order. This step also automatically translates specifications in the ANSI/ISO C Specification Language (ACSL) into method contracts and object invariants for Active Objects. We then perform verification on the specified Active Objects model, using the Crowbar theorem prover, which verifies the extracted model with respect to the translated specification and ensures the original property of the C code for all possible evaluation orders. By using model extraction, we can use standard tools, without designing a new complex program logic to deal with underspecification. The case study used is highly underspecified and cannot be handled correctly by existing tools for C.
翻译:我们提出了一种新颖的、完全自动化的方法,用于正式核查C程序,其语义定义不够明确的语义,即一种语言语义,允许某些评价的顺序。首先,我们将这一问题降低到并行系统的非确定性,自动从未指定、顺序的C代码中提取分布式主动对象模型。这一翻译过程为考虑的C子集提供了完全正式的语义。在所选的模型中,每个非确定性选择都对应一个可能的评价命令。这一步骤还将ANSI/ISO C 特定语言(ACSL)中的规格自动翻译成方法合同和用于活动对象的变量。然后,我们使用Crowbarsorem验证器对特定活动物体模型进行核查,该验证模型的翻译性规格,并确保C代码的原始属性用于所有可能的评价命令。通过使用模型提取,我们可以使用标准工具,而不必设计新的复杂程序逻辑来处理不精确的特性。所使用的案例研究被描述得非常低,无法由C的现有工具正确处理。