Refinement Refine a formal specification by adding more information

Slides:



Advertisements
Similar presentations
Copyright W. Howden1 Programming by Contract CSE 111 6/4/2014.
Advertisements

Service Description: WSDL COMP6017 Topics on Web Services Dr Nicholas Gibbins –
Formal Methods in Software Engineering
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Relational Database Design Algorithms and Further Dependencies.
Primitive Recursive Functions (Chapter 3)
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
25 February 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Giving a formal meaning to “Specialization” In these note we try to give a formal meaning to specifications, implementations, their comparisons. We define.
Formal Semantics of Programming Languages 虞慧群 Topic 5: Axiomatic Semantics.
1 Chapter 4 - Part 1 Software Processes. 2 Software Processes is: Coherent (logically connected) sets of activities for specifying, designing, implementing,
LIFE CYCLE MODELS FORMAL TRANSFORMATION
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
CHAPTER 3 COLLECTIONS Abstract Data Types. 2 A data type consists of a set of values or elements, called its domain, and a set of operators acting on.
CS 582 / CMPE 481 Distributed Systems Fault Tolerance.
Architecture-driven Modeling and Analysis By David Garlan and Bradley Schmerl Presented by Charita Feldman.
CS 330 Programming Languages 09 / 13 / 2007 Instructor: Michael Eckmann.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Operational Semantics.
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
IMS1805 Systems Analysis Topic 3: Doing Analysis (continued from previous weeks)
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Introduction and Syntax. Course objectives Discuss features of programming languages. Discuss how the features are implemented in a simple computer architecture.
Describing Syntax and Semantics
July 14, 2015ICS 424: recap1 Relational Database Design: Recap of ICS 324.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
Software Models (Cont.) 9/22/2015ICS 413 – Software Engineering1 -Component-based software engineering -Formal Development Model.
Logical view –show classes and objects Process view –models the executables Implementation view –Files, configuration and versions Deployment view –Physical.
Requirements Engineering-Based Conceptual Modelling From: Requirements Engineering E. Insfran, O. Pastor and R. Wieringa Presented by Chin-Yi Tsai.
1 OO Analysis & Design - Introduction to main ideas in OO Analysis & design - Practical experience in applying ideas.
Specifying Languages Our aim is to be able to specify languages for use in the computer. The sketch of an FSA is easy for us to understand, but difficult.
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.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Duminda WijesekeraSWSE 623: Introduction1 Introduction to Formal and Semi- formal Methods Based on A Specifier's Introduction to Formal Methods (J. Wing)
Requirements Engineering Methods for Requirements Engineering Lecture-31.
Recap Introduction to Inheritance Inheritance in C++ IS-A Relationship Polymorphism in Inheritance Classes in Inheritance Visibility Rules Constructor.
Ivan Lanese Computer Science Department University of Bologna/INRIA Italy Adaptive Choreographies Joint work with Mila Dalla Preda, Jacopo Mauro and Maurizio.
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
Formal Methods in SE Lecture 21.
SECTION 2 SETUP, WRITING AND CREATING
Principles of programming languages 8: Types
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
Object Oriented Concepts -I
Choreographies: the idea
Algorithm and Ambiguity
Software Design Methodology
(edited by Nadia Al-Ghreimil)
Chapter 5 Structures.
UML Sequence Diagrams.
Problem Solving Techniques
Informatics 121 Software Design I
Program A sequence of operations on a data type.
Lectures on Graph Algorithms: searching, testing and sorting
Event-Based Architecture Definition Language
Denotational Semantics (Denotational Semantics)
Definition Moves of the PDA Languages of the PDA Deterministic PDA’s
Algorithm and Ambiguity
Definition Moves of the PDA Languages of the PDA Deterministic PDA’s
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
… NPDAs continued.
Algebraic Specification Software Specification Lecture 34
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Totalization To define refinement for partial relations, we consider their totalised forms: where X = X ⋃ {⊥} Y = Y ⋃ {⊥}
CSCI 2670 Introduction to Theory of Computing
SPL – PS1 Introduction to C++.
Presentation transcript:

Refinement Refine a formal specification by adding more information Consistency and correctness The refinement leads us towards implementation

Abstract Data Types An abstract data type combines a description of state with description of operations upon that state. A == (AState, AInit, AOp1, AOp2, …) We may use abstract data types to specify the behavior of system components

Refinement Removal of some degree of non-determinism Several refinement steps may be performed until the specification approaches executable program code.

Questions Why might we want different views of the same system? What makes two different views consistent? What makes two consistent views different?

Refinement relation Data type B is called a refined of A iff every interaction with B could have been an interaction with A A ⊑ B

Proper Refinement It is quite possible that A ⊑ B but B ⋢ A This will be the case when description B has resolved some of the uncertainty present in A the effect of at least one of the operations is now more precisely defined.

Refinement Ordering If B is a refinement of A, and C is a refined of B, then C is also a refinement of A.

ResourceManagerA AllocateA freeA: ℙ ℕ AllocateA ∆ ResourceManagerA r!: ℕ r! ∈ freeA ∧ freeA’ = freeA \ {r!} If there is more than one available resource then this specification is non-deterministic It is also partial – does not state what is to be done if there are no free resources

non-determinism is resolved as long as there is at least one resource ResourceManagerB freeB: ℙ ℕ AllocateB ∆ ResourceManagerB r!: ℕ r! ∈ min freeB ∧ freeB’ = freeB \ {r!} non-determinism is resolved as long as there is at least one resource Still partial

Refinement to code The refinement of state components and operations can take us to executable code We replace the components of the state – sets, relations, sequences – with data structures from our chosen implementation language We resolve any non-determinisim present in the description of operations

ResourceManagerD freeD: array of bits

Data refinement and relations To derive a formal definition of refinement, and hence a set of useful proof rules, we consider the semantics of operations. An operation may be seen as a relations between states: one state is related to another if the system could start in the first and end up in the second. Our definition of refinement for data types will depend upon a similar definition of refinement for relations.

Total Relations Refinement of total relations is easily defined. If R and S are total relations, then R ⊑ S  S ⊆ R Whenever R relates the same element x to two distinct elements y1 and y2 , S may omit either x ↦ y1 or x ↦ y2

Totalization To define refinement for partial relations, we consider their totalised forms: where X = X ⋃ {⊥} Y = Y ⋃ {⊥}