计算机工程与应用 ›› 2008, Vol. 44 ›› Issue (10): 43-47.

• 理论研究 • 上一篇    下一篇

基于Spin的UML状态图模型检查的设计与实现

郭 伟1,缪 力1,张大方1,2,闵应骅3   

  1. 1.湖南大学 软件学院,长沙 410082
    2.湖南大学 计算机与通信学院,长沙 410082
    3.中国科学院 计算技术研究所,北京 100080
  • 收稿日期:2007-07-20 修回日期:2007-09-24 出版日期:2008-04-01 发布日期:2008-04-01
  • 通讯作者: 郭 伟

Model checking UML Statechart based on Spin

GUO Wei1,MIAO Li1,ZHANG Da-fang1,2,MIN Ying-hua3   

  1. 1.Software College,Hunan University,Changsha 410082,China
    2.College of Computer and Communication,Hunan University,Changsha 410082,China
    3.Institute of Computer Technology,Chinese Academy of Sciences,Beijing 100080,China
  • Received:2007-07-20 Revised:2007-09-24 Online:2008-04-01 Published:2008-04-01
  • Contact: GUO Wei

摘要: UML已经是软件建模方面的标准语言,UML Statechart描述了系统在其生命周期中的动态行为。随着系统规模的扩大和复杂度的提高,Statechart往往包含设计者所未预料到的隐患,通过模型检查来对Statechart进行穷举检验就成为一个重要课题,首先给出了含层次、并发Statechart的语义;随后提出了对Statechart进行模型检查的一种新方法,并且已经编写软件SC2Spin实现此方法,该方法使用了提出的Statechart山脉算法和迁移提取法,可以将一个Statechart自动转化为Spin的输入语言Promela,从而验证Statechart的死锁、活锁等错误和时序逻辑公式。

关键词: 模型检查, Statechart, Statechart山脉算法, 迁移提取, Spin

Abstract: Being an industry standard of software modeling language,UML is well accepted and extensively used in the industry.The UML Statechart describes some dynamic behavior of a system in its lifecycle.With systems to be modeled using Statechart become more and more large and complex,the Statechart often contain unexpected hidden dangers.It is then necessary to check the consistency and correctness.The paper presents an approach to model checking UML Statechart containing hierarchy and concurrent states.The software named SC2Spin is completed to check Statechart automatically.First semantics of Statechart is defined and then a new method to check Statechart is proposed,the Statechart is translated to Promela which is the input language of the famous model checking tool SPIN.To implement this method,this paper proposes Statechart Mountain Algorithm(SMA) to analyze the Translation in Statechart,proposes Translation Extraction to implement the translation.SC2Spin can detect errors like Deadlocks and Livelocks and verify LTL formulas.

Key words: model checking, Statechart, Statechart Mountain Algorithm(SMA), Transition Extraction, Spin