CIS 4930/6930: Principles of Cyber-Physical Systems
|
|
- Melissa Moody
- 6 years ago
- Views:
Transcription
1 CIS 4930/6930: Principles of Cyber-Physical Systems Homework Solutions Hao Zheng Department of Computer Science and Engineering University of South Florida H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 1 / 44
2 HW 2 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 2 / 44
3 HW 2: Chapter 3, Problem 2 temp 20/heaton Cooling Heating true/ temp > 20/heatoff wait3 wait1 true/ wait2 true/ H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 3 / 44
4 HW 2: Chapter 3, Problem 2 input: temp, clk : R outputs: heaton, heatoff: pure temp 20 clk > 120/heaton, clk := 0 clk := 121 Cooling Heating temp > 20 clk > 30/heatoff, clk := 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 4 / 44
5 HW 2: Chapter 3, Problem 5 X /1 X /0 X /0 A B C Problem 5: b x = (p, p, p, p, p,...), y = (0, 1, 1, 0, a,...) Yes c x = (a, p, a, p, a,...), y = (a, 1, a, 0, a,...) No d x = (p, p, p, p, p,...), y = (0, 0, a, a, a,...) Yes e x = (p, p, p, p, p,...), y = (0, a, 0, a, a,...) No H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 5 / 44
6 HW 2: Chapter 3, Problem 5 X /1 X /0 X /0 A B C Problem 5: a x = (p, p, p, p, p,...), y = (0, 1, 1, 0, 0,...) No b x = (p, p, p, p, p,...), y = (0, 1, 1, 0, a,...) Yes c x = (a, p, a, p, a,...), y = (a, 1, a, 0, a,...) No d x = (p, p, p, p, p,...), y = (0, 0, a, a, a,...) Yes e x = (p, p, p, p, p,...), y = (0, a, 0, a, a,...) No H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 5 / 44
7 HW 2: Problem 3 Traffic sigr, sigy, sigg Pedestrian Pedestrian H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 6 / 44
8 HW 2: Problem 3 count 60/SigG, count := 0 (green, none) count := count + 1 red, crossing count := 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 7 / 44
9 HW 2: Problem 3 count < 60/count := count + 1 (green, none) count < 60/count := count + 1 count 60/sigY, count := 0 (pending, waiting) (yellow, waiting) H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 8 / 44
10 HW 2: Problem 3 (pending, waiting) count := count + 1 (yellow, waiting) count 60/sigY, count := 0 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 9 / 44
11 HW 2: Problem 3 red, crossing count := 0 count 5/count := 0 (yellow, waiting) count := count + 1 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 10 / 44
12 HW 2: Problem 3 count < 60/count := count + 1 count 60/SigG, count := 0 (green, none) count < 60/count := count + 1 count := count + 1 red, crossing count 60/sigY, count := 0 (pending, waiting) count := count + 1 count := 0 count 5/sigR, count := 0 (yellow, waiting) count 60/sigY, count := 0 count := count + 1 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 11 / 44
13 HW 3: Pointers and Hints H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 12 / 44
14 HW 3, Problem 1 mtype = {sigr, sigy, sigg}; chan signal = [0] of {mtype}; chan ped = [0] of {bit}; H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 13 / 44
15 HW 3, Problem 1 active proctype traffic() {... Green: if /* Not allowed by SPIN */ :: ped?1 && count < 60 ->...; goto Pending; :: ped?1 && count >= 60 ->...; goto Yellow; :: count < 60 ->...; goto Green; H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 14 / 44
16 HW 3, Problem 1 active proctype traffic() {... Green: ped?pedbit; /* Lead to invalid end state! */ if :: pedbit==1 && count < 60 ->...; goto Pending; :: pedbit==1 && count >= 60 ->...; goto Yellow; :: count < 60 -> count++; goto Green; H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 15 / 44
17 HW 3, Problem 1 /* Also lead to invalid end state! */ active proctype traffic() {... Green: if :: ped?1 -> count < 60 ->...; goto Pending; :: ped?1 -> count >= 60 ->...; goto Yellow; :: count < 60 ->...; goto Green;... H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 16 / 44
18 HW 3, Problem 1 /* Still lead to invalid end state! */ active proctype traffic() {... Green: if :: ped?1 -> if :: count < 60 -> count++; goto Pending; :: count >= 60 -> signal!sigy; count=0; goto Yellow; fi :: count < 60 ->...; goto Green;... H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 17 / 44
19 HW 3, Problem 1 /* Finally... */ active proctype traffic() {... Green: if :: ped?1 -> if :: count < 60 -> count++; goto Pending; :: count >= 60 -> count=0; goto Yellow; fi :: count < 60 ->...; goto Green;... H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 18 / 44
20 HW 3, Problem 1, Check Properties Property #1 Pedestrians are allowed to cross the street only when the traffic light is red, bool traffic_red = false; active proctype traffic() { Red:... traffic_red = false; goto Green;... Green:... Pending:... Yellow:... traffic_red = true; goto red... } active proctype traffic() {... } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 19 / 44
21 HW 3, Problem 1, Check Properties Property #1 Pedestrians are allowed to cross the street only when the traffic light is red, bool traffic_red = false; bool ped_cross = false; active proctype traffic() {... } active proctype pedestrian() { Crossing: signal?sigg -> ped_cross = false; goto None; None: ped!1 -> ped_cross = false; goto Waiting; Waiting: signal?sigr -> ped_cross = true; goto Crossin } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 20 / 44
22 HW 3, Problem 1, Check Properties Property #1 Pedestrians are allowed to cross the street only when the traffic light is red, bool traffic_red = false; bool ped_cross = false; active proctype traffic() {... } active proctype pedestrian() {... } active proctype monitor() { /* Prop \#1 is checked */ assert( ped_cross -> traffic_red ); } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 21 / 44
23 HW 3: Post-Submission Discussioins H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 22 / 44
24 HW 3, Problem 1 mtype = {sigr, sigy, sigg}; chan signal = [0] of {mtype}; chan ped = [0] of {bit}; int count; bool traffic_red = true; /* The initial state of traffic light is bool ped_cross = true; /* The initial state of pedestrian light is c bool ped_pres = false; active proctype traffic() { red: if :: atomic { count >= 60 -> signal!sigg; count = 0; traffic_red = false; goto green; } :: atomic { else -> count++; traffic_red = true; goto red; } fi;... } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 23 / 44
25 HW 3, Problem 1, How SPIN Works? active proctype traffic() { red: if :: atomic { count >= 60 -> signal!sigg; count = 0; traffic_red = false; goto green; } :: atomic { else -> count++; traffic_red = true; goto red; } fi;... } active proctype pedestrian() { crossing: atomic { signal?sigg -> ped_pres = false; ped_cross = false; goto none; }... } active proctype monitor() { assert(!ped_cross traffic_red); } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 24 / 44
26 HW 3, Problem 1, How SPIN Works? active proctype traffic() { red: if :: atomic { count >= 60 -> signal!sigg; count = 0; traffic_red = false; goto green; } :: atomic { else -> count++; traffic_red = true; goto red; } fi;... } active proctype pedestrian() { crossing: atomic { signal?sigg -> ped_pres = false; ped_cross = false; goto none; }... } ltl prop1 { [](!ped_cross traffic_red) } ltl prop2 { [](ped_pres -> <> ped_cross) } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 25 / 44
27 HW 3, Problem 1, Another Version #define RED 1 #define YELLOW 2 #define GREEN 3 #define PENDING 4 #define CROSSING 5 #define NONE 6 #define WAITING 7 byte traffic_state = RED; byte ped_state = CROSSING; H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 26 / 44
28 HW 3, Problem 1, Another Version active proctype traffic() { do :: traffic_state==red -> if :: atomic { count >= 60 -> signal!green; count = 0; traffic_state = GREEN; } :: atomic { else -> count++; traffic_state = RED; } fi; :: traffic_state==green ->... :: traffic_state == PENDING ->... :: traffic_state == YELLOW ->... od } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 27 / 44
29 HW 3, Problem 1, Another Version active proctype pedestrian() { do :: ped_state == CROSSING -> atomic { signal?green -> ped_state = NONE; } :: ped_state == NONE -> atomic { ped!1 -> ped_state = WAITING; } :: ped_state == WAITING -> atomic { signal?red -> ped_state = CROSSING; } od } ltl prop1 { []((ped_state!= CROSSING) (traffic_state==red)) } ltl prop2 { [](ped_state == WAITING -> <> (ped_state == CROSSING)) } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 28 / 44
30 HW 4 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 29 / 44
31 Problem 1 true false: a x b x c x c... true true true false: b and c are different states. false: a x b x a x a x b x a x a... H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 30 / 44
32 Problem 2 (a) 1 i n Fp i (b) 1 i n Fp i (c) F(p 1 F(P 2 F(p 3...))) F(p 1 XF(P 2 XF(p 3...))) is the same as in (c). Why? H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 31 / 44
33 HW 5 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 32 / 44
34 Question 1 Exercises 1. Construct (on paper is sufficient) a timed automaton similar to that of Figure 4.7 which produces tick at times 1,2,3,5,6,7,8,10,11,. That is, ticks are produced with intervals between them of 1 second (three times) and 2 seconds (once). lution: The following hybrid system will do the job: H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 33 / 44
35 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS / 44 Question 1 Exercises 1. Construct (on paper is sufficient) a timed automaton similar to that of Figure 4.7 which produces tick at times 1,2,3,5,6,7,8,10,11,. That is, ticks are produced with intervals between them of 1 second (three times) and 2 seconds (once). 1. Construct (on paper is sufficient) a timed automaton similar to that of Figure 4.7 which produces tick at times 1,2,3,5,6,7,8,10,11,. That is, ticks are produced with intervals between them Solution: of 1The second following (three hybrid times) systemand will2 doseconds the job: (once). lution: The following hybrid system will do the job:
36 e objective Question of this problem 2(a) is to understand a timed automaton, and then to modify it as cified. ) For the timed automaton shown below, describe the output y. Avoid imprecise or sloppy notation. : The system generates a discrete signal with the event sequence (1,3,4,6,7,9,10, ) H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 34 / 44
37 Question 3 3. You have an analog source that produces a pure tone. You can switch the source on or off by the input event on or off. Construct a timed automaton that provides the on and off signals as outputs, to be connected to the inputs of the tone generator. Your system should behave as follows. Upon receiving an input event ring, it should produce an 80 ms-long sound consisting of three 20 ms-long bursts of the pure tone separated by two 10 ms intervals of silence. What does your system do if it receives two ring events that are 50 ms apart? lution: Assume the input alphabet is {ring, absent} and the output alphabet is {on, off, absent}. en the following timed automaton will control the source of the tone: tonecontroller g 1 / on s(t) := 0 g 2 / off s(t) := 0 c(t) {ring, absent} silent 1 tone 1 silent 2 v(t) {on, off, absent} H. Zheng (CSE g / off CIS 4930/6930: Principles of CPS g / on 35 / 44
38 Question 3 tone3 t 20 t = 10/on silent2 t 10 t = 20/off tone2 t 10 t = 20/off t = 10/on t := 0 l 0 ring/t := 0, on tone1 t 20 t = 20/off silent1 t 10 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 36 / 44
39 Question 5 e guards are given by g 1 = {(x(t),s(t)) x(t)=warn} g 2 = {(x(t),s(t)) x(t)=nowarn} g 3 = {(x(t),s(t)) s(t)=30 ^ x(t)=absent}. 5. A programmable thermostat allows you to select 4 times, 0 apple T 1 apple apple T 4 < 24 (for a 24-hour cycle) and the corresponding setpoint temperatures a 1,,a 4. Construct a timed automaton that sends the event a i to the heating systems controller. The controller maintains the temperature close to the value a i until it receives the next event. How many timers and modes do you need? & Seshia, Introduction to Embedded Systems, Solutions 27 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 37 / 44
40 Question 5 l 2 t t 3 t = T 2 /a 2 l 1 t T 2 t = T 3 /a 3 t = T 1 /a 1 l 3 t T 4 l 0 t T 1 t := 0 t = T 4 /a 4 t = 24h/t := 0 l 3 t 24h H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 38 / 44
41 HW 7 H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 39 / 44
42 Water Tank H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 40 / 44
43 Water Tank Trajectory SOLUTIONS level Tank Levels tank1 tank time The model exhibits Zeno behavior because the net outflow is the net inflow of Thus, no matter how we switch the inflow bet water in both tanks past time 4.0. The hybrid system is designed to becomes empty, and the time between these events gets infinitely sma H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 41 / 44
44 Problem P2 To show that concurrent access to a list may corrupt the data structure. Modeling a linked list? next listener next listener next listener next listener Use arrays in Promela. bool next[4]; bool listener[4]; int tail = -1; int head = -1; H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 42 / 44
45 Problem P2 proctype addlistener() { if :: head==-1 -> head = 0; next[head]=true; listener[head] = true; tail = head; :: else -> tail = tail+1; next[tail] = true; listener[tail] = true; fi } H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 43 / 44
46 Problem P2 init { next[0] = false; next[1] = false; next[2] = false; next[3] = false; listener[0] = false; listener[1] = false; listener[2] = false; listener[3] = false; atomic { run addlistener(); run addlistener(); run addlistener(); run addlistener(); }; } (_nr_pr==1) -> assert(listener[0] &&... && listener[3]); H. Zheng (CSE USF) CIS 4930/6930: Principles of CPS 44 / 44
Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology
The Spin Model Checker : Part I Copyright 2008 CS655 System Korea Advanced Institute of Science and Technology System Spec. In Promela Req. Spec. In LTL Overview of the Spin Architecture Spin Model pan.c
More informationA Tutorial on Model Checker SPIN
A Tutorial on Model Checker SPIN Instructor: Hao Zheng Department of Computer Science and Engineering University of South Florida Tampa, FL 33620 Email: haozheng@usf.edu Phone: (813)974-4757 Fax: (813)974-5456
More informationComputer Lab 1: Model Checking and Logic Synthesis using Spin (lab)
Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab) Richard M. Murray Nok Wongpiromsarn Ufuk Topcu Calornia Institute of Technology AFRL, 25 April 2012 Outline Spin model checker: modeling
More informationComputer Aided Verification 2015 The SPIN model checker
Computer Aided Verification 2015 The SPIN model checker Grigory Fedyukovich Universita della Svizzera Italiana March 11, 2015 Material borrowed from Roberto Bruttomesso Outline 1 Introduction 2 PROcess
More informationFormal Specification and Verification
Formal Specification and Verification Introduction to Promela Bernhard Beckert Based on a lecture by Wolfgang Ahrendt and Reiner Hähnle at Chalmers University, Göteborg Formal Specification and Verification:
More information4/6/2011. Model Checking. Encoding test specifications. Model Checking. Encoding test specifications. Model Checking CS 4271
Mel Checking LTL Property System Mel Mel Checking CS 4271 Mel Checking OR Abhik Roychoudhury http://www.comp.nus.edu.sg/~abhik Yes No, with Counter-example trace 2 Recap: Mel Checking for mel-based testing
More informationTool demonstration: Spin
Tool demonstration: Spin 1 Spin Spin is a model checker which implements the LTL model-checking procedure described previously (and much more besides). Developed by Gerard Holzmann of Bell Labs Has won
More informationSpin: Overview of PROMELA
Spin: Overview of PROMELA Patrick Trentin patrick.trentin@unitn.it http://disi.unitn.it/trentin Formal Methods Lab Class, March 10, 2017 These slides are derived from those by Stefano Tonetta, Alberto
More informationSoftware Engineering using Formal Methods
Software Engineering using Formal Methods Introduction to Promela Wolfgang Ahrendt & Richard Bubel & Reiner Hähnle & Wojciech Mostowski 31 August 2011 SEFM: Promela /GU 110831 1 / 35 Towards Model Checking
More informationDesign and Analysis of Distributed Interacting Systems
Design and Analysis of Distributed Interacting Systems Lecture 5 Linear Temporal Logic (cont.) Prof. Dr. Joel Greenyer May 2, 2013 (Last Time:) LTL Semantics (Informally) LTL Formulae are interpreted on
More informationCS477 Formal Software Development Methods / 39
CS477 Formal Software Development Methods 2112 SC, UIUC egunter@illinois.edu http://courses.engr.illinois.edu/cs477 SPIN Beginners Tutorial April 11, 2018 Hello World /* A "Hello World" Promela model for
More information(c) Does this model thermostat have the time-scale invariance property?
3. DISCRETE DYNAMICS 2. Consider a variant of the thermostat of example 3.5. In this variant, there is only one temperature threshold, and to avoid chattering the thermostat simply leaves the heat on or
More informationSoftware Engineering using Formal Methods
Software Engineering using Formal Methods Introduction to Promela Wolfgang Ahrendt 03 September 2015 SEFM: Promela /GU 150903 1 / 36 Towards Model Checking System Model Promela Program byte n = 0; active
More informationThe Spin Model Checker : Part I/II
The Spin Model Checker : Part I/II Moonzoo Kim CS Dept. KAIST Korea Advanced Institute of Science and Technology Motivation: Tragic Accidents Caused by SW Bugs 2 Cost of Software Errors June 2002 Software
More informationTHE MODEL CHECKER SPIN
THE MODEL CHECKER SPIN Shin Hong, KAIST 17 th April,2007 1/33 Contents Introduction PROMELA Linear Temporal Logic Automata-theoretic software verification Example : Simple Elevator 2 SPIN is a software
More informationLecture 3 SPIN and Promela
Lecture 3 SPIN and Promela 1 What is SPIN(Simple Promela INterpreter) A tool for analyzing mels of concurrent systems Mels described in Promela Language with concurrent processes Communication via shared
More informationNetwork Protocol Design and Evaluation
Network Protocol Design and Evaluation 05 - Validation, Part I Stefan Rührup Summer 2009 Overview In the last lectures: Specification of protocols and data/message formats In this chapter: Building a validation
More informationSpin: Overview of PROMELA
Spin: Overview of PROMELA Patrick Trentin patrick.trentin@unitn.it http://disi.unitn.it/~trentin Formal Methods Lab Class, Mar 04, 2016 These slides are derived from those by Stefano Tonetta, Alberto Griggio,
More informationAutomated Reasoning. Model Checking with SPIN (II)
Automated Reasoning Model Checking with SPIN (II) Alan Bundy page 1 Verifying Global Properties Assertions can be used to verify a property locally For example, place assert(memreturned) at the end of
More informationComputer Lab 1: Model Checking and Logic Synthesis using Spin (lab)
Computer Lab 1: Model Checking and Logic Synthesis using Spin (lab) Richard M. Murray Nok Wongpiromsarn Ufuk Topcu California Institute of Technology EECI 19 Mar 2013 Outline Spin model checker: modeling
More informationThe Spin Model Checker : Part I. Moonzoo Kim KAIST
The Spin Model Checker : Part I Moonzoo Kim KAIST Hierarchy of SW Coverage Criteria Complete Value Coverage CVC (SW) Model checking Complete Path Coverage CPC Concolic testing All-DU-Paths Coverage ADUP
More informationApplications of Formal Verification
Applications of Formal Verification Model Checking: Introduction to PROMELA Bernhard Beckert Mattias Ulbrich SS 2017 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State of Baden-Württemberg
More informationCS477 Formal Software Development Methods / 32
CS477 Formal Software Development Methods 2112 SC, UIUC egunter@illinois.edu http://courses.engr.illinois.edu/cs477 SPIN Beginners Tutorial April 13, 2018 Assertion Violation: mutextwrong1.pml bit flag;
More informationApplications of Formal Verification
Applications of Formal Verification Model Checking: Introduction to PROMELA Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov SS 2012 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State
More informationApplications of Formal Verification
Applications of Formal Verification Model Checking: Introduction to PROMELA Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov SS 2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State
More informationDistributed Systems Programming (F21DS1) SPIN: Formal Analysis II
Distributed Systems Programming (F21DS1) SPIN: Formal Analysis II Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview Introduce
More informationSPIN: Part /614 Bug Catching: Automated Program Verification. Sagar Chaki November 12, Carnegie Mellon University
SPIN: Part 1 15-414/614 Bug Catching: Automated Program Verification Sagar Chaki November 12, 2012 What is This All About? Spin On-the-fly verifier developed at Bell-labs by Gerard Holzmann and others
More informationT Parallel and Distributed Systems (4 ECTS)
T 79.4301 Parallel and Distributed Systems (4 ECTS) T 79.4301 Rinnakkaiset ja hajautetut järjestelmät (4 op) Lecture 3 4th of February 2008 Keijo Heljanko Keijo.Heljanko@tkk.fi T 79.4301 Parallel and Distributed
More informationThe SPIN Model Checker
The SPIN Model Checker Metodi di Verifica del Software Andrea Corradini Lezione 1 2013 Slides liberamente adattate da Logic Model Checking, per gentile concessione di Gerard J. Holzmann http://spinroot.com/spin/doc/course/
More informationConcurrent processes. Processes and Threads. Processes and threads. Going back to Concurrency. Modelling Processes. Modeling processes
Processes and Threads Abhik Roychoudhury CS 3211 National University of Singapore Modified from Kramer and Magee s lecture notes. Reading material: Chapter 2 of Textbook. Concurrent processes We structure
More informationDistributed Systems Programming (F21DS1) SPIN: Formal Analysis I
Distributed Systems Programming (F21DS1) SPIN: Formal Analysis I Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview Introduce
More informationTRIAL EXAM C Software Engineering using Formal Methods TDA293 / DIT270
TRIAL EXAM C Software Engineering using Formal Methods TDA293 / DIT270 also serving as additional training material for the course Formal Methods for Software Development, TDA294/DIT271 1 Exam/Tenta SEFM
More informationSPIN: Introduction and Examples
SPIN: Introduction and Examples Alessandra Giordani agiordani@disi.unitn.it http://disi.unitn.it/~agiordani Formal Methods Lab Class, September 28, 2014 *These slides are derived from those by Stefano
More informationThe SPIN Model Checker
The SPIN Model Checker Metodi di Verifica del Software Andrea Corradini GianLuigi Ferrari Lezione 3 2011 Slides per gentile concessione di Gerard J. Holzmann 2 the do-statement do :: guard 1 -> stmnt 1.1
More informationModel Requirements and JAVA Programs MVP 2 1
Model Requirements and JAVA Programs MVP 2 1 Traditional Software The Waterfall Model Problem Area Development Analysis REVIEWS Design Implementation Costly wrt time and money. Errors are found too late
More informationMulti-Threaded System int x, y, r; int *p, *q, *z; int **a; EEC 421/521: Software Engineering. Thread Interleaving SPIN. Model Checking using SPIN
EEC 421/521: Software Engineering Model Checking using SPIN 4/29/08 EEC 421/521: Software Engineering 1 Multi-Threaded System int x, y, r; int *p, *q, *z; int **a; thread_1(void) /* initialize p, q, and
More informationMP 6 Modeling in Promela and SPIN
MP 6 Modeling in Promela and SPIN CS 477 Spring 2018 Revision 1.0 Assigned April 23, 2018 Due May 2, 2018, 9:00 PM Extension 48 hours (penalty 20% of total points possible) 1 Change Log 1.0 Initial Release.
More informationSPIN part 2. Verification with LTL. Jaime Ramos. Departamento de Matemática, Técnico, ULisboa
SPIN part 2 Verification with LTL Jaime Ramos Departamento de Matemática, Técnico, ULisboa Borrowed from slides by David Henriques, Técnico, ULisboa LTL model checking How Spin works Checks non-empty intersection
More informationPatrick Trentin Formal Methods Lab Class, March 03, 2017
Spin: Introduction Patrick Trentin patrick.trentin@unitn.it http://disi.unitn.it/trentin Formal Methods Lab Class, March 03, 2017 These slides are derived from those by Stefano Tonetta, Alberto Griggio,
More informationDistributed Systems Programming F29NM1 2. Promela I. Andrew Ireland. School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh
Distributed Systems Programming F29NM1 Promela I Andrew Ireland School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Distributed Systems Programming F29NM1 2 Overview Basic building
More informationPatrick Trentin Formal Methods Lab Class, Feb 26, 2016
Spin: Introduction Patrick Trentin patrick.trentin@unitn.it http://disi.unitn.it/~trentin Formal Methods Lab Class, Feb 26, 2016 These slides are derived from those by Stefano Tonetta, Alberto Griggio,
More informationFormal Verification by Model Checking
Formal Verication by Model Checking Jonathan Aldrich Carnegie Mellon University Based on slides developed by Natasha Sharygina 17-654/17-754: Analysis of Software Artacts Spring 2006 1 CTL Model Checking
More informationSWEN-220 Mathematical Models of Software. Concurrency in SPIN Interleaving
SWEN-220 Mathematical Models of Software Concurrency in SPIN Interleaving 1 Topics Interleaving Process Interference Race Conditions Atomicity 2 Concurrency Concurrency can come in many flavors Concurrent
More informationModel checking Timber program. Paweł Pietrzak
Model checking Timber program Paweł Pietrzak 1 Outline Background on model checking (spam?) The SPIN model checker An exercise in SPIN - model checking Timber Deriving finite models from Timber programs
More informationWhat is SPIN(Simple Promela Interpreter) Elements of Promela. Material About SPIN. Basic Variables and Types. Typical Structure of Promela Model
What is SPIN(Simple Promela Interpreter) Lecture XX SPIN and Promela A tool for analyzing mels of reactive systems Mels described in Promela Language with concurrent processes, Communication via channels,
More informationComposition of State Machines
Chapter 5 Composition of State Machines Hongwei Zhang http://www.cs.wayne.edu/~hzhang/ Ack.: this lecture is prepared in part based on slides of Lee, Sangiovanni-Vincentelli, Seshia. Outline Concurrent
More informationMapping of UML Diagrams to Extended Petri Nets for Formal Verification
Grand Valley State University ScholarWorks@GVSU Masters Theses Graduate Research and Creative Practice 8-2013 Mapping of UML Diagrams to Exted Petri Nets for Formal Verification Byron DeVries Grand Valley
More informationWhat is SPIN(Simple Promela Interpreter) Material About SPIN. Elements of Promela. Basic Variables and Types. Typical Structure of Promela Model
What is SPIN(Simple Promela Interpreter) Lecture 3 SPIN and Promela A tool for analyzing mels of reactive systems Mels described in Promela Language with concurrent processes, Communication via channels,
More informationDistributed Systems Programming (F21DS1) SPIN: Simple Promela INterpreter
Distributed Systems Programming (F21DS1) SPIN: Simple Promela INterpreter Andrew Ireland Department of Computer Science School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Overview
More informationDesign of Internet Protocols:
CSCI 234 Design of Internet Protocols: George Blankenship George Blankenship 1 Outline Verication and Validation History and motivation Spin Promela language Promela model George Blankenship 2 Verication
More informationIntroduction to Embedded Systems
Introduction to Embedded Systems Sanjit A. Seshia UC Berkeley EECS 149/249A Fall 2015 2008-2015: E. A. Lee, A. L. Sangiovanni-Vincentelli, S. A. Seshia. All rights reserved. Chapter 3: Discrete Dynamics,
More informationINF5140: Specification and Verification of Parallel Systems
INF5140: Specification and Verification of Parallel Systems Lecture 09 Defining Correctness Claims Gerar Schneider Department of Informatics University of Oslo INF5140, Spring 2007 Gerar Schneider (Ifi,
More informationFORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY
FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY Pamela Zave AT&T Laboratories Research Florham Park, New Jersey, USA
More informationNetwork Protocol Design and Evaluation
Network Protocol Design and Evaluation 05 - Validation, Part III Stefan Rührup Summer 2009 Overview In the first parts of this chapter: Validation models in Promela Defining and checking correctness claims
More informationLogic Model Checking
Logic Model Checking Lecture Notes 14:18 Caltech 118 January-March 2006 Course Text: The Spin Model Checker: Primer and Reference Manual Addison-Wesley 2003, ISBN 0-321-22862-6, 608 pgs. Logic Model Checking
More informationTRIAL-EXAM Software Engineering using Formal Methods TDA293 (TDA292) / DIT270. Only dictionaries may be used. Other aids are not allowed!
TRIAL-EXAM Software Engineering using Formal Methods TDA293 (TDA292) / DIT270 Extra aid: Only dictionaries may be used. Other aids are not allowed! Please observe the following: This exam has 14 numbered
More informationSPIN. Carla Ferreira.
SPIN Carla Ferreira http://www.spinroot.com/spin/man/intro.html Introduction PROMELA (PROcess MEta LAnguage) is the input language of SPIN (Simple Promela Interpreter) Inspired by: C and CSP Describes
More informationLecture 2: Architectural Support for OSes
Lecture 2: Architectural Support for OSes CSE 120: Principles of Operating Systems Alex C. Snoeren HW 1 Due Tuesday 10/03 Why Architecture? Operating systems mediate between applications and the physical
More information5.1. Unit 5. State Machines
5.1 Unit 5 State Machines 5.2 What is state? You see a DPS officer approaching you. Are you happy? It's late at night and your car broke down. It's late at night and you've been partying a little too hard.
More informationModelling Without a Modelling Language
Modelling Without a Modelling Language Antti Valmari & Vesa Lappalainen University of Jyväskylä 1 Introduction 2 Quick Comparison to Promela 3 Demand-Driven Token Ring 4 Simple Transition Classes 5 Faster
More informationLinear Temporal Logic. Model Checking and. Based on slides developed by Natasha Sharygina. Carnegie Mellon University.
Model Checking and Linear Temporal Logic Jonathan Aldrich Carnegie Mellon University Based on slides developed by Natasha Sharygina 17-654: Analysis of Software Artifacts 1 Formal Verification by Model
More informationUse of the application program. Table of Contents. GAMMA instabus Application program description. April B0 CO Room Control Unit
Use of the application program Product family: Product type: Manufacturer: Displays Display and operating units Siemens AG Name Room control unit UP 227 DELTA i-system Order no.: Table of Contents 5WG1
More informationME 142 Engineering Computation I. Condition Statements
ME 142 Engineering Computation I Condition Statements Key Concepts Relational Operators Logical Operators If-Then-Else Statement GoTo Statement Worksheetfunction.xxx Organization/Name Changes Programming
More informationAK-SM 720 Boolean logic REFRIGERATION AND AIR CONDITIONING. User guide
AK-SM 720 Boolean logic REFRIGERATION AND AIR CONDITIONING User guide Application The function is contained in System manager type AK-SM 720 and can be used for user-defined functions. The functions can
More informationModel-Checking Concurrent Systems. The Model Checker Spin. The Model Checker Spin. Wolfgang Schreiner
Model-Checking Concurrent Systems Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at 1.
More informationFormal Methods for Software Development
Formal Methods for Software Development Model Checking with Temporal Logic Wolfgang Ahrendt 21st September 2018 FMSD: Model Checking with Temporal Logic /GU 180921 1 / 37 Model Checking Check whether a
More informationSPIN, PETERSON AND BAKERY LOCKS
Concurrent Programs reasoning about their execution proving correctness start by considering execution sequences CS4021/4521 2018 jones@scss.tcd.ie School of Computer Science and Statistics, Trinity College
More informationINF672 Protocol Safety and Verification. Karthik Bhargavan Xavier Rival Thomas Clausen
INF672 Protocol Safety and Verication Karthik Bhargavan Xavier Rival Thomas Clausen 1 Course Outline Lecture 1 [Today, Sep 15] Introduction, Motivating Examples Lectures 2-4 [Sep 22,29, Oct 6] Network
More informationModel-Checking Concurrent Systems
Model-Checking Concurrent Systems Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at Wolfgang
More informationLV-S4 SERIAL FUNCTIONAL SPECIFICATION
LV-S4 SERIAL FUNCTIONAL SPECIFICATION History of Modification Rev. Contents Date Note New Document 2005.03.01 SERIAL FUNCTIONAL SPECIFICATION Page 1 of 18 - CONTENT - 1. Overview... 3 2. Interface Specification...
More informationHello World. Slides mostly a reproduction of Theo C. Ruys SPIN Beginners Tutorial April 23, Hello() print "Hello"
Hello World CS477 Formal Software Development Methods 11 SC, UIUC egunter@illinois.edu http://courses.engr.illinois.edu/cs477 inners April 3, 014 /* A "Hello World" Promela model for SPIN. */ active Hello()
More informationTemporal Logic and Timed Automata
Information Systems Analysis Temporal Logic and Timed Automata (5) UPPAAL timed automata Paweł Głuchowski, Wrocław University of Technology version 2.3 Contents of the lecture Tools for automatic verification
More informationFORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY
FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY Pamela Zave AT&T Laboratories Research Florham Park, New Jersey, USA
More informationOperating Systems CMPSC 473. Synchronization February 21, Lecture 11 Instructor: Trent Jaeger
Operating Systems CMPSC 473 Synchronization February 21, 2008 - Lecture 11 Instructor: Trent Jaeger Last class: CPU Scheduling Today: A little more scheduling Start synchronization Little s Law Evaluating
More informationOutline for Today CSE 142. CSE142 Wi03 G-1. withdraw Method for BankAccount. Class Invariants
CSE 142 Outline for Today Conditional statements if Boolean expressions Comparisons (=,!=, ==) Boolean operators (and, or, not - &&,,!) Class invariants Conditional Statements & Boolean Expressions
More informationChapter 8. Statement-Level Control Structures ISBN
Chapter 8 Statement-Level Control Structures ISBN 0-321-49362-1 Chapter 8 Topics Introduction Selection Statements Iterative Statements Unconditional Branching Guarded Commands Conclusions Copyright 2012
More informationOperating Systems (234123) Spring (Homework 3 Wet) Homework 3 Wet
Due date: Monday, 4/06/2012 12:30 noon Teaching assistants in charge: Operating Systems (234123) Spring-2012 Homework 3 Wet Anastasia Braginsky All emails regarding this assignment should be sent only
More informationUsing Spin to Help Teach Concurrent Programming
Using Spin to Help Teach Concurrent Programming John Regehr May 1, 1998 1 Introduction and Motivation Writing correct concurrent programs is very difficult; race conditions, deadlocks, and livelocks can
More informationLast class: Today: CPU Scheduling. Start synchronization
Last class: CPU Scheduling Today: Start synchronization Synchronization Processes (threads) share resources. How do processes share resources? How do threads share resources? It is important to coordinate
More informationThe Design of a Distributed Model Checking Algorithm for Spin
The Design of a Distributed Model Checking Algorithm for Spin Gerard J. Holzmann http://eis.jpl.nasa.gov/lars http://spinroot.com/gerard/ Presented at FMCAD 2006, San Jose, California November 14, 2006
More informationTowards Promela verification using VerICS
Part 2: Specification Towards Promela verification using VerICS Wojciech Nabia lek 1 and Pawe l Janowski 2 1 Institute of Computer Science, University of Podlasie ul. Sienkiewicza 51, 08-110 Siedlce, Poland
More informationIntroduction to Model Checking
Introduction to Model Checking René Thiemann Institute of Computer Science University of Innsbruck WS 2007/2008 RT (ICS @ UIBK) week 4 1/23 Outline Promela - Syntax and Intuitive Meaning Promela - Formal
More informationA Verification Approach for GALS Integration of Synchronous Components
GALS 2005 Preliminary Version A Verification Approach for GALS Integration of Synchronous Components F. Doucet, M. Menarini, I. H. Krüger and R. Gupta 1 Computer Science and Engineering University of California,
More informationCSCI 5828: Foundations of Software Engineering
CSCI 5828: Foundations of Software Engineering Lecture 4: Processes and Threads Slides created by Magee and Kramer for the Concurrency textbook 01/24/2008 1 Magee/Kramer 2nd Edition Chapter 2 Processes
More informationProcesses & Threads. Concepts: processes - units of sequential execution.
Chapter 2 Processes & Threads concurrent processes We structure complex systems as sets of simpler activities, each represented as a sequential process. Processes can overlap or be concurrent, so as to
More informationApplicant. LLC Service. LAN Segment
Verication of Group Address Registration Protocol using PROMELA and SPIN Tadashi Nakatani Fuchu Works, Toshiba Corporation, Japan February 16, 1997 Abstract This paper demonstrates robustness and eectiveness
More informationLTL Reasoning: How It Works
Distributed Systems rogramming F21DS1 LTL Reasoning: How It Works Andrew Ireland School of Mathematical and Computer Sciences Heriot-Watt University Edinburgh Distributed Systems rogramming F21DS1 2 Overview
More informationIterative Statements. Iterative Statements: Examples. Counter-Controlled Loops. ICOM 4036 Programming Languages Statement-Level Control Structure
ICOM 4036 Programming Languages Statement-Level Control Structure Selection Statement Iterative Statements Unconditional Branching Guarded Commands This lecture covers review questions 8-16 This lecture
More informationTRIAL-EXAM Software Engineering using Formal Methods TDA293 (TDA292) / DIT270. Only dictionaries may be used. Other aids are not allowed!
TRIAL-EXAM Software Engineering using Formal Methods TDA293 (TDA292) / DIT270 Extra aid: Only dictionaries may be used. Other aids are not allowed! Please observe the following: This exam has 15 numbered
More informationICM ~Unit 4 ~ Day 2. Section 1.2 Domain, Continuity, Discontinuities
ICM ~Unit 4 ~ Day Section 1. Domain, Continuity, Discontinuities Warm Up Day Find the domain, -intercepts and y-intercepts. 1. 3 5. 1 9 3. Factor completely. 6 4 16 3 4. Factor completely. 8 7 Practice
More informationTOWARDS AUTOMATED VERIFICATION OF WEB SERVICES
TOWARDS AUTOMATED VERIFICATION OF WEB SERVICES Cátia Vaz INESC-ID Lisboa, ISEL-IPL Rua Alves Redol 9, 1000-029 Lisboa cvaz@cc.isel.ipl.pt Carla Ferreira INESC-ID, IST-UTL Rua Alves Redol 9, 1000-029 Lisboa
More informationIn this lab, you will learn more about selection statements. You will get familiar to
Objective: In this lab, you will learn more about selection statements. You will get familiar to nested if and switch statements. Nested if Statements: When you use if or if...else statement, you can write
More informationUsing Model Checking with Symbolic Execution for the Verification of Data-Dependent Properties of MPI-Based Parallel Scientific Software
Using Model Checking with Symbolic Execution for the Verification of Data-Dependent Properties of MPI-Based Parallel Scientific Software Anastasia Mironova Problem It is hard to create correct parallel
More informationSystematic Derivation of a Validation Model from a Rule-oriented Model : A System Validation Case Study using Promela/Spin
Systematic Derivation of a Validation Model from a Rule-oriented Model : A System Validation Case Study using Promela/Spin J. Christian Attiogbé LINA FRE CNRS 2729 - Université de Nantes Christian.Attiogbe@lina.univ-nantes.fr
More informationOrder Is A Lie. Are you sure you know how your code runs?
Order Is A Lie Are you sure you know how your code runs? Order in code is not respected by Compilers Processors (out-of-order execution) SMP Cache Management Understanding execution order in a multithreaded
More informationCyber Physical System Verification with SAL
Cyber Physical System Verification with July 22, 2013 Cyber Physical System Verification with Outline 1 2 3 4 5 Cyber Physical System Verification with Table of Contents 1 2 3 4 5 Cyber Physical System
More informationApplication of Formal Verification to Software Security
Application of Formal Verification to Software Security Reynald Affeldt David Nowak AIST-RCIS, Japan TWISC Summer School 2006 Verification of Security Properties of Software Generally speaking, Software
More informationOO Using UML: Dynamic Models
OO Using UML: Dynamic Models Defining how the objects behave Overview The object model describes the structure of the system (objects, attributes, and operations) The dynamic model describes how the objects
More informationA TOOL FOR IMPLEMENTING DISTRIBUTED ALGORITHMS WRITTEN IN PROMELA, USING DAJ TOOLKIT KRANTHI KIRAN NUTHI
A TOOL FOR IMPLEMENTING DISTRIBUTED ALGORITHMS WRITTEN IN PROMELA, USING DAJ TOOLKIT by KRANTHI KIRAN NUTHI B.Tech, JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY, INDIA, 2007 A REPORT submitted in partial
More informationthese developments has been in the field of formal methods. Such methods, typically given by a
PCX: A Translation Tool from PROMELA/Spin to the C-Based Stochastic Petri et Language Abstract: Stochastic Petri ets (SPs) are a graphical tool for the formal description of systems with the features of
More information