Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.

Slides:



Advertisements
Similar presentations
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Advertisements

Ade Azurat, Advanced Programming 2004 (Based on LYS Stefanus’s slides) Advanced Programming 2004, Based on LYS Stefanus’s slides Slide 2.1 Multithreading.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Slides prepared by Rose Williams, Binghamton University ICS201 Exception Handling University of Hail College of Computer Science and Engineering Department.
Bandera: Extracting Finite-state Models from Java Source Code James C. Corbett (Hawai’i) Matthew B. Dwyer, John Hatcliff, Shawn Laubach, Corina S. Păsăreanu,
Software Model Checking for Embedded Systems PIs: Matthew Dwyer 1, John Hatcliff 1, and George Avrunin 2 Post-docs: Steven Seigel 2, Radu Iosif 1 Students:
Lecture 27 Exceptions COMP1681 / SE15 Introduction to Programming.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L19 (Chapter 24) Multithreading.
OOP & JAVA. HelloWorld.java /** * The HelloWorld class is an application that * displays "Hello World!" to the standard output. */ public class HelloWorld.
Introduction to Java Programming, 4E
CS220 Software Development Lecture: Multi-threading A. O’Riordan, 2009.
Synchronization in Java Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Synchronization in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Threads A thread is a program unit that is executed independently of other parts of the program A thread is a program unit that is executed independently.
Multithreading in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Threads II. Review A thread is a single flow of control through a program Java is multithreaded—several threads may be executing “simultaneously” If you.
More Multithreaded Programming in Java David Meredith Aalborg University.
Multithreading.
1 CSCI 6900: Design, Implementation, and Verification of Concurrent Software Eileen Kraemer August 19 th, 2010 The University of Georgia.
220 FINAL TEST REVIEW SESSION Omar Abdelwahab. INHERITANCE AND POLYMORPHISM Suppose you have a class FunClass with public methods show, tell, and smile.
Threads some important concepts Simon Lynch
CIS 644 Aug. 25, 1999 tour of Java. First … about the media lectures… we are experimenting with the media format please give feedback.
CIS 842: Specification and Verification of Reactive Systems Lecture Specifications: Sequencing Properties Copyright , Matt Dwyer, John Hatcliff,
Introduction to Java Programming with Forte Y. Daniel Liang.
Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.
CIS 842: Specification and Verification of Reactive Systems Lecture Specifications: Basics and Observables Copyright , Matt Dwyer, John Hatcliff,
Today’s Agenda  Quick Review  Finish Java Threads  The CS Problem Advanced Topics in Software Engineering 1.
Exception Handling in JAVA. Introduction Exception is an abnormal condition that arises when executing a program. In the languages that do not support.
CIS 842: Specification and Verification of Reactive Systems Lecture Specifications: LTL Model Checking Copyright , Matt Dwyer, John Hatcliff,
Multithreading : synchronization. Avanced Programming 2004, Based on LYS Stefanus’s slides slide 4.2 Solving the Race Condition Problem A thread must.
Semaphores, Locks and Monitors By Samah Ibrahim And Dena Missak.
Bandera: Extracting Finite-state Models from Java Source Code James Corbett Matthew Dwyer John Hatcliff Shawn Laubach Corina Pasareanu Robby Hongjun Zheng.
Finding Feasible Counter-examples when Model Checking Abstracted Java Programs Corina S. Pasareanu, Matthew B. Dwyer (Kansas State University) and Willem.
Copyright , Doron Peled and Cesare Tinelli. These notes are based on a set of lecture notes originally developed by Doron Peled at the University.
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Bogor-Simulation: Executing (Simulating) Concurrent Systems in Bogor Copyright.
Model construction and verification for dynamic programming languages Radu Iosif
Synchronizing threads, thread pools, etc.
CIS 842: Specification and Verification of Reactive Systems Lecture 1: Course Overview Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The.
Multithreading in Java Sameer Singh Chauhan Lecturer, I. T. Dept., SVIT, Vasad.
CIS 842: Specification and Verification of Reactive Systems Lecture SPIN-Soldiers: Soldiers Case Study Copyright , Matt Dwyer, John Hatcliff,
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
Bandera: Extracting Finite-state Models from Java Source Code. Paper By: James C. Corbett, Mathew Dwyer, John Hatcliff, Shawn Laubach, Corina Pasareanu,
In Java processes are called threads. Additional threads are associated with objects. An application is associated with an initial thread via a static.
CIS 842: Specification and Verification of Reactive Systems Lecture ADM: Course Administration Copyright , Matt Dwyer, John Hatcliff, Robby. The.
CSC Multiprocessor Programming, Spring, 2012 Chapter 7 – Cancellation & Shutdown Dr. Dale E. Parson, week 9-10.
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Examples: Simple BIR-Lite Examples Copyright 2004, Matt Dwyer, John Hatcliff,
Threads in Java1 Concurrency Synchronizing threads, thread pools, etc.
Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.
6.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Module 6: Process Synchronization Codes.
Model-checking Concurrent Java Software Using the Bandera Tool Set Matthew Dwyer John Hatcliff Radu Iosif Yu Chen Georg Jung Todd Wallentine FacultyStudents.
1 Class 1 Lecture Topic Concepts, Definitions and Examples.
Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used.
CP — Concurrent Programming 6. Liveness and Guarded Methods Prof. O. Nierstrasz Wintersemester 2005 / 2006.
June 9, 2007 Workshop on Computer Architecture Education A Pedagogically Targeted Logic Simulation Tool David A. Poplawski Department of Computer Science.
Comunication&Synchronization threads 1 Programación Concurrente Benemérita Universidad Autónoma de Puebla Facultad de Ciencias de la Computación Comunicación.
These slides are for internal Bandera meetings and are not meant to be publicly disclosed. Bandera Meeting: Sept 9, 2001.
Model-checking Concurrent Java Software Using the Bandera Tool Set Matthew Dwyer John Hatcliff Radu Iosif Hongjun Zheng Shawn Laubach Corina Pasareanu.
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Depth-Bounded: Depth-Bounded Depth-first Search Copyright 2004, Matt Dwyer, John.
Cs205: engineering software university of virginia fall 2006 Programming Exceptionally David Evans
Concurrency (Threads) Threads allow you to do tasks in parallel. In an unthreaded program, you code is executed procedurally from start to finish. In a.
Agenda Introduction Errors and Exception Exception Hierarchy Classification of Exceptions Built in Exceptions Exception Handling in Java User defined.
Introduction to Java Programming, 4E Y. Daniel Liang.
The Bandera Model Reduction Tools James Corbett Matthew Dwyer John Hatcliff Shawn Laubach Corina Pasareanu Robby Hongjun Zheng Faculty Students and Post-docs.
CIS 842: Specification and Verification of Reactive Systems
Threads and Concurrency in Java: Part 2
Condition Variables and Producer/Consumer
Condition Variables and Producer/Consumer
Multithreading.
Concurrency in Java Last Updated: Fall 2010 Paul Ammann SWE 619.
Threads in Java James Brucker.
Presentation transcript:

Copyright 2001, Matt Dwyer, John Hatcliff, and Radu Iosif. The syllabus and all lectures for this course are copyrighted materials and may not be used in other course settings outside of Kansas State University in their current form or modified form without the express written permission of one of the copyright holders. During this course, students are prohibited from selling notes to or being paid for taking notes by any person or commercial firm without the express written permission of one of the copyright holders. CIS 842: Specification and Verification of Reactive Systems Lecture 7: Demonstration of Basic Aspects of the Bandera Tool Set

Notes Demo examples are chosen to be simple and to illustrate tool components For more examples with interesting specifications, see… –Bandera tutorial… –Extended version of SPIN’00 paper complete presentation of BoundedBuffer example Doug Lea’s Readers/Writers Publish/Subscribe framework from java.util

Outline Concept of a session –configuring Bandera for a run Simple deadlock example –illustrates session, code display, counterexample navigation, and slicing Pipeline example –illustrates creating a temporal specification, slicing, and abstraction

Configuring Bandera A run of Bandera is configured by a session specification A session specifies... which Java files to take as input which property to check which tool components (e.g., slicer, abstraction) to invoke which backend model-checker to use …other options A session file holds several related sessions sessions in session file can be executed in batch mode or individually selected in the BUI.

Simple Deadlock Example Lock 1 Lock 2 Process 1 Process 2 acquisition blocked acquisition blocked acquisition

Simple Deadlock Example class Process1 extends Thread { public void run() { Deadlock.state++; synchronized (Deadlock.lock1) { synchronized (Deadlock.lock2) { Deadlock.state++; }}}} class Process2 extends Thread { public void run() { Deadlock.state++; synchronized (Deadlock.lock2) { synchronized (Deadlock.lock1) { Deadlock.state++; }}}} public class Deadlock { static Lock lock1; static Lock lock2; static int state; public static void main(String[] args) { lock1 = new Lock(); lock2 = new Lock(); Process1 p1 = new Process1(); Process2 p2 = new Process2(); p1.start(); p2.start(); } class Lock {}

Deadlock Example Artifacts BIRC BIR Simulator Abstraction Engine Slicer Analyses Translators SPIN dSPIN SMV JPF Property Tool Java Jimple Parser Error Trace Display.trail Sliced Java Abstracted Java Point.java

Pipeline Example PipeInt Stage1Stage2Stage3Listener print >0: + 1 =0: stop …if stop received, send out 0 c1.stopc2.stop..send 0 c3.stopc4.stop..send 0 Shutdown Actions: Connectors c1 c2 c3c4 Requirements: If main in PipeInt signals shutdown (by calling the stop method of c1), then Stage x eventually shuts down.

Pipeline Example class PipeInt { /** predset1 * LOCATION[main1] mainStop; */ static public void main (String[] args) { Heap.c1 = new Connector(); Heap.c2 = new Connector(); Heap.c3 = new Connector(); Heap.c4 = new Connector(); (new Stage1()).start(); (new Stage2()).start(); (new Stage3()).start(); (new Listener()).start(); for (int i = 1; i < 100; i++) Heap.c1.add(i); main1: Heap.c1.stop(); } Observable

Pipeline Example final class Stage1 extends Thread { /** predset1 * LOCATION[run1] stage1Shutdown; */ public void run() { System.out.println("Stage1 startup"); int tmp = -1; while (tmp != 0) { if ((tmp = Heap.c1.take()) != 0) Heap.c2.add(tmp + 1); } Heap.c2.stop(); run1: System.out.println("Stage1 shutdown"); } Observable

Pipeline Example final class Connector { int queue = -1; /* represents empty queue */ public final synchronized int take() { int value; while (queue < 0) /* wait ‘til not empty */ try { wait(); } catch (InterruptedException ex) {} value = queue; /* get value to send out */ queue = -1; /* set queue to empty */ return value; /* send out value */ } public final synchronized void add(int value) { queue = value; notifyAll(); }

Pipeline Example Specification Requirements: If main in PipeInt signals shutdown (by calling the stop method of c1), then Stage x eventually shuts down. …an example of the response or leads to pattern with global scope For hints on how to construct the specification, a user might consult the Specification Patterns Webpage Specification Patterns Webpage BSL Specification (for first stage shutdown): forall[s:Stage1]. {stage1Shutdown(s)} responds to {mainStop} globally;