arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1701.00630cs.SEcs.LOcs.PL
收藏

基于Prolog的嵌入式系统Source Code验证

Source Code Verification for Embedded Systems using Prolog

Frank Flederer, Ludwig Ostermayer, Dietmar Seipel, Sergio Montenegro

摘要:

系统相关的嵌入式软件需要可靠,因此需要经过良好的测试,特别是对于航空航天系统。验证程序的一种常用技术是分析程序的抽象语法树(AST)。树结构可以用逻辑程序设计语言Prolog来优雅地分析。此外,Prolog还为全面分析提供了进一步的优势:一方面,它本身提供了多功能选项来有效地处理树或图数据结构。另一方面,Prolog的非确定性和回溯简化了对程序流的不同变体的测试,而不需要付出很大的努力。一个基于规则的方法与Prolog允许验证目标的特点,在一个简洁和声明的方式。在本文中,我们描述了我们的方法来验证的闪存文件系统的源代码与Prolog的帮助。闪存文件系统是用C++编写的,专门为卫星使用而开发。我们将一个给定的抽象语法树的C++源代码转换成Prolog的事实,并推导出调用图和执行序列(树),然后进一步测试验证目标。由于控制结构的不同程序流分支是通过回溯作为完整执行序列的子树而导出的。最后,这些子树在Prolog中进行了验证。我们说明了我们的方法与案例研究,在那里我们搜索不正确的应用程序中使用的实时操作系统RODOS的嵌入式软件中的信号量。我们依赖于计算树逻辑(CTL),并设计了一个嵌入式领域特定语言(DSL)的Prolog来表达的验证目标。

英文摘要:

System relevant embedded software needs to be reliable and, therefore, well tested, especially for aerospace systems. A common technique to verify programs is the analysis of their abstract syntax tree (AST). Tree structures can be elegantly analyzed with the logic programming language Prolog. Moreover, Prolog offers further advantages for a thorough analysis: On the one hand, it natively provides versatile options to efficiently process tree or graph data structures. On the other hand, Prolog's non-determinism and backtracking eases tests of different variations of the program flow without big effort. A rule-based approach with Prolog allows to characterize the verification goals in a concise and declarative way. In this paper, we describe our approach to verify the source code of a flash file system with the help of Prolog. The flash file system is written in C++ and has been developed particularly for the use in satellites. We transform a given abstract syntax tree of C++ source code into Prolog facts and derive the call graph and the execution sequence (tree), which then are further tested against verification goals. The different program flow branching due to control structures is derived by backtracking as subtrees of the full execution sequence. Finally, these subtrees are verified in Prolog. We illustrate our approach with a case study, where we search for incorrect applications of semaphores in embedded software using the real-time operating system RODOS. We rely on computation tree logic (CTL) and have designed an embedded domain specific language (DSL) in Prolog to express the verification goals.

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

↑