Lecture 7 Discuss midterm Scheduling. Alternative Directory Structure See hw 1 and hw 2. This one more aligned with UNIX directory structure. Idea for.

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Operating Systems: Monitors 1 Monitors (C.A.R. Hoare) higher level construct than semaphores a package of grouped procedures, variables and data i.e. object.
Mutual Exclusion – SW & HW By Oded Regev. Outline: Short review on the Bakery algorithm Short review on the Bakery algorithm Black & White Algorithm Black.
Metodi formali dello sviluppo software a.a.2013/2014 Prof.Anna Labella.
Algorithmic Software Verification VII. Computation tree logic and bisimulations.
– R 7 :: 1 – 0024 Spring 2010 Parallel Programming 0024 Recitation Week 7 Spring Semester 2010.
Planning based on Model Checking Dept. of Information Systems and Applied CS Bamberg University Seminar Paper Svetlana Balinova.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
Chapter 14 Graph class design John Keyser’s Modifications of Slides by Bjarne Stroustrup
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar.
CS6133 Software Specification and Verification
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Background Concurrent access to shared data can lead to inconsistencies Maintaining data consistency among cooperating processes is critical What is wrong.
Operating System Concepts and Techniques Lecture 12 Interprocess communication-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and.
Model Checking Inputs: A design (in some HDL) and a property (in some temporal logic) Outputs: Decision about whether or not the property always holds.
Model Checking I What are LTL and CTL?. and or dreq q0 dack q0bar D D.
Monitors Chapter 7. The semaphore is a low-level primitive because it is unstructured. If we were to build a large system using semaphores alone, the.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
Lecture 4&5: Model Checking: A quick introduction Professor Aditya Ghose Director, Decision Systems Lab School of IT and Computer Science University of.
Chapter 2: Algorithm Discovery and Design
Developing Verifiable Concurrent Software Tevfik Bultan Department of Computer Science University of California, Santa Barbara
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
A temporal logic for calls and returns P. Madhusudan University of Pennsylvania Joint work with Rajeev Alur and Kousha Etessami Talk at HCES 2004, Philadelphia.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
BOOLEAN LOGIC CSC 171 FALL 2004 LECTURE 7. ASSIGNMENT Review Quiz # 2 Start reading Chapter 5.
ESE601: Hybrid Systems Introduction to verification Spring 2006.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Maria-Cristina Marinescu Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology A Synthesis Algorithm for Modular Design of.
1 Thread Synchronization: Too Much Milk. 2 Implementing Critical Sections in Software Hard The following example will demonstrate the difficulty of providing.
1 Introduction to SMV and Model Checking Mostly by: Ken McMillan Cadence Berkeley Labs Small parts by: Brandon Eames ISIS/Vanderbilt.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Lecture 12 – Design Procedure.
1 Recursion Dr. Bernard Chen Ph.D. University of Central Arkansas.
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.
10/19/2015COSC , Lecture 171 Real-Time Systems, COSC , Lecture 17 Stefan Andrei.
Automatic Verification of Finite-State Concurrent Systems Using Temporal Logic Specifications 1.
Semaphores, Locks and Monitors By Samah Ibrahim And Dena Missak.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
CSE 501N Fall ‘09 12: Recursion and Recursive Algorithms 8 October 2009 Nick Leidenfrost.
CSC321 Concurrent Programming: §5 Monitors 1 Section 5 Monitors.
Lecture 81 Optimizing CTL Model checking + Model checking TCTL CS 5270 Lecture 9.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
2015 Concurrency: logical properties 1 ©Magee/Kramer 2 nd Edition Chapter 14 Logical Properties Satisfied? Not satisfied?
CIS 842: Specification and Verification of Reactive Systems Lecture INTRO-Examples: Simple BIR-Lite Examples Copyright 2004, Matt Dwyer, John Hatcliff,
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Computer Science 209 Software Development Inheritance and Composition.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 9, 2003.
1 Chapter 8 Recursion. 2 Recursive Function Call a recursion function is a function that either directly or indirectly makes a call to itself. but we.
6/12/20161 a.a.2015/2016 Prof. Anna Labella Formal Methods in software development.
Model Checking Lecture 2. Model-Checking Problem I |= S System modelSystem property.
CS223: Software Engineering Lecture 26: Software Testing.
Model Checking Lecture 2 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
CIS 842: Specification and Verification of Reactive Systems
Monitors Chapter 7.
CSCI1600: Embedded and Real Time Software
Software Testing COM /28/2018 Testing/Spring 98.
Automatic Verification of Industrial Designs
Automatic Verification of Industrial Designs
Chapter 4: Model Checking of Finite State Systems
Albert M. K. Cheng Real-Time Systems Laboratory University of Houston
Formal Methods in software development
Monitors Chapter 7.
CSCI1600: Embedded and Real Time Software
Monitors Chapter 7.
Formal Methods in software development
Introduction to verification
Predicate Abstraction
Formal Methods in software development
Presentation transcript:

Lecture 7 Discuss midterm Scheduling

Alternative Directory Structure See hw 1 and hw 2. This one more aligned with UNIX directory structure. Idea for implementing processing is the same: at least conceptually separate traversal from maximum computation.

Directory DirectoryEntry INode FileName Mode RegularFile * entries inode filename Size int i; mode Ident Block * blocks UNIX style directory structure

Directory DirectoryEntry INode FileName Mode RegularFile * entries inode filename Size int i; mode Ident Block * blocks Maximum RegularFile size Traversal: from Directory to RegularFile

Directory DirectoryEntry_List INode Mode RegularFile * entries inode Size int i; mode Maximum RegularFile size: implementation structure Vector DirectoryEntry Object

Collecting Information during traversal Java does not have call by reference like C++ or Pascal. Use IntegerRef class instead: class IntegerRef { private int i_; IntegerRef(int i) { i = i_;} public int getValue() {return i_;} public void setValue(int n) {i_ = n;} }

From IntegerRef to Visitor pattern Using class IntegerRef is not optimal: The code for computing the maximum is mixed with the traversal code. A better but more elaborate solution would be to apply the visitor design pattern: instead of an IntegerRef-object, we give a MaxVisitor-object to the traversal.

MaxVisitor class MaxVisitor { private int max; int size; MaxVisitor() { max = 0;} public int get_result() {return max;} public void before(INode host) {size = host.get_size();} public void before(RegularFile host) {if (size > max) max=size;} } // this visitor takes care of transporting size // the traversal is: from Directory to RegularFile

DJ If you use a library like DJ you can easily program in this style. DJ: To learn about software development technology in general and Demeter in particular, take the COM 3360 class in the fall of See my home page.

Vector in Java 2 Vector now implements ListInterface. Use following idiom to iterate through list: for (ListIterator I = this.listIterator(); I.hasNext();) { … I.next(); … } Start using Collection framework as much as possible.

Semaphores in Java: Compare with WaitingStack public final class CountingSemaphore { private int count_ = 0; public CountingSemaphore(int inC) { count_ = inC;} public void P() { // down -- pop while (count_ = 0) try {wait();} catch (InterruptedException ex) {} --count_;} public void V() { // up -- push ++count_; notifyAll(); } } From: Concurrent Programming in Java by Doug Lea

N1 N2 N1 C2 T1 T2 C1 N2 N1 T2 T1 N2 T1 C2 C1 T2 0 1 Puzzle: what is this?

State modeling: two-process mutual exclusion N1 N2 N1 C2 T1 T2 C1 N2 N1 T2 T1 N2 T1 C2 C1 T2 N: noncritical region T: trying region C: critical region 0 1 Note: it is important to have two (T1,T2)

State modeling: two-process mutual exclusion N1 N2 N1 C2 T1 T2 C1 N2 N1 T2 T1 N2 T1 C2 C1 T2 N: noncritical region T: trying region C: critical region 0 1 AF(C1) true in 1 EF(C1 and C2) false in 0

Reasoning about concurrency Abstract from code Computation tree logic reasons about systems at this level Uses model-checking techniques

Symbolic Model Checking Determine correctness of finite state systems. Developed at Harvard and later at CMU by Clarke/Emerson/Sistla Specifications are written as formulas in a propositional temporal logic. Temporal logic: expressing ordering of events without introducing time explicitly

Temporal Logic A kind of modal logic. Origins in Aristotle and medieval logicians. Studied many modes of truth. Modal logic includes propositional logic. Embellished with operators to achieve greater expressiveness. A particular temporal logic: CTL (Computation Tree Logic)

Computation Tree Logic Used to express properties that will be verified Computation trees are derived from the state transition graphs State transition graphs unwound into an infinite tree rooted at initial state

abab bcbc acac S0 S1 S2 S1 S2 S0 S1 S0 structure computation tree for S0

Computation Tree Logic CTL formulas built from –atomic propositions, where each proposition corresponds to a variable in the model –Boolean connectives –Operators. Two parts path quantifier (A, E) temporal operator (F,G,X,U)

Computation Tree Logic Paths in tree represent all possible computations in model. CTL formulas refer to the computation tree If the signal req is high then eventually ack will also be high