Presentation is loading. Please wait.

Presentation is loading. Please wait.

IntroductionIntroduction Copyright, 2000 © Jerzy R. Nawrocki Models and Analysis.

Similar presentations


Presentation on theme: "IntroductionIntroduction Copyright, 2000 © Jerzy R. Nawrocki Models and Analysis."— Presentation transcript:

1 IntroductionIntroduction Copyright, 2000 © Jerzy R. Nawrocki Jerzy.Nawrocki@put.poznan.pl www.cs.put.poznan.pl/jnawrocki/mse/models/ Models and Analysis of Software Lecture 1 Models and Analysis of Software Lecture 1

2 J. Nawrocki, Models & Analysis of Software Plan of the lecture Specification styles A model-based specification An axiomatic specification An unexpected specification Course organisation

3 J. Nawrocki, Models & Analysis of Software Specification styles Formal methods Model-basedModel-basedAxiomaticAxiomatic ImperativeImperativeDeclarativeDeclarative FunctionalFunctionalLogicalLogical AlgebraicAlgebraic

4 J. Nawrocki, Models & Analysis of Software Plan of the lecture Specification styles A model-based specification An axiomatic specification An unexpected specification Course organisation

5 J. Nawrocki, Models & Analysis of Software A model-based specification Directory = Name TelephoneNo state telbook of dir: Directory dir: Directoryend Directory = Name TelephoneNo state telbook of dir: Directory dir: Directoryend INIT() ext wr dir: Directory; ext wr dir: Directory; post dir = {}; post dir = {};INIT() ext wr dir: Directory; ext wr dir: Directory; post dir = {}; post dir = {}; m

6 J. Nawrocki, Models & Analysis of Software A model-based specification Directory = Name TelephoneNo state telbook of dir: Directory dir: Directoryend Directory = Name TelephoneNo state telbook of dir: Directory dir: Directoryend INIT() ext wr dir: Directory; ext wr dir: Directory; post dir = {}; post dir = {};INIT() ext wr dir: Directory; ext wr dir: Directory; post dir = {}; post dir = {}; ADD (name: Name, telno: TelephoneNo) ext wr dir: Directory; ext wr dir: Directory; post dir = dir {name telno}; post dir = dir {name telno}; ADD (name: Name, telno: TelephoneNo) ext wr dir: Directory; ext wr dir: Directory; post dir = dir {name telno}; post dir = dir {name telno}; m

7 J. Nawrocki, Models & Analysis of Software A model-based specification Directory = Name TelephoneNo state telbook of dir: Directory dir: Directoryend Directory = Name TelephoneNo state telbook of dir: Directory dir: Directoryend INIT() ext wr dir: Directory; ext wr dir: Directory; post dir = {}; post dir = {};INIT() ext wr dir: Directory; ext wr dir: Directory; post dir = {}; post dir = {}; ADD (name: Name, telno: TelephoneNo) ext wr dir: Directory; ext wr dir: Directory; post dir = dir {name telno}; post dir = dir {name telno}; ADD (name: Name, telno: TelephoneNo) ext wr dir: Directory; ext wr dir: Directory; post dir = dir {name telno}; post dir = dir {name telno}; LOOKUP (name: Name) r: TelephoneNo ext rd dir: Directory; ext rd dir: Directory; pre name dom dir; pre name dom dir; post dir (name); post dir (name); LOOKUP (name: Name) r: TelephoneNo ext rd dir: Directory; ext rd dir: Directory; pre name dom dir; pre name dom dir; post dir (name); post dir (name); m

8 J. Nawrocki, Models & Analysis of Software A model-based specification Directory = Name TelephoneNo state telbook of dir: Directory dir: Directoryend Directory = Name TelephoneNo state telbook of dir: Directory dir: Directoryend INIT() ext wr dir: Directory; ext wr dir: Directory; post dir = {}; post dir = {};INIT() ext wr dir: Directory; ext wr dir: Directory; post dir = {}; post dir = {}; ADD (name: Name, telno: TelephoneNo) ext wr dir: Directory; ext wr dir: Directory; post dir = dir {name telno}; post dir = dir {name telno}; ADD (name: Name, telno: TelephoneNo) ext wr dir: Directory; ext wr dir: Directory; post dir = dir {name telno}; post dir = dir {name telno}; LOOKUP (name: Name) r: TelephoneNo ext rd dir: Directory; ext rd dir: Directory; pre name dom dir; pre name dom dir; post dir (name); post dir (name); LOOKUP (name: Name) r: TelephoneNo ext rd dir: Directory; ext rd dir: Directory; pre name dom dir; pre name dom dir; post dir (name); post dir (name); DELETE (name: Name) ext wr dir: Directory; ext wr dir: Directory; post dir = {name} dir ; post dir = {name} dir ; DELETE (name: Name) ext wr dir: Directory; ext wr dir: Directory; post dir = {name} dir ; post dir = {name} dir ; m

9 J. Nawrocki, Models & Analysis of Software Plan of the lecture Specification styles A model-based specification An axiomatic specification An unexpected specification Course organisation

10 J. Nawrocki, Models & Analysis of Software An axiomatic specification scheme DIRECTORY = class type Name, PhoneNo, Dir value empty: Dir, add: Name x PhoneNo x Dir Dir, add: Name x PhoneNo x Dir Dir, lookup: Name x Dir PhoneNo, lookup: Name x Dir PhoneNo, delete: Name x Dir Dir delete: Name x Dir Dir scheme DIRECTORY = class type Name, PhoneNo, Dir value empty: Dir, add: Name x PhoneNo x Dir Dir, add: Name x PhoneNo x Dir Dir, lookup: Name x Dir PhoneNo, lookup: Name x Dir PhoneNo, delete: Name x Dir Dir delete: Name x Dir Dir axiom forall name, name1: Name, t: PhoneNo, d: Dir delete (name, empty) empty delete (name, empty) empty delete (name, add(name1, t, d)) delete (name, add(name1, t, d)) if name = name1 if name = name1 then delete (name, d) then delete (name, d) else add (name1, t, delete (name, d)) else add (name1, t, delete (name, d)) end end axiom forall name, name1: Name, t: PhoneNo, d: Dir delete (name, empty) empty delete (name, empty) empty delete (name, add(name1, t, d)) delete (name, add(name1, t, d)) if name = name1 if name = name1 then delete (name, d) then delete (name, d) else add (name1, t, delete (name, d)) else add (name1, t, delete (name, d)) end end Not d ?

11 J. Nawrocki, Models & Analysis of Software An axiomatic specification axiom forall name, name1: Name, t: PhoneNo, d: Dir lookup (name, add(name1, t, d)) lookup (name, add(name1, t, d)) if name = name1 then t if name = name1 then t else lookup (name, d) else lookup (name, d) end end pre name = name1 name d pre name = name1 name d axiom forall name, name1: Name, t: PhoneNo, d: Dir lookup (name, add(name1, t, d)) lookup (name, add(name1, t, d)) if name = name1 then t if name = name1 then t else lookup (name, d) else lookup (name, d) end end pre name = name1 name d pre name = name1 name d scheme DIRECTORY = class type Name, PhoneNo, Dir value empty: Dir, add: Name x PhoneNo x Dir Dir, add: Name x PhoneNo x Dir Dir, lookup: Name x Dir PhoneNo, lookup: Name x Dir PhoneNo, delete: Name x Dir Dir delete: Name x Dir Dir scheme DIRECTORY = class type Name, PhoneNo, Dir value empty: Dir, add: Name x PhoneNo x Dir Dir, add: Name x PhoneNo x Dir Dir, lookup: Name x Dir PhoneNo, lookup: Name x Dir PhoneNo, delete: Name x Dir Dir delete: Name x Dir Dir

12 J. Nawrocki, Models & Analysis of Software Plan of the lecture Specification styles A model-based specification An axiomatic specification An unexpected specification Course organisation

13 J. Nawrocki, Models & Analysis of Software Another axiomatic specification type ext_nat_numbers is sorts nat sorts nat opns 0 nat opns 0 nat suc: nat nat suc: nat nat _ + _ : nat, nat nat _ + _ : nat, nat nat type ext_nat_numbers is sorts nat sorts nat opns 0 nat opns 0 nat suc: nat nat suc: nat nat _ + _ : nat, nat nat _ + _ : nat, nat nat eqns forall x,y ofsort nat x + 0 = x; x + 0 = x; x + succ(y) = succ(x+y); x + succ(y) = succ(x+y); eqns forall x,y ofsort nat x + 0 = x; x + 0 = x; x + succ(y) = succ(x+y); x + succ(y) = succ(x+y); int zero () int succ (int x) int plus (int x, int y) int zero () int succ (int x) int plus (int x, int y) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) Our intuition: plus(2, 3)= 5 Our intuition: plus(2, 3)= 5

14 J. Nawrocki, Models & Analysis of Software An unexpected implementation int zero () int succ (int x) int plus (int x, int y) int zero () int succ (int x) int plus (int x, int y) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) Our intuition: plus(2, 3)= 5 Our intuition: plus(2, 3)= 5 int zero () { return 1; } { return 1; } int zero () { return 1; } { return 1; }

15 J. Nawrocki, Models & Analysis of Software An unexpected implementation int zero () int succ (int x) int plus (int x, int y) int zero () int succ (int x) int plus (int x, int y) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) Our intuition: plus(2, 3)= 5 Our intuition: plus(2, 3)= 5 int zero () { return 1; } { return 1; } int zero () { return 1; } { return 1; } int succ (int x) { return 2*x; } { return 2*x; } int succ (int x) { return 2*x; } { return 2*x; }

16 J. Nawrocki, Models & Analysis of Software An unexpected implementation int zero () int succ (int x) int plus (int x, int y) int zero () int succ (int x) int plus (int x, int y) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) Our intuition: plus(2, 3)= 5 Our intuition: plus(2, 3)= 5 int zero () { return 1; } { return 1; } int zero () { return 1; } { return 1; } int succ (int x) { return 2*x; } { return 2*x; } int succ (int x) { return 2*x; } { return 2*x; } int plus (int x, int y) { return x * y; } { return x * y; } int plus (int x, int y) { return x * y; } { return x * y; }

17 J. Nawrocki, Models & Analysis of Software An unexpected implementation x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) x plus(x, zero())= x x plus(x, zero())= x x,y plus(x,succ(y))= succ(plus(x,y)) x,y plus(x,succ(y))= succ(plus(x,y)) Our intuition: plus(2, 3)= 5 Our intuition: plus(2, 3)= 5 int zero () { return 1; } { return 1; } int zero () { return 1; } { return 1; } int succ (int x) { return 2*x; } { return 2*x; } int succ (int x) { return 2*x; } { return 2*x; } int plus (int x, int y) { return x * y; } { return x * y; } int plus (int x, int y) { return x * y; } { return x * y; }... but plus(2,3)= 6 The implementation satisfies those conditions

18 J. Nawrocki, Models & Analysis of Software Plan of the lecture Specification styles A model-based specification An axiomatic specification An unexpected specification Course organisation

19 J. Nawrocki, Models & Analysis of Software Course organisation 28.02 Introduction 7.03 VDM (I) 14.03 VDM (II) 21.03 Statecharts (I) 28.03 Statecharts (II) 4.04 - 11.04 Z 18.04 - 25.04 Petri Nets and CSP Lectures by J. Nawrocki

20 J. Nawrocki, Models & Analysis of Software Course organisation 9.05 Introduction to testing 16.05 Automatic testing 23.05 Rational TestStudio (I) 30.05 Rational TestStudio (II) 6.06 Testing in Practice (B. Nowicki) 13.06 Pre-exam Lectures by W. Complak

21 J. Nawrocki, Models & Analysis of Software Course organisation 10: Presence at lectures & seminars (0.5 each) 30: Presentation at seminar 60: Written exam (13.06) ------------------------------------ 100: Total Grading rules 91.. 100: 5.0 81.. 90: 4.5 71.. 80: 4.0 61.. 70: 3.5 51.. 60: 3.0 91.. 100: 5.0 81.. 90: 4.5 71.. 80: 4.0 61.. 70: 3.5 51.. 60: 3.0

22 J. Nawrocki, Models & Analysis of Software Course organisation Each student has to give a presentation lasting for 20 minutes. Any topic concerning Models & Analysis of Software will be accepted. The presentation does not have to be original. It can be based on someones paper or book. Title, name, e-mail address, keywords and abstract (about half a page) must be submitted to Mr. Complak at least 10 days before the presentation. Schedule will be prepared by Mr. Complak by 7.03. Presentation at seminar

23 J. Nawrocki, Models & Analysis of Software Course organisation Each student has a budget of 189 points. Using the budget he has to evaluate 21 presentations (average is 9 points). A student is not evaluating his/her own presentation. To check this, WC or JN has to know students name. Each presentation can get no more than 10 points. Presentation grade

24 J. Nawrocki, Models & Analysis of Software Course organisation If a student is not able to evaluate a presentation, he/she can put x. Then his budget is lowered by 9 points. Average presentation grade (xs do not count) will be multiplied by 3 to get overall presentation grade. Presentation grade

25 J. Nawrocki, Models & Analysis of Software SummarySummary Model-based specifications: an abstract implementation Axiomatic specifications: relations and superposition Problem of unexpected implementations

26 J. Nawrocki, Models & Analysis of Software Further readings A. Harry, Formal Methods Fact File, John Wiley & Sons, Chichester, 1996 (Chapters 1 - 3).

27 J. Nawrocki, Models & Analysis of Software HomeworkHomework Assess maturity of RE processes in your last-year SDS project Write an HTML document (Requirements Management Policy) describing the list of guidelines you are willing to follow this year

28 J. Nawrocki, Models & Analysis of Software Quality assessment 1. What is your general impression? (1 - 6) 2. Was it too slow or too fast? 3. What important did you learn during the lecture? 4. What to improve and how?


Download ppt "IntroductionIntroduction Copyright, 2000 © Jerzy R. Nawrocki Models and Analysis."

Similar presentations


Ads by Google