1 / 20

Seminar Modellüberprüfung

Seminar Modellüberprüfung. SMV – Symbolic Model Verifier Referent: Markus Nosse Inhaltsübersicht: Grundlagen Das SMV System. Grundlagen – BDDs 1. Binäre Entscheidungsdiagramme Repräsentation von logischen Formeln Effiziente Algorithmen Kanonische Darstellungsform

shiela
Télécharger la présentation

Seminar Modellüberprüfung

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. Seminar Modellüberprüfung SMV – Symbolic Model Verifier Referent: Markus Nosse Inhaltsübersicht: Grundlagen Das SMV System

  2. Grundlagen – BDDs 1 • Binäre Entscheidungsdiagramme • Repräsentation von logischen Formeln • Effiziente Algorithmen • Kanonische Darstellungsform • Repräsentation von Kripke Strukturen

  3. n1 a a 1 1 0 n2 0 n3 b b b 0 0 1 1 0 1 c c c c c 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 1 0 1 1 0 Grundlagen – BDDs 2 • Entscheidungsbaum • Entscheidungsdiagramm ist (sehr viel) kompakter • Beispiel: f = a Ù b  Ø c

  4. n2 b c 0 1 0 1 1 1 c c 0 0 1 1 1 0 0 1 Grundlagen – BDDs 3 • Zusammenfassen isomorpher Teilbäume • Terminale Knoten • var(v1) = var(v2) und low(v1) = low(v2) und high(v1) = high(v2) • Elimination überflüssiger Entscheidungen • low(v) = high(v)

  5. a Ù b Øc a Ù b Øc a Ù b Øc b Øc a a a 0 1 0 1 1 0 b Øc Øc 0 Øc b b 0 1 1 1 Øc c 0 1 1 0 Grundlagen – BDDs 4 • Direkte Konstruktion mittels Shannon Expansion • f(x1,...,xn) = (xif1)  (Ø xi f0),fk =f(x1,...,xi=k,...,xn ), k = 0,1 • Pro Anwendung ein Knoten für xi • Teilbäume ergeben sich rekursiv aus f0, f1

  6. Grundlagen - OBDDs • Ordnung auf Variablen • Minimalität, Kanonität • Effiziente Algorithmen • Reduce – Minimierung mit Aufwand O(|G|log|G|) • Apply – Logische Verknüpfung in O(|G||H|) • Restrict – Shannon Expansion in O(|G|log|G|) • Optimale Ordnung • coNP vollständiges Problem • Ausreichend gute Ordnungen sind bestimmbar

  7. a b a Øb s1 s2 Grundlagen - Repräsentation • Kripke-Strukturen als OBDDs • Binäre Codierung der Zustandsvariablen • Codierte Übergangsrelation definiert über {0,1} • Charakteristische Funktion ist logische Formel • Darstellbar als OBDD s1  s2: (a Ùb) Ù (a’ ÙØb’)s2  s1: (a ÙØb) Ù (a’ Ùb’)s2  s2: (a ÙØb) Ù (a’ ÙØb’) (s1s2)  (s2s1)  (s2s2)

  8. Symbolische Modellüberprüfung 1 • Algorithmus Check • Eingabe: CTL Formel • Ausgabe: Menge der erfüllenden Zustände als OBDD • Bezug auf eine Kripke Struktur (S,R,L), Übergangsrelation R liegt als OBDD vor

  9. Symbolische Modellüberprüfung 2 • Rekursive Definition über der Struktur von CTL Formeln • Atomare Aussage f = a • Ergebnis ist Menge der Zustände, in denen a erfüllt ist • Boolesche Operatoren f = f1Ù f2, f = f1 • Berechnung mittels Apply • Operanden sind Check(f1) und Check(f2) • CTL Operator EX f • Subroutine CheckEX • Parameter ist Check(f) • Ergebnis ergibt sich aus Relational Product Computation

  10. p p q p p p p q q p p q Symbolische Modellüberprüfung 3 • CTL Operator EG f • Subroutine CheckEG • Parameter ist Check(f) • Berechnung über größten Fixpunkt • CTL Operator E[f U g] • Subroutine CheckEU • Parameter sind Check(f), Check(g) • Berechnung über kleinsten Fixpunkt E[p U q]:

  11. SMV – Überblick 1 • SMV – Symbolic Model Verifier • Basistypen • Boolean • Endliche Integer Intervalle • Aufzählungstypen • Syntaktische Abkürzungen für CTL Formeln • Signale • Im Sinne von „Variablen“ • Definition als <name> : <typ> • Eindeutige Zuweisungen, keine zirkulären Abhängigkeiten • Operatoren init(<signal>) und next(<signal>)

  12. SMV - Überblick 2 • Module • Unterstützung von komponentenorientieren Modellen • Mehrfach instanziierbar • Parametrisierbar • Eingabe- und Ausgabeparameter • Synchrone oder asynchrone Modellierung • Prozesse • Schlüsselwort process • Analogie: Prozessmodell auf Einprozessorsystem

  13. SMV – Überblick 3 • Spezifikation • Mittels CTL Formeln • Temporale Operatoren X, G, F und U • neXt, Globally, in the Future, Until • Implizite universelle Quantifizierung  Gegenbeispiele • Voraussetzungen für Beweise • using … prove • Annahme von nichtbeweisbaren Eigenschaften • assume … •  Fairness-Bedingungen

  14. Weitere Sprachkonstrukte 1 • Alles syntaktische Abkürzungen • Komplexe Typen • Arrays • Mit beliebigem Typ, auch n-dimensional oder generisch • Index aufsteigend (0..7) oder absteigend (7..0) • Bsp: proc: array[0..1]; bits: array[7..0] of boolean; • Strukturierte Typen • Definition über Module • Ausnahme: Strukturen ohne Parameter • Bsp: hands : struct { left, right: boolean; };

  15. Weitere Sprachkonstrukte 2 • If Anweisung • if(<expr>) <stmt1> [ else <stmt2> ] • Statements analog zu C oder Java • Bsp: if (test) a = 1; else b = 1; • Default Regeln • Zustand des modellierten Systems entspricht Belegung der Zustandsvariablen • Semantik undefinierter Zustandsvariablen? • Defaults bestimmen Werte für undefinierte Variablen • Explizite Regeln definierbar • default <stmt1> in <stmt2>

  16. Weitere Sprachkonstrukte 3 • Case und Switch Anweisung • Syntactic Sugar für if-else-Kaskaden • Schleifen • Sogenannte Konstruktor Loops • werden zur Compilezeit ausgewertet und komplett ausgerollt

  17. Fortgeschrittene Modellierung • Modellierung in Schichten • Bessere Abstraktion möglich • Ausnutzen von Symmetrien • Verifikation von “Repräsentanten” • Anlehnung an Induktionsbeweise • Bewertung • Mächtige Konzepte • Fehlerträchtige Modellierung wegen Komplexität

  18. Beispiel Mutex MODULE proc(state, otherState) { output state: stateSet; input otherState: stateSet; init(state) := noncritical; case { (state = noncritical) : next(state) := {trying, noncritical}; (state = trying) & (otherState = noncritical) : next(state) := critical; (state = trying) & (otherState = trying) : next(state) := critical; (state = critical) : next(state) := {critical, noncritical}; default: next(state) := state; }; }

  19. Beispiel Mutex typedef stateSet {noncritical, trying, critical}; MODULE main() { proc: array 0..1; for(i=0; i<2; i = i+1) proc[i] : process proc(proc[(i+1) mod 2].otherState, proc[(i+1) mod 2].state); fairness: assert G F proc[0].running & G F proc[1].running; proc0_fair: assert G F ~(proc[0].state = critical); proc1_fair: assert G F ~(proc[1].state = critical); mutex_violation: assert G F ~((proc[0].state = critical) & (proc[1].state = critical)); using fairness, proc0_fair, proc1_fair prove mutex_violation; assume fairness, proc0_fair, proc1_fair; }

  20. Bewertung und Stellungnahme • Praxistauglich • Siehe Verifikation des FutureBus+ • Kommerzielle Tools verfügbar, deutet auf industriellen Einsatz hin • SMV scheint hardwarelastig zu sein • Interessante Technologie, aber • Theorie nicht leicht • Modellierung auch nicht leicht

More Related