Advanced Topics in Software Engineering Marjan Sirjani Tehran University Faculty of Engineering ECE Department Tehran, 1383-1384.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Modeling Software Systems Lecture 2 Book: Chapter 4.
Program verification: flowchart programs Book: chapter 7.
Modeling and Analyzing Periodic Distributed Computations Anurag Agarwal Vijay Garg Vinit Ogale The University.
Models of Concurrency Manna, Pnueli.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Based on: Petri Nets and Industrial Applications: A Tutorial
1.6 Behavioral Equivalence. 2 Two very important concepts in the study and analysis of programs –Equivalence between programs –Congruence between statements.
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
CS 290C: Formal Models for Web Software Lecture 4: Implementing and Verifying Statecharts Specifications Using the Spin Model Checker Instructor: Tevfik.
Timed Automata.
/ PSWLAB P ROMELA Semantics from “THE SPIN MODEL CHECKER” by G. J. Holzmann Presented by Hong,Shin 5 th Oct :021PROMELA Semantics.
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
1 Mechanical Verification of Timed Automata Myla Archer and Constance Heitmeyer Presented by Rasa Bonyadlou 24 October 2002.
1 Discrete Structures Lecture 29 Predicates and Programming Read Ch
Review of topics Final exam : -May 2nd to May 7 th - Projects due on May 7th.
1/22 Programs : Semantics and Verification Charngki PSWLAB Programs: Semantics and Verification Mordechai Ben-Ari Mathematical Logic for Computer.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Lecture 2: Reasoning with Distributed Programs Anish Arora CSE 6333.
Modeling Software Systems Lecture 2 Book: Chapter 4.
A 14← department of mathematics and computer science PROSE Checking Properties of Adaptive Workflow Nets K. van Hee, I. Lomazova, O. Oanea,
Chapter 8 . Sequence Control
PSUCS322 HM 1 Languages and Compiler Design II Formal Semantics Material provided by Prof. Jingke Li Stolen with pride and modified by Herb Mayer PSU Spring.
Advanced Behavioral Modeling
An algebra of Connectors for modeling CommUnity with Tiles joint work with Roberto Bruni Ugo Montanari Dipartimento di Informatica Università di Pisa Ivan.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Real-Time System Requirements & Design Specs Shaw - Chapters 3 & 4 Homework #2: 3.3.1, 3.4.1, Add Error states to Fig 4.1 Lecture 4/17.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Verification and Validation.
Introduction to ASMs Dumitru Roman Digital Enterprise Research Institute
Advanced Topics in Software Engineering Marjan Sirjani Tehran University Faculty of Engineering ECE Department Tehran,
The Architecture of Secure Systems Jim Alves-Foss Laboratory for Applied Logic Department of Computer Science University of Idaho By, Nagaashwini Katta.
Rebecca Modeling Language Mahdieh Ahmadi Verification of Reactive Systems March 2014.
An Introduction to Petri Nets Marjan Sirjani Formal Methods Laboratory University of Tehran.
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
Advanced Topics in SE Spring Process Algebra Hossein Hojjat Formal Methods Lab University of Tehran.
CS6133 Software Specification and Verification
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Natallia Kokash (Accepted for PACO’2011) ACG, 31/05/ Input-output conformance testing for channel-based connectors 1.
Lazy Annotation for Program Testing and Verification Speaker: Chen-Hsuan Adonis Lin Advisor: Jie-Hong Roland Jiang November 26,
Model 3: Message-Passing Text We saw –Diagrams –Shared-variables text Now –Message-passing text (like CSP)
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Ukrprog Formal requirement language and its applications A.Letichevsky Glushkov Institute of Cybernetics.
Principle of Programming Lanugages 3: Compilation of statements Statements in C Assertion Hoare logic Department of Information Science and Engineering.
Essentials of Visual Modeling w/ UML Instructor Notes
Program Correctness. The designer of a distributed system has the responsibility of certifying the correctness of the system before users start using.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Presented by: Belgi Amir Seminar in Distributed Algorithms Designing correct concurrent algorithms Spring 2013.
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008.
Agenda  Quick Review  Finish Introduction  Java Threads.
Introduction to distributed systems description relation to practice variables and communication primitives instructions states, actions and programs synchrony.
Π-AAL: An Architecture Analysis Language for Formally Specifying and Verifying Structural and Behavioral Properties of Software Architectures Presented.
CS5270 Lecture 41 Timed Automata I CS 5270 Lecture 4.
Formal methods: Lecture
“Language Mechanism for Synchronization”
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Automatic Verification
State Machine Diagrams
UML Activity Diagrams & State Charts
Formal Methods in software development
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Defining A Formal Semantics For The Rosetta Specification Language
An explicit state model checker
Abstraction.
Formal Methods in software development
An Introduction to Petri Nets
Presentation transcript:

Advanced Topics in Software Engineering Marjan Sirjani Tehran University Faculty of Engineering ECE Department Tehran,

2 Subjects to be covered Modeling concurrency Formal verification methods Transition systems Petri Nets Process Algebra Actor Model Rebeca: an actor-based model Reo: a coordination language Constraint automata

3 Models of concurrency The Temporal Logic of Reactive and Concurrent Systems (Specification), Z. Manna, A. Pnueli, Springer-Verlag, 1992 Part one: Models of Concurrency Process algebra Communicating Sequential Processes C.A.R. Hoare, 2004

4 Actors Actors: a Unifying Model for Parallel and Distributed Computing, Agha G., Kim W., Open Systems Laboratory, Rebeca Modeling and Verification of Reactive Systems using Rebeca, Sirjani M., Movaghar A, Shali A., and de Boer F., Fundamenta Informaticae, Dec. 2004

5 Coordination languages Reo: A Channel-based Coordination Model for Component Composition, F. Arbab, Mathematical Structures in Computer Science, 2004 Modeling Component Connectors in Reo by Constraint Automata, F. Arbab, C. Baier, J.J.M.M. Rutten and M. Sirjani, in Proceedings of FOCLASA'03, Marseille, France, September 2003, ENTCS, Elsevier Science.

6 Overview Concurrent and Reactive Systems Formal methods Modeling language Process algebra, Petri nets, Actor languages Specification language Temporal logic, Automata Analysis Theorem proving, Model checking

7 Models of Concurrency Manna, chapter 1,2

8 Chapter 1- Basic Models Programs and systems they control Transformational Reactive

9 Transformational program More conventional Produce final result at the end of a terminating computation A function from an initial state to a final state Appropriately specified by properly characterizing the relation between initial and final states: predicate logic

10 Reactive program Not to produce a final result but to maintain some ongoing interaction with its environment

11 Reactivity and Concurrency Program and its environment act concurrently in transformational case, they act sequentially When we have parallel processes, even if the whole program has a transformational role, it should be analyzed as a reactive system.

12 Reactive systems Communication Coordination

13 Communication Shared variables Message passing Remote procedure calls

14 Coordination Semaphores Critical regions Monitors Handshaking Rendezvous Asynchronous transmission

15 The Generic Model V – Vocabulary E – Expressions A – Assertions I - Interpretations

16 V – Vocabulary A countable set of typed variables. Data variables Range over data domains used in programs, such as booleans, integers, or lists. Control variables Indicate progress in the execution of a program, range over locations in the program.

17 E – Expressions Expressions are constructed from the variables of V and constants (such as +,,  ) and predicates (such as >, null, and  ) over the appropriate domains (such as integers, lists, and sets) are applied. x+3y hd(u) tl(v) A  B

18 A – Assertions Assertions are constructed out of boolean expressions using boolean connectives and quantification( ,  ) over some variables that appear in the expressions.

19 I – Interpretation An interpretation I  I of a set of typed variables V  V is a mapping that assigns to each variable y  V a value I[y] in the domain of y. If I[  ]=T, we say I satisfies  : I |= 

20 Basic Transition System A basic transition system ( , , ,  ), intended to represent a reactive program.  ={u 1,…,u 2 }  V – a finite set of flexible state variables.  - a set of states.  - a finite set of transitions.  - an initial condition.

21  ={u 1,…,u 2 }  V – a finite set of flexible state variables. Data variables Explicitly declared and manipulated Control variables Represent progress in the execution of the program (label of a statement)

22  - a set of states. Each state s in  is an interpretation of , assigning to each variable u in  a value over its domain, denoted by s[u]. A state s that satisfies an assertion , i.e., s |= , is sometimes referred to as  –state.

23  - a finite set of transitions. Each transition  in T represents a state-transforming action of the system and is defined as a function  :   2  that maps a state s in  into the (possibly empty) set of states  (s) that can be obtained by applying action  to state s.

24  - an initial condition. This assertion characterizes the states at which execution of the program can begin. A state s that satisfies , i.e., s |= , is called an initial state.

25 The Transition Relation   Each transition  is characterized by an assertion, called the transition relation   ( ,  ’)   ( ,  ’): C  (  )  (y’ 1 =e 1 )  …  (y’ k =e k ) Enabling condition: C  (  ) Conjunction of modification statements

26 Enabled and disabled transitions Idling and diligent transitions Computation: infinite sequence of steps Computation prefix Reachable states

27 Concrete models Model 1: Transition Diagram Model 2: Shared-Variables text Model 3: Message-Passing text Model 4: Petri Nets

28 Model 1 : Transition diagrams Program P, and processes P i P::[declaration][P 1 || P 2 … ||P m ] m>=1 Data variables Y={y 1, …, y n } n>=1 Shared for all the processes

29 Declarations At the head of the program Modes, Types, Initial conditions mode var, …,var: type where  i Mode: in, local, out Types: basic (int,char), structured (array, list, set) Assertion  i, imposes constraint on the values of some of the variables in this statement

30 in k,n :integer where 0  k  n local y 1,y 2 : integer where y 1 =n  y 2 =1 out b : integer where b=1 Data precondition of the program   i  : 0  k  n  y 1 =n  y 2 =1  b=1

31 Processes Each process P i is represented by a transition diagram (directed graph) Nodes: locations For P i : L i ={l i 0, l i 1, …, l i ti } Entry and exit locations Edges: (atomic) instructions Guarded assignment c  [(y 1, …):=(e 1, …)] State of a program: Control variables (  i current location of control in P i )+ data variables

32 Diagrams as Basic Transition Systems State variables States Transition Initial condition

33 State variables All the data and control variables  = {  1, …,  m, y 1, …, y n } States All the possible interpretations that assign to the state variables values over their respective domains. Domain of control variable  I is the set of locations L i

34 Transition Idling transition  I is defined by transition relation  I : T Diligent transitions: labeled edges that appear within the processes.

35 l l’ C  [y i := e i ]   is the edge.   : (  i =l)  c  (  ’ i =l~)  (y i =e i )

36 Initial condition Program P: [dcl where  ][P 1 || … || P m ] Initial condition  :   /\ i=1 m (  I = l o i ) A process is enabled, or disabled on a state.

37 Example: Binomial coefficient ( n k ) = (n(n-1)…(n-k+1)) / (1.2….k)

38 Representing Concurrency by Interleaving X=0,Y=0 X:=1 Y:=1 X:=1 Y:=1 Program A Program B Process P1Process P2

39 Scheduling The choice of the enabled transition to be executed next. A sequence of choices that leads to a complete computation is called a schedule.

40 Model 2: shared-variable text