arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1809.00959cs.PL
收藏

将Xd-C程序转换为MSVL程序

Translating Xd-C programs to MSVL programs

Meng Wang, Cong Tian, Nan Zhang, Zhenhua Duan, Chenguang Yao

摘要:

C语言是最流行的软件系统语言之一。为了验证C语言系统的安全性、可靠性和保密性,采用了基于建模、仿真和验证语言(MSVL)及其编译器MC的代码级运行时验证工具UMC 4 M。为此,必须将C程序$P$转换为MSVL程序M,并且还将所需属性$Q$的否定转换为MSVL程序M ',然后用MC编译和执行“M和M”。通过评估是否存在新MSVL程序M和M”的可接受执行来检查$P$是否违反$Q$。因此,如何将C程序翻译成MSVL程序是一个关键问题。然而,一般来说,C是复杂的结构与goto语句。在本文中,我们将C语言的语法限制在一个合适的子集中,称为Xd-C,而不会损失表达能力。此外,我们提出了一个从Xd-C程序到MSVL程序的翻译算法的基础上的表达式和语句的翻译算法。此外,还归纳地证明了Xd-C和MSVL程序中表达式和语句的等价性。最后证明了Xd-C源程序与MSVL源程序的等价性。此外,所提出的方法已经实现了一个工具称为$C2M$。一个基准的实验,包括13个真实世界的Xd-C程序进行。结果表明,$C2M$是有效的。

英文摘要:

C language is one of the most popular languages for software systems. In order to verify safety, reliability and security properties of such systems written in C, a tool UMC4M for runtime verification at code level based on Modeling, Simulation and Verification Language (MSVL) and its compiler MC is employed. To do so, a C program $P$ has to be translated to an MSVL program M and the negation of a desired property $Q$ is also translated to an MSVL program M', then "M and M" is compiled and executed armed with MC. Whether $P$ violates $Q$ is checked by evaluating whether there exists an acceptable execution of new MSVL program M and M". Therefore, how to translate a C program to an MSVL program is a critical issue. However, in general, C is of complicated structures with goto statement. In this paper, we confine the syntax of C in a suitable subset called Xd-C without loss of expressiveness. Further, we present a translation algorithm from an Xd-C program to an MSVL program based on translation algorithms for expressions and statements. Moreover, the equivalences between expressions and statements involved in Xd-C and MSVL programs are inductively proved. Subsequently, the equivalence between the original Xd-C program and the translated MSVL program is also proved. In addition, the proposed approach has been implemented by a tool called $C2M$. A benchmark of experiments including 13 real-world Xd-C programs is conducted. The results show that $C2M$ works effectively.

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

↑