Defining Liveness by Bowen Alpern and Fred B. Schneider Presented by Joe Melnyk.

Slides:



Advertisements
Similar presentations
Completeness and Expressiveness
Advertisements

Some important properties Lectures of Prof. Doron Peled, Bar Ilan University.
Modeling issues Book: chapters 4.12, 5.4, 8.4, 10.1.
Introduction to Proofs
Boyce/DiPrima 9th ed, Ch 2.8: The Existence and Uniqueness Theorem Elementary Differential Equations and Boundary Value Problems, 9th edition, by William.
Equivalence Relations
10 October 2006 Foundations of Logic and Constraint Programming 1 Unification ­An overview Need for Unification Ranked alfabeths and terms. Substitutions.
Partial Order Reduction: Main Idea
Part 3: Safety and liveness
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Program correctness The State-transition model A global state S  s 0 x s 1 x … x s m {s k = local state of process k} S0  S1  S2  … Each state transition.
CS6133 Software Specification and Verification
Mutual Exclusion By Shiran Mizrahi. Critical Section class Counter { private int value = 1; //counter starts at one public Counter(int c) { //constructor.
Chair of Software Engineering Concurrent Object-Oriented Programming Prof. Dr. Bertrand Meyer Lecture 4: Mutual Exclusion.
Copyright © Cengage Learning. All rights reserved.
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
Hyperproperties Michael Clarkson and Fred B. Schneider Cornell University IEEE Symposium on Computer Security Foundations June 23, 2008 TexPoint fonts.
Basic properties of the integers
1 Discrete Structures Lecture 29 Predicates and Programming Read Ch
Safety and Liveness. Defining Programs Variables with respective domain –State space of the program Program actions –Guarded commands Program computation.
Lecture 2: Reasoning with Distributed Programs Anish Arora CSE 6333.
Tele Design of Reactive Systems Summer 2001 Prof. Dr. Stefan Leue Institute for Computer Science Albert-Ludwigs-Universität Freiburg
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Lecture 9 Recursive and r.e. language classes
1 Module 9 Recursive and r.e. language classes –representing solvable and half-solvable problems Proofs of closure properties –for the set of recursive.
Lecture 8 Recursively enumerable (r.e.) languages
CHAPTER 4 Decidability Contents Decidable Languages
Concurrency. Correctness Principle A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction,
Normal forms for Context-Free Grammars
Relations Chapter 9.
Basic Concepts of Discrete Probability (Theory of Sets: Continuation) 1.
Chapter 3 – Set Theory  .
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
CSI 3125, Axiomatic Semantics, page 1 Axiomatic semantics The assignment statement Statement composition The "if-then-else" statement The "while" statement.
Consensus and Its Impossibility in Asynchronous Systems.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Lecture #5 Properties of hybrid systems João P. Hespanha University of California at Santa Barbara Hybrid Control and Switched Systems.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Program correctness The State-transition model The set of global states = so x s1 x … x sm {sk is the set of local states of process k} S0 ---> S1 --->
Hyperproperties Michael Clarkson and Fred B. Schneider Cornell University Air Force Office of Scientific Research December 4, 2008 TexPoint fonts used.
Program correctness The State-transition model A global states S  s 0 x s 1 x … x s m {s k = set of local states of process k} S0  S1  S2  Each state.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
1 Introduction to Abstract Mathematics Sets Section 2.1 Basic Notions of Sets Section 2.2 Operations with sets Section 2.3 Indexed Sets Instructor: Hayk.
Recognizing safety and liveness Presented by Qian Huang.
Hwajung Lee. The State-transition model The set of global states = s 0 x s 1 x … x s m {s k is the set of local states of process k} S0  S1  S2  Each.
Introduction to Real Analysis Dr. Weihu Hong Clayton State University 8/27/2009.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
CS 203: Introduction to Formal Languages and Automata
Safety and Liveness. Recall Program –State space Program computation –Of the form Consider the set of all program computations.
Hyperproperties Michael Clarkson and Fred B. Schneider Cornell University Ph.D. Seminar Northeastern University October 14, 2010.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
Program Correctness. The designer of a distributed system has the responsibility of certifying the correctness of the system before users start using.
Presented by: Belgi Amir Seminar in Distributed Algorithms Designing correct concurrent algorithms Spring 2013.
Summary of the Last Lecture This is our second lecture. In our first lecture, we discussed The vector spaces briefly and proved some basic inequalities.
Introduction to distributed systems description relation to practice variables and communication primitives instructions states, actions and programs synchrony.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Chapter 2 Sets and Functions.
The Acceptance Problem for TMs
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
Reasoning About Code.
Chapter 3 The Real Numbers.
Set Topology MTH 251 Lecture # 8.
Chapter 3 The Real Numbers.
Axiomatic semantics Points to discuss: The assignment statement
Recognizing Safety and Liveness
Chapter 3 The Real Numbers.
Presentation transcript:

Defining Liveness by Bowen Alpern and Fred B. Schneider Presented by Joe Melnyk

Introduction view of concurrent program execution a sequence  = s 0 s 1 s 2... of states each state s i (for i > 0) is the result of a single atomic action from s i -1 property = set of such sequences a property P holds for a program if the set of all sequences defined by the program is contained within the property arguments to prove a program satisfies a given property: safety property – invariance liveness property – well-foundedness

Safety Properties informal definition: no “bad things” happen during program execution examples and their respective “bad things” mutual exclusion; two processes executing in the critical section at the same time deadlock freedom; deadlock partial correctness; starting state satisfied the precondition, but the termination state does not satisfy the postcondition first-come-first-serve; servicing a request made after one that has not yet been serviced formal definition: assumptions let S = set of program states S  = set of infinite sequences of program states S* = set of finite sequences of program states

execution of a program can be modeled as a member of S  elements of S  = executions elements of S * = partial executions  |= P if  is in property P let  i = partial execution consisting of the first i states in  in order for P to be a safety property, if P doesn’t hold for an execution then a “bad thing” must happen at some point the “bad thing” is irremediable since a safety property states that “bad things” never happen during execution therefore, P is a safety property if and only if (  :  S  :  |  P  (  i : 0  i: (  :  S  :  i  |  P))) by the definition, a safety property unconditionally prohibits a “bad thing” from occurring; if it does occur, there is an identifiable point at which this can be recognized

Liveness Properties informal definition: a “good thing” happens during program execution examples and their respective “good things” starvation freedom; making progress termination; completion of the final instruction guaranteed service; receiving service defining characteristic of liveness no partial execution is irremediable; a “good thing” can always occur in the future note: if a partial execution were irremediable, it would be a “bad thing” and liveness properties cannot reject “bad things”, only ensure “good things”

formal definition: a partial execution  is live for a property P if and only if there is a sequence of states  such that  |=P in a liveness property, every partial execution is live therefore, P is a liveness property if and only if (  :  S * : (  :  S  :  |=P) notice: no restriction on what the “good thing” is nor requirement that it be discrete for example, the “good thing” in starvation freedom (progress) is an infinite collection of discrete events hence, “good things” are fundamentally different from “bad things” a liveness property cannot stipulate that a “good thing” always happens, only that it eventually happens

the authors believe no liveness definition is more permissive proof (by contradiction): suppose that P is a liveness property that doesn’t satisfy the definition; then there must be a partial execution  such that (  :  S  :  |  P) since  is a “bad thing” rejected by P, P is in part a safety property and not a liveness property this contradicts the assumption of P being a liveness property more restrictive liveness definitions uniform liveness: (  :  S  : (  :  S * :  |=P) P is a liveness property if and only if there is a single execution (  ) that can be appended to every partial execution (  ) so that the resulting sequence is in P

absolute liveness (  :  S  :  |=P)  (  :  S  :  |=P  (  :  S * :  |=P)) P is an absolute-liveness property if and only if it is non- empty and any execution (  ) in P can be appended to any partial execution (  ) to obtain a sequence in P contrast of definitions liveness: if any partial execution  can be extended by some execution  so that  is in L (choice of  may depend on  ), then L is a liveness property uniform-liveness: if there is a single execution  that extends all partial execution  such that  is in U, then U is a uniform-livness property absolute liveness: if A is non-empty and any execution  in A can be used to extend all partial executions , then A is an absolute-liveness property any absolute-liveness property is also a uniform- liveness property and any uniform-liveness property is also a liveness property

absolute-liveness does not include properties that should be considered liveness leads-to - any occurrence of an event of type E 1 is eventually followed by an occurrence of an event of type E 2 example: guaranteed service such properties are liveness properties when E 2 is satisfiable (E 2 is the “good thing”) leads-to properties are not absolute-liveness properties consider execution  where no event of type E 1 or E 2 occurs leads-to holds on , but appending  to a partial execution consisting of a single event of type E 1 yields and execution that does not satisfy the property

uniform-liveness does not capture the intuition of liveness either examples predictive – if A initially holds then after some partial execution B always holds; otherwise after some partial execution, B never holds predictive is a liveness property since it requires a “good thing” to happen: either “always B” or “always  B” predictive is not a uniform-liveness property since there is no single sequence that can extend all partial executions

Other Properties (neither safety nor liveness) until – eventually an event of type E 2 will happen; all preceding events are of type E 1 this is the intersection of a safety and liveness property safety: “`  E 1 before E 2 ’ doesn’t happen” liveness: “E 2 eventually happens” total correctness is also the intersection of a safety property and a liveness property: partial correctness and termination, respectively topological overview of S  : safety properties are the closed sets and liveness properties are the dense sets basic open sets: sets of all executions that share a common prefix open set: union of all basic open sets closed set: complement of an open set dense set: intersects every non-empty open set

Theorem: every property P is the intersection of a safety and a liveness property proof: let  P be the smallest safety property containing P and let L be  (  P - P ) then: L  P =  (  P – P )  P = (  P  P)  P = (  P   P )  (P   P ) = P  P = P need to show that L is dense and hence a liveness property (using proof by contradiction): assume there is a non-empty open set O contained in  L and thus L is not dense then O  (  P - P) and hence P  (  P - O)  P - O is closed (and is therefore a safety property) since the intersection of two closed sets is closed this contradicts  P being the smallest safety property containing P

corollary: if a notation  for expressing properties is closed under comlement, intersection and topological closure then any  -expressible property is the intersection of a  - expressible safety property and a  -expressible liveness property therefore, to show that every property P expressible in a temporal logic is equivalent to the conjunction of a safety and a liveness property expressed in the logic due to the corollary, we just need to show that the smallest safety property containing P is also expressible in the logic

Theorem: If |S| > 1 then any property P is the intersection of two liveness properties proof:  states a, b  S by the hypothesis; let L a (and L b ) be the set of executions with tails that are an infinite sequence of a’s (and b’s); both L a and L b are liveness properties and L a  L b =  (P  L a )  (P  L b ) = (P  P)  (P  L a )  (P  L b )  (L a  L b ) = P since the union of any set and a dense set is dense, P  L a and P  L b are liveness properties corollary: if a notation  for expressing properties is closed under intersection and there exists  -expressible liveness properties with empty intersection than any  - expressible property is the intersection of two  - expressible liveness properties

further notes - using the topological definitions given, it can also be shown that: safety and liveness are closed under Boolean operations safety properties are closed under union and intersection liveness properties are closed only under union neither safety nor liveness is closed under complement S  is the only property which is closed under safety and liveness