1 Abstract Model Specification. 2 Explicitly describes behavior in terms of a model using well-defined types (viz. set, sequences, relations, functions)

Slides:



Advertisements
Similar presentations
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn 2.4 The Z Notation [Reference: M. Spivey: The Z Notation, Prentice Hall]
Advertisements

UML an overview.
1 Abstract Model Specification Tarang Garg Srikumar Nagaraj.
Semantics Static semantics Dynamic semantics attribute grammars
25 February 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department.
Architecture Representation
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
The Z Specification Language
Formal Methods: Z CS 415, Software Engineering II Mark Ardis, Rose-Hulman Institute March 18, 2003.
Train Control Language Teaching Computers Interlocking By: J. Endresen, E. Carlson, T. Moen1, K. J. Alme, Haugen, G. K. Olsen & A. Svendsen Synthesizing.
Component-Level Design
Architecture-driven Modeling and Analysis By David Garlan and Bradley Schmerl Presented by Charita Feldman.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
©Ian Sommerville 2000Software Engineering, 6/e, Chapter 91 Formal Specification l Techniques for the unambiguous specification of software.
Chapter 1 Principles of Programming and Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 10 Slide 1 Formal Specification.
Principle of Functional Verification Chapter 1~3 Presenter : Fu-Ching Yang.
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 10 Slide 1 Critical Systems Specification 3 Formal Specification.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 10 Slide 1 Formal Specification.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Introduction To System Analysis and design
Database System Development Lifecycle © Pearson Education Limited 1995, 2005.
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
©Ian Sommerville 2000Software Engineering, 6th edition. Chapter 9 Slide 1 Formal Specification l Techniques for the unambiguous specification of software.
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
WXGE6103 Software Engineering Process and Practice Formal Specification.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Winter 2007, rev. 2008SEG Chapter 21 Chapter 2 Basic Principles.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
Formal Specification and Z CS3300 Fall Formal Specification Produces a mathematical model Typically associated with analysis Differs from design.
Copyright © 2013 Curt Hill UML Unified Modeling Language.
Formal Specification of Intrusion Signatures and Detection Rules By Jean-Philippe Pouzol and Mireille Ducassé 15 th IEEE Computer Security Foundations.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Unit 2 Architectural Styles and Case Studies | Website for Students | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS 1.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics In Text: Chapter 3.
ECSE Software Engineering 1I HO 4 © HY 2012 Lecture 4 Formal Methods A Library System Specification (Continued) From Specification to Design.
Safety-Critical Systems 4 Formal Methods / Modelling
1 Formal Methods in SE Abstract Model Specification Lecture # 19.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
Object-Oriented Programming © 2013 Goodrich, Tamassia, Goldwasser1Object-Oriented Programming.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
CS223: Software Engineering Lecture 13: Software Architecture.
An Object-Z / CSP Based Approach for the Specification of Architectural Connectors Mourad Maouche Philadelphia University Jordan Mohamed Bettaz MESRS Algeria.
ALLOY: A Formal Methods Tool Glenn Gordon Indiana University of Pennsylvania COSC 481- Formal Methods Dr. W. Oblitey 26 April 2005.
DESIGN PROCESS AND CONCEPTS. Design process s/w design is an iterative process through which requirements are translated into a “blueprint” for constructing.
16 April 2011 Alan, Edison, etc, Saturday.. Knowledge, Planning and Robotics 1.Knowledge 2.Types of knowledge 3.Representation of knowledge 4.Planning.
Z-Notation. Abstract Model Specification Explicitly describes behavior in terms of a model using well-defined types (sets, sequences, relations, functions)
The Z Specification Language Based on J. M. Spivey. An Introduction to Z and formal specifications, Software Engineering Journal, 4(1):40-50, January,
Principles of Programming & Software Engineering
Modeling with UML – Class Diagrams
Formal Specification.
Security analysis of COM with Alloy
Cmpe 589 Spring 2006.
Chapter ? Quality Assessment
SysML v2 Formalism: Requirements & Benefits
Principles of Programming and Software Engineering
Component-Level Design
Informatics 121 Software Design I
Component-Level Design
Logical architecture refinement
Chapter 20 Object-Oriented Analysis and Design
Presentation transcript:

1 Abstract Model Specification

2 Explicitly describes behavior in terms of a model using well-defined types (viz. set, sequences, relations, functions) & defines operations by showing effects on model Specification includes type - syntax of object being specified model - underlying structure invariant - properties of modeled object pre/post conditions – semantics of operations

3 Notation Is used to test the results Independent of program code Mathematical Data model Represent both static and dynamic aspects of a system

4 Features( Z-notation) Decompose specification into small pieces (Schemas) Schemas are used to describe both static and dynamic aspects of a system Data Refinement Direct Refinement You can ignore details in order to focus on the aspects of the problem you are interested in

5 Schema Static Aspect  The state can occupy.  The invariant relationships that are maintained as the system moves from state to state

6 Schema(cont.) Dynamic Aspect  The operations that are possible  The relationship between their inputs and outputs.  The change of state that happen.

7 Notation - Example Some variables are declared. Relationship between the values of the variables Name Init Birthday Book Known =  Birthday Book

8 Example Birthday book known: NAME birthday: NAME DATE Known : dom birthday Add Birthday Birthday Book name?: NAME date?: DATE name?  known birthday’ = birthday { name? date}

9 Example(cont.) Find Birthday Birthday book name?: NAME date? : DATE name?  Known date != birthday(name?)

10 Race condition We have not handled the condition when user tries to add a birthday, which is already known to the system, or tries to find the birthday of someone not known. Handle this by adding an extra result! To each operation. Result := of| already_known | not_known Success Result! : REPORT Result! = ok

11 Operators  (Conjunction of the two predicate parts) – any common variables of the two schemas are merged V (the effect of the schema operator is to make a schema in which the predicate part is the result of joining the predicate parts of its two arguments with the logical connective V ).

12 Logical Conjunction Operator The conjunction operator  of the schema calculus allows us to combine this description with our previous description of AddBirthday AddBirthday  Success This describes an operation which, for correct input, both acts as described by AddBirthday and produces the result ok.

13 Logical Disjunction operator This declaration specifies that if error occurs, the state of the system should not change. Robust version of AddBirthday can be RAddBirthday  (AddBirthday  Success) V Alreadyknown AlreadyKnown BirthdayBook name? : NAME result?: REPORT Name?  known Result! = already_known

14 Use of Operators RAdd Birthday  Birthday Book name?: NAME date?: DATE result!: REPORT (name?  known  birthday’= birthday  {name? Date?}  result!= ok) V (name?  known  birthday’ = birthday  result != already_known)

15 Data Refinement “ to describe the concrete data structures which the program will use to represent the abstract data in the specification, and to derive description of the operation in terms of the concrete data structures” Direct Refinement: method to go directly from abstract specification to program in one step From specification to design

16 Data Refinement Data Structures: Two arrays : names [1…] of NAME dates [1…] of DATES names’ = names  {i v} ; names[i] := v the right side of this equation is a function which takes the same value as names everywhere except at the argument i, where it takes the value ‘v’.

17 Example(Data and Direct Refinement) FindBirthday1 BirthdayBook1 name?:NAME date?:DATE  i : 1.. hwm name?=names(i)  date! = dates(i) Procedure FindBirthday(name: NAME; var date : DATE); var i: INTEGER; begin i:=1; while names[i]  name do i := i+1; dates := dates[i] end;

18 Advantages  The flexibility to model a specification which can directly lead to the code.  Easy to understand  A large class of structural models can be described in Z without higher – order features, and can thus be analyzed efficiently.  Independent Conditions can be added later

19 Chemical Abstract Model CHAM: for architectural description and analysis. Software Systems chemicals (whose reactions are controlled by explicitly stated rules). Where floating molecules can only interact according to a stated set of reaction rules.

20 Features(CHAM) - Modular specification -Chemical reactions -Molecules (components) -Reactions (Connectors) -Solutions (States of CHAM) -This is used in areas where intended architecture will tend to be large, complex, and assembled from existing components. -Architectural elements: Processing elements, data elements, and connecting elements.

21 Example (File System) Structure of the model –Domain paragraph –State paragraph –Definition paragraph –Invariants –Condition –Assertions –Operations –Assertions

22 Analysis Alloy supports two kinds of analysis –Simulation: Consistency of an invariant or operation is demonstrated by generating a state or transition. –Checking: A consequence of a specification is tested by attempting to generate a counterexample. Together they enable an incremental process of specification.

23 Based On Z Alloy is based on Z because: –Simple and intuitive semantics (based on sets). –Well suited for object oriented modeling. –Data structures are built from concrete mathematical structures.

24 Features Automatic analysis –Theorem proving is deep & automatic. Easier to read and write. Plain ASCII notation. Relational operators are powerful. Incorporates mutability notions from informal notations.

25 Design Faults Omission of the let construct & relational operators No integers No distinction between attributes and relations

26 Formalizing Style to Understand Descriptions of Software Architecture

27 Introduction Software architecture describes a software system Architectural descriptions are informal & diagrammatic Represented by boxes & lines –For one system they may mean filters & pipes –For another system boxes  abstract data types or objects & lines  procedure calls

28 Introduction Different graphical conventions used to describe more than one kind of component or connection type in a single system Generalized meanings to architectural descriptions

29 How is it done? Formalize abstract syntax for architectures For a given style: –Define the semantic model –Discuss concrete syntax for easing syntactic descriptions in a given style –Define the mapping from abstract syntax into semantic model –Make explicit the constraints on the syntax

30 How is it done? Demonstrate analysis within & between formally defined architectural styles

31 Abstract Syntax of Software Architectures Component: –Relationship between component & it’s environment is defined as a collection of interaction points or ports: [PORT, COMPDESC] Component ports : P PORT description : COMPDESC

32 Abstract Syntax of Software Architectures Connectors: –Connector has an interface that consists of a set of roles: [ROLE, CONNDESC] Connector roles : P ROLE description : CONNDESC

33 Abstract Syntax of Software Architectures Instances of components & connectors are identified by naming elements from the syntactic class [COMPNAME, CONNNAME] PortInst == COMPNAME x PORT RoleInst == CONNNAME x ROLE

34 Step 1 (Define Semantic Model) Filter Alphabet : DATAPORT P DATAPORT States : P STATE Start : STATE Transitions : (STATE x (DATAPORT seq DATA)) (STATE x (DATAPORT seq DATA)) Inputs n outputs = o Dom alphabet = inputs u outputs Start  states Inputs, outputs : P DATAPORT s1, s2 : STATE ; ps1, ps2 : DATAPORT seq DATA ((s1, ps1), (s2, ps2))  transitions s1  states  s2  states  dom ps1 = inputs  dom ps2 = outputs  ( i : inputs ran (ps1(i))  alphabet(i))  ( o : outputs ran (ps2(o))  alphabet(o))

35 Step 1 (Define Semantic Model) Pipe source, sink : DATAPORT alphabet : P DATA source = sink

36 Step 2 Define Concrete Syntax FilterDescriptions : P COMPDESC PipeDescription : P CONNDESC

37 Step 3 Mapping from Abstract Syntax to Semantic Model  PF Comp : Connector P Pipe  c : Connector ; p1, p2 : Pipe | p1   PF Comp (c ) p2   PF Comp (c )  p1.alphabet = p2.alphabet

38 Step 4 Highlight the constraints in the syntax LegalPFComponent Component Description  FilterDescriptions

39 Advantages Provides a templates for formalizing new architectural styles in a uniform way Provides uniform criteria for demonstrating that the notational constraints on a style are sufficient to provide meanings for all described systems Makes possible a unified semantic base through which different stylistic interpretations can be compared