Formale Systeme. Die Sprache PROMELA. Prof. Dr. Bernhard Beckert WS 2009/2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Ähnliche Dokumente
Formale Systeme. Prof. Dr. Bernhard Beckert. Winter 2008/2009. Fakultät für Informatik Universität Karlsruhe (TH)

Formale Systeme. LTL und Büchi-Automaten. Prof. Dr. Bernhard Beckert WS 2009/2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Formale Systeme. Endliche Automaten. Prof. Dr. Bernhard Beckert WS 2009/2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Model Checking mit SPIN

Formale Systeme. Lineare Temporale Logik. Prof. Dr. Bernhard Beckert WS 2009/2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Formale Systeme. Aussagenlogik: Syntax und Semantik. Prof. Dr. Bernhard Beckert WS 2010/2011 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Formale Systeme. Aussagenlogik: Sequenzenkalkül. Prof. Dr. Bernhard Beckert WS 2010/2011 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Formale Systeme. Prädikatenlogik 2. Stufe. Prof. Dr. Bernhard Beckert WS 2009/2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Formale Systeme. Prädikatenlogik: Tableaukalkül (ohne Gleichheit) Prof. Dr. Bernhard Beckert WS 2009/2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Formale Systeme. Büchi-Automaten. Prof. Dr. Bernhard Beckert WS 2009/2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Algorithmen II Vorlesung am

LTL und Spin. Stefan Radomski

Formale Systeme. Modallogik. Prof. Dr. Bernhard Beckert WS 2009/2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Einstieg in die Informatik mit Java

Formale Systeme. Binary Decision Diagrams. Prof. Dr. Bernhard Beckert WS 2010/2011 KIT INSTITUT FÜR THEORETISCHE INFORMATIK

Variablenarten. Gerd Bohlender. Institut für Angewandte und Numerische Mathematik. Vorlesung: Einstieg in die Informatik mit Java

Vorsemesterkurs Informatik

Formale Systeme. Endliche Automaten. Prof. Dr. Bernhard Beckert, WS 2015/ KIT I NSTITUT F U R T HEORETISCHE I NFORMATIK

Model Checking mit SPIN

Array-Zuweisungen. Array-Zuweisungen können über die Position, den Namen oder gemischt erfolgen.

Vorsemesterkurs Informatik

Klausur Formale Systeme Fakultät für Informatik WS 2015/2016

Formale Systeme Prof. Dr. Bernhard Beckert, WS 2016/2017

Einstieg in die Informatik mit Java

Grundlagen der Theoretischen Informatik / Einführung in die Theoretische Informatik I

Implementieren von Klassen

How To Prove A Propositional Logic

1. Einführung in Temporallogik CTL

2 Programmieren in Java I noch ohne Nachbearbeitung

Formale Systeme. Das Erfu llbarkeitsproblem. Prof. Dr. Bernhard Beckert, WS 2017/2018

Grundlagen der Programmierung in C Funktionen

Vorsemesterkurs Informatik

Formale Systeme. Aussagenlogik: Resolutionskalku l. Prof. Dr. Bernhard Beckert, WS 2018/2019

Formale Systeme. Aussagenlogik: Syntax und Semantik. Prof. Dr. Bernhard Beckert, WS 2017/2018

Institut für Programmierung und Reaktive Systeme 2. Februar Programmieren I. Übungsklausur

Dank. Grundlagen der Theoretischen Informatik / Einführung in die Theoretische Informatik I. Reguläre Ausdrücke als Suchmuster für grep

Grundlagen der Theoretischen Informatik / Einführung in die Theoretische Informatik I

1. Motivation. Modelchecking. NuSMV. NuSMV und SMV. 2. Modellierung. Erinnerung (Kapitel II)

Theoretische Informatik II

Wahlalgorithmen auf beliebigen Netzstrukturen. Verteilte Algorithmen (VA), WS 2003/04 43

Logik für Informatiker

Model Checking I. Lehrstuhl für Software Engineering Friedrich-Alexander-Universität Erlangen-Nürnberg

Endlicher Automat (EA)

Technische Universität Braunschweig Institut für Programmierung und Reaktive Systeme

Formale Systeme. Aussagenlogik: Syntax und Semantik. Prof. Dr. Bernhard Beckert, WS 2015/2016.

Formale Systeme. Wiederholung. Prof. Dr. Bernhard Beckert, WS 2017/ KIT Die Forschungsuniversita t in der Helmholtz-Gemeinschaft

XML Schema 2012/2013 S Seite 1 h_da W

1 Programmiersprachen 1.1 1

5. Algorithmen. K. Bothe, Institut für Informatik, HU Berlin, GdP, WS 2015/16

Deductive Software Verification The KeY Book Haupt- und Proseminar in SoSe 2017

Automaten und Formale Sprachen alias Theoretische Informatik. Sommersemester 2012

VHDL Grundelemente. Dr.-Ing. Matthias Sand. Lehrstuhl für Informatik 3 (Rechnerarchitektur) Friedrich-Alexander-Universität Erlangen-Nürnberg

Betriebssysteme. G: Parallele Prozesse. (Teil B: Klassische Problemstellungen, Mutual Exclusion, kritische Regionen)

Korrektheit und Hoare-Kalkül für Imperative Programme

Theoretische Informatik II. WS 2007/2008 Jun.-Prof. Dr. Bernhard Beckert Ulrich Koch. 1. Teilklausur Vorname:... Nachname:...

Rechnungen, wo kein sinnvoller Wert rauskommt Bsp.: 1/0, *0, sqrt(-1.0) Beispiel: Quadratische Gleichungen

Formale Systeme. Modallogik. Prof. Dr. Bernhard Beckert, WS 2016/ KIT Die Forschungsuniversita t in der Helmholtz-Gemeinschaft

Institut für Programmierung und Reaktive Systeme 25. Januar Programmieren I. Übungsklausur

Exponentialfunktionen. Eigenschaften, graphische Darstellungen 1-E1 Vorkurs, Mathematik

Model.Checking Theorie Praxis

- Theorie der uninterpretierten

RO-Tutorien 3 / 6 / 12

Lösungsvorschläge und Erläuterungen Klausur zur Vorlesung Grundbegriffe der Informatik 15. September 2016

Herzlich willkommen!

Learning Object-Oriented Programming. Algorithmen. Algorithmusbegriff. Klärung der Herkunft des Begriffs Formale Definition von Algorithmus

Das SAT Problem oder Erfüllbarkeitsproblem. Formale Systeme. Teilklassen. Satz von Cook. SAT Instanz: Eine aussagenlogische Formel F For 0

Anwendungsorientierte Formale Verifikation

3. Klausur Einführung in die Theoretische Informatik Seite 1 von 14

Grundbegriffe der Informatik Tutorium 11

Theoretische Grundlagen der Informatik

Algorithmik und Programmieren

Java Ablaufsteuerung (Beispiele)

Einstieg in die Informatik mit Java

Grundbegriffe der Informatik Tutorium 11

CS1005 Objektorientierte Programmierung Bachelor of Science (Informatik)

Formale Systeme, WS 2014/2015 Übungsblatt 5

Grundbegriffe der Informatik Tutorium 3

Grammatiken und ANTLR

Kapitel Was ist ein Header? Was ist ein Body? Header: public Account(String newowner, int newpin)

javascript Coding-Guidelines 2. Ausgabe Februar 2015 Der Guideline beschreibt den verwendeten Coding-Stil von javascript als eigene Richtline.

Klassen als Datenstrukturen

Informatik I Übung, Woche 40

Einführung in die Theoretische Informatik

Beispiele: Funktionsabstraktion (3) Funktionsdeklaration. Funktionsdeklaration (2) Funktionsdeklaration (3) 3. Abstraktion über Funktionsbezeichner:

Theoretische Informatik SS 03 Übung 5

Analyse von Echtzeit-Systemen mit Uppaal. Dr. Carsten Weise Ericsson Deutschland GmbH

Roboterprogrammierung

Grundbegriffe der Informatik Tutorium 10

Kapitel 4: Anweisungen und Kontrollstrukturen

Induktion und Rekursion

Programmiersprachen Einführung in C

Prüfung Informatik D-MATH/D-PHYS :00 11:00

Einstieg in die Informatik mit Java

Formale Systeme. Modallogik. Prof. Dr. Bernhard Beckert, WS 2017/ in der Helmholtz-Gemeinschaft KIT I NSTITUT F UR

Prof. Dr. Wolfgang Schramm. Vorlesung. Techniken der Programmentwicklung. Exkurs: Anonyme Klassen

Transkript:

Formale Systeme Prof. Dr. Bernhard Beckert WS 29/2 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State of Baden-Württemberg and National Large-scale Research Center of the Helmholtz Association

Beschreibung endlicher Automaten Die Darstellung konkreter endlicher Automaten in graphischer Form ist nur für kleine Automaten möglich, für größere, wie sie in realistischen Anwendungen auftreten, ist das nicht praktikabel. Wir betrachten als eine Alternative die Modellierungssprache Promela. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 2/9

Beschreibung endlicher Automaten Die Darstellung konkreter endlicher Automaten in graphischer Form ist nur für kleine Automaten möglich, für größere, wie sie in realistischen Anwendungen auftreten, ist das nicht praktikabel. Wir betrachten als eine Alternative die Modellierungssprache Promela. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 2/9

Promela Process meta language Modellierungssprache für indeterministische gekoppelte erweiterte endliche Automaten. Entwickelt von Gerard Holzmann seit 98. Weit verbreitetes Verifikationswerkzeug SPIN (Simple Promela INterpreter) Angabe der zu verifizierenden Eigenschaft als LTL Formel oder Büchi-Automat. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 3/9

Promela Process meta language Modellierungssprache für indeterministische gekoppelte erweiterte endliche Automaten. Entwickelt von Gerard Holzmann seit 98. Weit verbreitetes Verifikationswerkzeug SPIN (Simple Promela INterpreter) Angabe der zu verifizierenden Eigenschaft als LTL Formel oder Büchi-Automat. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 3/9

Promela Process meta language Modellierungssprache für indeterministische gekoppelte erweiterte endliche Automaten. Entwickelt von Gerard Holzmann seit 98. Weit verbreitetes Verifikationswerkzeug SPIN (Simple Promela INterpreter) Angabe der zu verifizierenden Eigenschaft als LTL Formel oder Büchi-Automat. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 3/9

Promela Process meta language Modellierungssprache für indeterministische gekoppelte erweiterte endliche Automaten. Entwickelt von Gerard Holzmann seit 98. Weit verbreitetes Verifikationswerkzeug SPIN (Simple Promela INterpreter) Angabe der zu verifizierenden Eigenschaft als LTL Formel oder Büchi-Automat. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 3/9

Promela Process meta language Modellierungssprache für indeterministische gekoppelte erweiterte endliche Automaten. Entwickelt von Gerard Holzmann seit 98. Weit verbreitetes Verifikationswerkzeug SPIN (Simple Promela INterpreter) Angabe der zu verifizierenden Eigenschaft als LTL Formel oder Büchi-Automat. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 3/9

/* Peterson: mutual exclusion [98] */ bool turn, flag[2]; byte ncrit; { assert(_pid == _pid == ); again: flag[_pid] = ; turn = _pid; (flag[ - _pid] == turn == - _pid); assert(ncrit == ); /* critical section */ flag[_pid] = ; goto again} Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 5/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } Promela beschreibt Zustandsübergangssysteme durch die Definition von Prozesstypen (process types). Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } In diesem Beispiel wird der Prozesstyp user() deklariert. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } Die Deklaration eines Prozesstyps bewirkt noch nichts. Erst mit der Erzeugung einer Instanz eines Prozesstypes sind Aktionen verbunden. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } Instanzen eines Prozesstyps werden normalerweise in einem Initialisierungprozess erzeugt, z.b. init { run users(); }. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } active [2] ist eine Abkürzung für init { run users(); run users(); }. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } Prozesse werden in der Reihenfolge ihrer Aktivierung durchnumeriert. Auf diese Nummer kann mit der lokalen Variablen pid zugegriffen werden. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

bool turn, flag[2]; byte ncrit; { assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } Globale Variablen, im Beispiel turn, flag[2], ncrit, können von jedem Prozess gelesen und beschrieben werden. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } In Promela ist jeder Ausdruck auch ein Befehl. Ergibt die Auswertung den Wahrheitswert wahr oder einen Wert >, dann geht die Ausführung mit der nächsten Anweisung weiter. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } Andernfalls bleibt der Prozess blockiert bis der Ausdruck durch Aktionen anderer Prozesse wahr wird. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

{ assert( pid == pid == ); again: flag[ pid] = ; turn = pid; (flag[ - pid] == turn == - pid); assert(ncrit == ); /* critical section */ flag[ pid] = ; goto again } Falls das Argument des assert Befehls wahr ist geht die Ausführung mit der nächsten Zeile weiter, anderenfalls wird ein Fehler berichtet und die Simulation oder Verifikation abgebrochen. Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 6/9

Generischer Automat zum user Prozess line 8 assert((( pid == ) ( pid == ))) line flag[ pid]= line 8 flag[ pid] = line ncrit = (ncrit - ) turn = pid line 2 line 6 ((flag[- pid]==) (turn == (- pid))) assert(ncrit == ) line 4 ncrit = (ncrit+) line 5 Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 7/9

Instanzen des generischen Automaten line 8 line 8 assert((( pid == ) ( pid == ))) assert((( pid == ) ( pid == ))) line flag[]= line 8 line flag[]= line 8 flag[] = flag[] = line ncrit = (ncrit - ) line ncrit = (ncrit - ) turn = turn = line 2 line 6 line 2 line 6 ((flag[]==) (turn == ())) assert(ncrit == ) ((flag[]==) (turn == ))) assert(ncrit == ) line 4 ncrit = (ncrit+) line 5 line 4 ncrit = (ncrit+) line 5 Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 8/9

Approximation Produktautomat 2 2 4 2 2 4 5 4 2 2 2 2 4 5 6 5 4 2 2 4 6 5 8 6 5 2 2 5 6 8 8 6 2 2 6 8 8 2 2 8 2 2 Prof. Dr. Bernhard Beckert Formale Systeme WS 29/2 9/9