Formal Methods. Importance of high quality software ● Software has increasingly significant in our everyday activities - manages our bank accounts - pays.
Published byModified over 4 years ago
Presentation on theme: "Formal Methods. Importance of high quality software ● Software has increasingly significant in our everyday activities - manages our bank accounts - pays."— Presentation transcript:
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
Importance of high quality software ● Characteristics of high quality software (some) - easy to use - efficient - correct - many more....
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
Why formal methods ● The interpretation of natural languages ● The manipulation of specifications
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?
Natural Language Specification ● Incompleteness and vagueness - be specific eg. how many numbers do we input? When is the sorted output?
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.
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.
Question? Formal methods can guarantee that software is perfect; do you think so?
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
Formal development process ● After-the-fact verification requirement Pre- design Detailed design code Formal spec
Formal development process ● parallel requirement Pre- design Detailed design code low-level Formal spec High-level formal spec
Formal development process ● Integrated requirement Formal pre-design specification Formal Detailed design spec code
Concepts used ● Set theory - membership of a set - subset - powerset -operation on a set - cardinality - cartesian products
Concepts used ● Types - predefined basic type - user defined types - compound types - product types - enumerated types ● sequences
Concepts used ● Formal Logic - propositional logic - law of equivalence - tautologies - predicate logic - quantification
Concepts used ● Relationships and functions - function - operations on function - total function, partial function - injective, surjective, bijective functions