1 / 21

SMV プログラム 例 3

SMV プログラム 例 3. MODULE main VAR request : boolean; state : {ready, busy}; ASSIGN init(state) := ready; next(state) := case state = ready & request : busy; 1 : {ready, busy}; esac; SPEC AG(request -> AF state = busy).

gezana
Download Presentation

SMV プログラム 例 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SMVプログラム 例3 MODULE main VAR request : boolean; state : {ready, busy}; ASSIGN init(state) := ready; next(state) := case state = ready & request : busy; 1 : {ready, busy}; esac; SPEC AG(request -> AF state = busy) • 上から条件を評価 • 1は恒真

  2. 背景説明モデル検査 モデル検査ツール 状態機械 設計 設計誤り 性質(仕様)

  3. 状態爆発問題 (p.106) • 「モデル規模の増大にともない,探索すべき状態数が急激に増大する」という問題 X 状態数10の構成要素10個からなるシステム 状態の総数 1010 = 100億

  4. 状態削減手法 • Partial Order Reduction (例.SPIN) • 遷移の独立性を考慮して検証する性質に無関係な状態を判断することで計算量を削減する手法 • 記号モデル検査(例.SMV, NuSMV) • 論理関数で状態集合や遷移関係を表し,それらの操作によって検証を行う手法

  5. 構成 • 集合演算に基づく記号モデル検査 (4.2.2) • 論理関数に基づく表現 (4.2.3, 4.2.4) • 2分決定グラフに基づく記号モデル検査の実現 (4.2.5, 4.2.6) 集合演算 論理関数 2分決定グラフ {001, 011, 100, 101, 111} x1x2  x3

  6. 4.2.2 集合演算に基づく記号モデル検査 • EF f ≡ E (true U f) • EG f ≡AF(f) • AF f ≡ A (true U f) • AG f ≡EF(f) • EX, EU, AX, AUのみ考える

  7. 4.2.2 集合演算に基づく記号モデル検査 • S: 全状態の集合 • Sf :CTL式fが成り立つ状態の集合 • 求めたいもの • 検証したい性質fについてSf • Sfが求まれば,初期状態集合ISfか どうかを調べればよい • 求め方 • 部分式に対して再帰的に求める EF(q  EXq) q  EXq EXq q q q

  8. 4.2.2 集合演算に基づく記号モデル検査 • Sf = S – Sf • Sf g = SfSg, Sf g = Sf Sg q p,q p q s1 s2 s3 s4 p p pq pq

  9. 4.2.2 集合演算に基づく記号モデル検査 SEXf • SEXf • SAXf Sf f f Sf f f SAXf

  10. 4.2.2 集合演算に基づく記号モデル検査 T0 = Sg Ti+1= Ti (SfSEXTi) • SE(fUg) いずれTi+1 = Tiとなる f f T1 T0 T2 f f g f f g f f

  11. 4.2.2 集合演算に基づく記号モデル検査 T0 = Sg Ti+1= Ti (SfSAXTi) • SA(fUg) いずれTi+1 = Tiとなる f T0 f T2 g T1 f f f g

  12. 例4.3 S EF(q  EXq) = {s1, s2} EF(q  EXq) T1, T2 T0 q  EXq q p,q p q EXq q s1 s2 s3 s4 q q  EXq q EF(q  EXq) EF(q  EXq)

  13. 4.2.3 論理関数に基づく表現 • 状態集合,遷移関係を論理関数で表す • 2分決定グラフを用いて効率良く表現可能 • 状態の2進表現 q p,q p q s1 s2 s3 s4 x1x2 10 11 00 01

  14. 集合の表現 q p,q p q s1 s2 s3 s4 x1x2 10 11 00 01 例. Sq = {s1, s2, s4} fq (x1,x2)= x1x2  x1x2  x1x2 Sqの特性関数 (characteristic function)

  15. 遷移関係の表現 q p,q p q s1 s2 s3 s4 x1x2 10 11 00 01 R = {(s1, s2), (s2, s3), (s2, s4), (s3, s3), (s3, s4), (s4, s4)} = {(00,01), (01,10), (01,11), (10,10), (10,11), (11,11)} N (x1,x2,x1’,x2’)= x1x2 x1x2’  …

  16. 4.2.4 論理関数に基づく記号モデル検査 • fp =fp Sp = S – Sp • fp q =fp  fqSp q = SpSq fpq =fpfq Sp q = Sp Sq q p,q p q s1 s2 s3 s4 x1x2 10 11 00 01 例. Sq = {s1, s2, s4}, fq (x1,x2)= x1x2  x1x2  x1x2 fq (x1,x2) = fq (x1,x2) =x1x2

  17. q p,q p q s1 s2 s3 s4 EXq EXq EXq EXq 4.2.4 論理関数に基づく記号モデル検査 • fEXq(x1,x2)= Exist(N(x1,x2,x1’,x2’)fq(x1’,x2’), {x1’,x2’}) N fq Nfq x1,x2,x1’,x2’ 0 0 0 0 0 1 0 0 0 0 1 1 1 1 1 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 1 1 1 … … … … …

  18. q p,q p q s1 s2 s3 s4 4.2.4 論理関数に基づく記号モデル検査 • fEXp(x1,x2)= Exist(N(x1,x2,x1’,x2’)fp(x1’,x2’), {x1’,x2’}) N fp s1 s2 s3 s2 s3 s4 Nfp s1 s2 s3 s4 辺の始点となっている頂点のみを取り出す Exist s1 s2 s3

  19. 4.2.5 2分決定グラフ (BDD) 変数の順序がどのパスでも等しいBDDを考える (Ordered BDD, OBDD)

  20. 縮約ルール ルール1:ノードの除去 ルール2:部分グラフの共有

  21. 縮約された(Reduced)BDDROBDD

More Related