时 序连接和逻辑连接相结合,可以得到一些有趣的复杂属性。属性AG((pump=off) -> AF (pump=on))表示如果pump=off,那么最终pump=on这种情形总会发生。初始状态,该属性显然为false。属性AG AF (pump=off -> (level_a=Empty | level_b=Full))表示如果底层水槽为Empty或上层水槽为Full,那么pump将总是为off。属性AG (EF (level_b= ok|level_b=Full))表示总是会出现上层水槽为ok或Full的情形。 实际应用中的模型校验
模型校验已被证明是对各类系统(尤其是硬件系统、实时嵌入式系统和安全临界系统)进行需求和设计验证的有效工具。例如,SPIN模型校验器曾用于验证NASA的深空1发射方案中的多线程规划执行模型并成功地发现了5个先前未知的并发缺陷。然而,实际使用模型校验时还需要注意下面一些主要问题:
1. 每种模型校验工具都采用特有的建模语言,这些建模语言一般都无法将不规范的需求描述自动转化为规范化语言。这样的转化显然需要手工完成,因此很难检验模型 是否正确地表示了建模系统。实际上,指定的建模表示法往往很难甚至根本不可能对部分系统需求进行建模。2. 专用工具属性规范表示法也存在类似的问题,属性表示法通常可以是CTL、CTL*或命题线性时序逻辑(PLTL)的变形。某些需要验证的属性很难甚至根本 不可能用该表示法进行描述。3. 模型系统中的状态数量也可能极为庞大。尽管模型校验算法可以利用一些技巧减小状态空间的复杂度,但模型校验器仍然需要很长的时间才能验证一个指定的属性或 者决定“放弃”验证该属性。这时,用户将不得不投入更大的精力,独立验证模型的各部分或者通过减小变量的取值范围以达到简化状态空间的目的。
尽管如此,模型校验仍被证明是无与伦比的系统需求或设计验证工具。该工具能在需求或设计的早期阶段发现瑕疵,因此能极大地节省后续的开发时间。 鸣谢
衷心感谢Tata研发和设计中心(TRDDC)的常务董事Mathai Joseph教授对我的大力支持。我也非常感激Manasee Palshikar博士对我的鼓励和支持。 参考文献
1. Clarke, Edmund M., Orna Grumberg, and Doron A. Peled. Model Checking, Cambridge, MA: MIT Press, 1999.2. Berard, Beatrice, Michel Bidoit, Alain Finkel, Francois Laroussinie,
Antoine Petit, Laure Petrucci, Philippe Schnoebelen, and Pierre Mckenzie.
Systems and Software Verification: Model-Checking Techniques and Tools,
Berlin-Heidelberg: Springer Verlag, 2001.
3. Havelund, Klaus, Mike Lowry, and John Penix. "Formal Analysis of a
Space-Craft Controller using SPIN," IEEE Transactions on Software
Engineering, vol. 27, no. 8, Aug. 2001, pp. 749-765.
4. Clarke, Edmund M., Orna Grumberg, and Doron A. Peled. Model Checking,
Cambridge, MA: MIT Press, 1999.
5. Berard, Beatrice, Michel Bidoit, Alain Finkel, Francois Laroussinie,
Antoine Petit, Laure Petrucci, Philippe Schnoebelen, and Pierre Mckenzie.
Systems and Software Verification: Model-Checking Techniques and Tools,
Berlin-Heidelberg: Springer Verlag, 2001.
6. Havelund, Klaus, Mike Lowry, and John Penix. "Formal Analysis of a
Space-Craft Controller using SPIN," IEEE Transactions on Software
Engineering, vol. 27, no. 8, Aug. 2001, pp. 749-765.
7. Harel, David, and Michal Politi. Modeling Reactive Systems with
Statecharts—The Statemate Approach. New York, NY: McGraw-Hill, 1998. 作者:Girish Keshav Palshikar
Tata研发和设计中心科学家
Email: girishp@pune.tcs.co.in