3/17/20161 a.a.2015/2016 Prof. Anna Labella Formal Methods in software development.

Slides:



Advertisements
Similar presentations
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Advertisements

LIFE CYCLE MODELS FORMAL TRANSFORMATION
Software Processes Coherent sets of activities for specifying, designing, implementing and testing software systems.
Design & Analysis of Algoritms
ISBN Chapter 3 Describing Syntax and Semantics.
CS 330 Programming Languages 09 / 19 / 2006 Instructor: Michael Eckmann.
CS 355 – Programming Languages
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
Software Reliability CIS 640 Adapted from the lecture notes by Doron Pelel (
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
Chapter 6: Design of Expert Systems
Formal Methods. Importance of high quality software ● Software has increasingly significant in our everyday activities - manages our bank accounts - pays.
Knowledge Acquisitioning. Definition The transfer and transformation of potential problem solving expertise from some knowledge source to a program.
Chapter 1 Software Development. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 1-2 Chapter Objectives Discuss the goals of software development.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
1 Lecture 5 Introduction to Software Engineering Overview  What is Software Engineering  Software Engineering Issues  Waterfall Model  Waterfall Model.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Software Engineering Tools and Methods Presented by: Mohammad Enamur Rashid( ) Mohammad Rashim Uddin( ) Masud Ur Rahman( )
Acquiring Information Systems and Applications
Chapter 3 Software Processes.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Knowledge representation
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software Processes.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
©Ian Sommerville 2000, Mejia-Alvarez 2009 Slide 1 Software Processes l Coherent sets of activities for specifying, designing, implementing and testing.
Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
Chapter 2: Software Process Omar Meqdadi SE 2730 Lecture 2 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 3 Slide 1 Software Processes l Coherent sets of activities for specifying, designing,
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
Discrete Structures for Computing
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
1 Introduction to Software Engineering Lecture 1.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
FDT Foil no 1 On Methodology from Domain to System Descriptions by Rolv Bræk NTNU Workshop on Philosophy and Applicablitiy of Formal Languages Geneve 15.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Chapter 3 Part II Describing Syntax and Semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Software Defects.
1-1 Software Development Objectives: Discuss the goals of software development Identify various aspects of software quality Examine two development life.
Formal Methods.
An Axiomatic Basis for Computer Programming Robert Stewart.
Compiler Construction (CS-636)
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
Winter 2011SEG Chapter 11 Chapter 1 (Part 1) Review from previous courses Subject 1: The Software Development Process.
Science and Technology Norwegian University of NTNU Rolv Bræk, January Introduction to Systems Engineering by Rolv Bræk NTNU.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Course: Software Engineering – Design I IntroductionSlide Number 1 What is a specification Description of a (computer) system, which:  is precise;  defines.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
Sub-fields of computer science. Sub-fields of computer science.
Chapter3:Software Processes
Formal Methods in software development
Definition CASE tools are software systems that are intended to provide automated support for routine activities in the software process such as editing.
Compiler Lecture 1 CS510.
Compiler Construction
IS 2935: Developing Secure Systems
Programming Languages 2nd edition Tucker and Noonan
Formal Methods in software development
Chapter 10: Compilers and Language Translation
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

3/17/20161 a.a.2015/2016 Prof. Anna Labella Formal Methods in software development

Speaking of formal methods: where computer Science is? 3/17/ Between analytical a priori (as mathematics) and synthetic a posteriori (as earth sciences)... Where computer science is? Gilles Dowek (2013): computer science is a analytical a posteriori science.

3/17/ Microsoft's Research in Software Engineering in Redmond, USA. “ Our mission is to advance the state of the art in SE, to bring those advances to Microsoft ’ s business, and to take care of those SE technologies that are critical to the company, but not inherently linked to particular products. ” The opinion by industry Research in Software Engineering (RiSE) RiSE understands the importance of logic and builds powerful inference engines that help understand complex systems. ▪ Tools: Z3...Z3... Projects: DKAL LAI L&F M3DKALLAIL&FM3 Logic is the calculus of computation Amir Pnueli.

3/17/ This course is intended to give an introduction to formal methods for the specification, development and testing of software It aims to introduce the main formal methodologies, and show how these are applied in software development. Textbook: there is not a real textbook; all lessons will be available on the site of the course. A survey can be found in: “Understanding formal methods” by J.-F. Monin Springer, ©2003 But it is more useful to follow some chapters of “Logic in Computer Science” by Huth Ryan (2nd edition) freely downloadable The rest of the material can be found in a Dropbox special folder.

3/17/ need for formalization of requirements for the production of the software, i.e. translate requirements expressed in the current language form in conditions for the development of software The problems that we face (1)

3/17/ the problem of producing a secure software in the sense of absolute reliability: examples of critical situations Economy in formalisation The problems that we face (2)

3/17/ From a semi-formal and graphical language as: statecharts and UML to “describe” to a formal language “speak about”. We are looking for a language to model and reason about computer system. To this purpose we need to improve our logical knowledge. The strategy (1)

3/17/ Maybe in the future the special kinds of logics we are going to expose, will be obsolete, but we are trying to establish a method. Already now we had to choose between several possible formalisations. The strategy (1)

3/17/  It is necessary to choose a suitable programming language and, according to its primitives,  Build a mathematical model Beyond formalisation, a proof method. The strategy (2)

3/17/ What is a method? Something that gives the means to achieve a certain goal Example: physics In computer science, we are still in a relatively primitive stadium: what we usually have is only a formal technique

3/17/ A compiler is a computer program (or a set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language), with the latter often having a binary form known as object code. The most common reason for converting source code is to create an executable program. The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language or machine code). An example (the first one in c.s.) of working method: compilers

3/17/ In order to construct a compiler, first the grammar of the source language is defined in the BNF using formal rules, Hence the mathematical substratum is formal languages theory A compiler is likely to perform many or all of the following operations: lexical analysis, preprocessing, parsing, semantic analysis (syntax-directed translation), code generation, and code optimization. Program faults caused by incorrect compiler behavior can be very difficult to track down and work around; therefore, compiler implementors invest significant effort to ensure compiler correctness.

3/17/ What is the use of formal methods? Introducing new concepts Avoiding errors

3/17/ Introducing new concepts Software development - life cycle Costing of the various phases Evaluation of the cost of design errors

3/17/ Avoiding errors The errors are not only expensive and difficult to correct But can lead to critical situations

3/17/ The first flight of the Ariane 5 ( Ariane 5 flight 501 ) held June 4, 1996 failed and the rocket self-destructed 40 seconds after launch because of a malfunction of the control software, created by one of the most famous bug in the history. A value in 64-bit floating point, probably the one of the pressure, was converted in a 16-bit integer with a sign. This caused a trap (operational error) in the processor: the number was too large to be represented with a 16-bit integer. Efficiency reasons had pushed designers to disable the control software (written in Ada ) on the trap, although other similar conversions in the code were correct. This error unleashed a reactions chain that caused the destructive deviation of the rocket because of the enormous aerodynamic forces. It was necessary almost a year and a half to understand what was the malfunction that led to the destruction of the rocket.

3/17/ Why formalisation? In terms of specific requirements it is useful to understand what actually is needed and to check the validity of certain properties that are required (rapid prototyping)

3/17/ Suppose you are working for a software company and your task is to write programs which are meant to solve sophisticated problems, or computations. Typically, such a project involves an outside customer – a utility company, for example – who has written up an informal description, in plain English, of the real-world task that is at hand. In this case, it could be the development and maintenance of a database of electricity accounts with all the possible applications of that – automated billing, customer service etc. Since the informality of such descriptions may cause ambiguities which eventually could result in serious and expensive design flaws, it is desirable to condense all the requirements of such a project into formal specifications. These formal specifications are usually symbolic encodings of real-world constraints into some sort of logic.

3/17/ Thus, a framework for producing the software could be: Convert the informal description R of requirements for an application domain into an ‘equivalent’ formula φ R of some symbolic logic; Write a program P which is meant to realise φ R in the programming environment supplied by your company, or wanted by the particular customer; Prove that the program P satisfies the formula φ R. The next phase of the software development framework involves constructing the program P and after that the last task is to verify that P satisfies φ R. Here again, our framework is oversimplifying what goes on in practice, since often proving that P satisfies its specification φ R goes hand-in-hand with inventing a suitable P. (From Huth Ryan book)

3/17/ A specification language must: Be formal Founded on a mathematical theory (semantics) Allow proofs of properties Enable the development of support tools

3/17/ Advantages The verification of the properties to meet is made a priori This is not a test by cases, but a proof that came with the software product

3/17/ Difficulties Stiffness of any formalization, especially in complex cases Acquisition of a new "language ” Slow start

3/17/ An overview Which kind of theory? Transition systems Set theory Universal Algebra Lambda-calculus, etc. An application field Data processing Real-time systems Protocols, etc. A community of use

3/17/ Specific and general methods Shaping the individual aspects of the system software: architectures, interfaces, visible behaviors, algorithms … Provide a mathematical context: choices are differed, but often one is not so “methodological"

3/17/ Specifying and verifying We will deal with the problem of specifying and verifying and of relationships between them Though their actual implementation will be left to other courses; e.g. Automatic Software Verification Methods

3/17/ Great variety of mathematical theories Logical Methods (terms are proofs) Algebraic Methods (terms are objects)

3/17/ Logical methods Terms are elementary inferences: states and transitions We compose them in proofs

3/17/ Algebraic methods Terms are objects (denotational semantics) We compose and decompose them via operations

3/17/ Distributed computing Processes (operational semantics: abstract machine metaphor)

Program of the course Temporal Logics and Model checking Hoare Logic and verification of programs Reactive systems and Hennessy-Milner logic Denotational semantics 3/17/

Preliminaries Propositional and predicative Logics in the form of sequent calculus: from that we will introduce temporal logic Order structures: from that we will introduce cpo 3/17/

…..final examination A project in collaboration + an interview over a part of the program, or an interview over all the program the interview on a part of the program is alternative to a written midterm proof 3/17/