Download presentation
Presentation is loading. Please wait.
1
Formal Methods
2
Importance of high quality software ● Software has increasingly significant in our everyday activities - manages our bank accounts - pays our salaries - controls aircraft we fly in - regulates power generation and distribution - controls our communication - etc
3
Importance of high quality software ● Characteristics of high quality software (some) - easy to use - efficient - correct - many more....
4
Typical software cycle ● Requirement analysis : determine user needs ● Specification : describe precisely what the role of the software will be ● Design : determine how to realize the software, and devise overall organization ● Implementation : formulate the algorithms and program ● Verification : certify that the program meet the specification ● Maintenance : perform ongoing changes and corrections after the software is in use
5
Precision in the specification of software
6
Why formal methods ● The interpretation of natural languages ● The manipulation of specifications
7
Natural Language Specification ● Ambiguity - multiple meaning and interpretation - inferred from surrounding text eg. The program will take a sequence of numbers and return a sorted list. What is wrong with this?
8
Natural Language Specification ● Incompleteness and vagueness - be specific eg. how many numbers do we input? When is the sorted output?
9
Natural Language Specification ● Contradiction - may contain statements at odds with each other eg. When the retrieve function is activated the beta file will be locked and no other access allowed. The retrieve function is activated by pressing the F1 function.
10
Advantages of formal methods ● Formal specifications allow precise interpretation; there is therefore no possibility of arguments about what has been specified ● Formal methods allow systems to be defined in abstract terms; in particular developers can look at what a system is to do before becoming bogged down in detail as to how it is to be accomplished ● A formal methodology demands attention to issues of completeness and consistency, therefore reducing the chances of overlooking certain areas or situations which could cause errors or bugs ● The use of formal methodology allows the progressive refinement of an abstract specification into a concrete specification uisng well- defined rules. This lead to the possibility of generating programs from formal specifications automatically ● Using formal descriptions it is possible to detect deviations of a program from its original specification.
11
Question? Formal methods can guarantee that software is perfect; do you think so?
12
Requirements of a Formal System For a formal methodology to be complete it must be able to fulfil the following requirements: ● Specification : it must be possible to state what a program is meant to do in a formal precise way ● Verification: given the specification and a program obtained, it should be possible to prove using formal mathematical methods that the program does what the specification states
13
Formal development process ● After-the-fact verification requirement Pre- design Detailed design code Formal spec
14
Formal development process ● parallel requirement Pre- design Detailed design code low-level Formal spec High-level formal spec
15
Formal development process ● Integrated requirement Formal pre-design specification Formal Detailed design spec code
16
Concepts used ● Set theory - membership of a set - subset - powerset -operation on a set - cardinality - cartesian products
17
Concepts used ● Types - predefined basic type - user defined types - compound types - product types - enumerated types ● sequences
18
Concepts used ● Formal Logic - propositional logic - law of equivalence - tautologies - predicate logic - quantification
19
Concepts used ● Relationships and functions - function - operations on function - total function, partial function - injective, surjective, bijective functions
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.