Professional Documents
Culture Documents
METHODS
Lecture 4: Formal Specification
LECTURER: QURATULAIN
DEPARTMENT OF INFORMATION TECHNOLOGY
GOVERNMENT COLLEGE UNIVERSITY FAISALABAD
let me remind you
What was today's topic
Formal Specification
Formal Methods are a particular kind of mathematically based technique for
the Specification, Development and Verification of software and hardware systems.
Formal Specification
In computer science, formal specifications are
mathematically based techniques whose purpose are to
help with the implementation of systems and software.
They are used to describe a system, to analyze its behavior, and to
aid in its design by verifying key properties of interest through
rigorous and effective reasoning tools.
These specifications are formal in the sense that
they have a syntax, their semantics fall within
one domain, and they are able to be used to infer
Branch of linguistics and logic
concerned with meaning.
لسانیات
useful information.
Study of language and its structure
This is where normal system specification is use
and translated using a formal language into a
formal specification. Syntax
Semantics
Programmatic
DJI Mavic 2
There are basically two type of formal language;
Model Oriented: Construct a Property Oriented: Use a set of
model of the system behavior necessary properties to describe
using mathematical objects like system behavior, such as axioms
sets, sequences etc. اصول, rules etc.
Statecharts, SCR, VDM, Z Algebraic semantics
Petri Nets, CCS, CSP, Temporal logic models.
Automata theoretic models
This is the cheapest way to handle formal method.
In computer science, algebraic semantics is a form of axiomatic semantics based on
algebraic laws for describing and reasoning about program semantics in a formal manner.
Axiomatic semantics Programming semantics
is an approach based on is the field concerned with the rigorous
mathematical logic for proving the سختmathematical study of the meaning
correctness of computer programs. of programming languages.
The formal specification generally does the following process.
1. Get user requirement usually from the specification written in the natural language.
2. Clarify the requirement using mathematical approach. This is to remove all ambiguous, incomplete and
inconsistent statement.
3. After statements are clearly identified. Then find all assumptions (Things that must be in place before
something can happen) that is state or not stated within the clarified requirement.
4. Then expose every possible logic defect (fault) or omission in the clarified requirement.
5. Identify what are the exceptions (bad things) that will arise if the defects are not corrected.
6. Find a way to test for all the possible each exception. Only when you can test for an exception can you be
able to stop that exception from happening
Conclusion
In computer science, formal specifications are mathematically based techniques whose
purpose are to help with the implementation of systems and software.
These specifications are formal in the sense that they have a syntax, their semantics fall
within one domain, and they are able to be used to infer useful information.
Model Oriented: Construct a Property Oriented: Use a set of
model of the system behavior necessary properties to describe
using mathematical objects like system behavior, such as axioms
sets, sequences etc. اصول, rules etc.
Statecharts, SCR, VDM, Z Algebraic semantics
Petri Nets, CCS, CSP, Temporal logic models.
Automata theoretic models
Creating software need not use formal method, having said that, having formal
method imbedded into the SDLC does give the software huge advantages and also a
new set of disadvantages.
Advantages Disadvantages
1. Discovers ambiguity, incompleteness, and 1. Time consuming and expensive.
inconsistency in the software. 2. Difficult to use this model as a communication
2. Offers defect-free software. mechanism for non technical personnel.
3. Incrementally grows in effective solution after 3. Extensive training is required since only few
each iteration. developers have the essential knowledge to
4. This model does not involve high complexity implement this model.
rate.
5. Formal specification language verify self-
consistency.
CRITICAL SYSTEM
A critical system is a system which must be highly reliable and retain
this reliability as they evolve without incurring prohibitive costs.
Critical system essentials
Safety: The system should not A critical system is rarely a single
harm people or the system’s system but is a network of several
environment software-intensive systems as well
Security: The system must be as infrastructure systems
able to protect itself and its data Systems of systems
from malicious use
(SoS)
Availability: The system must be
available to deliver services when
requested to do so
Reliability: The system must
operate without serious failures
Systems of systems (SoS)
System of systems is a collection of task-oriented or
dedicated systems that pool their resources and
capabilities together to create a new, more complex system
which offers more functionality and performance than simply
the sum of the constituent systems.
Likewise, critical systems are further distinguished between fail-operational and fail safe systems,
according to the tolerance they must exhibit to failures:
Fail-Operational Fail-safe
Typically required to operate not only in Must safely shut down in case of single or
nominal conditions (expected), but also multiple failures.
in degraded situations when some parts
are not working properly. For example, Trains are fail-safe systems
For example, airplanes are fail- because stopping a train is typically
operational because they must be able to sufficient to put into safe state.
fly even if some components fail.
BUSINESS CRITICAL SYSTEM
Business Critical System refers to a system where the honesty and integrity ()سالمیت
of the business is paramount.
All data kept in the system must be accurate at all times. If a fault is found the entire
process must be stop to allow correction.
• Customer account system in a bank.
• Online shopping cart.
Most government, business and
• Areas where secrecy is required.
manufacturing company that
• Defense.
requires payment are business
critical.
• Secret service.
• Sensitive areas in companies.
• Areas where personal data are administered.
• Police records.
• Administration of data of customers.
• Administration of student marks.
MISSION CRITICAL SYSTEM
Mission Critical System refers to a system where the continuous running of the
system is paramount. Accurate takes a lower priority compare to the running of
the system.
Examples
Auto Teller Machine,
Car ticketing system,
Alarm Systems are mission critical.
SAFETY CRITICAL SYSTEM
Safety Critical System refers to a system where the safety of everyone directly or
indirectly affected by the system is paramount.
Functionality and Accurate takes a lower priority compare to the safety of the users.
Most medical, construction and oil rig systems are safety critical system.
• Medical Devices.
• Aerospace Civil aviation.
• Military aviation.
• Manned space travel Chemical Industry.
• Nuclear Power Stations.
• Traffic control. Railway control system.
• Air traffic control.
• Road traffic control (esp. traffic lights).
• Automotive control systems.
• Other military equipment.
SECURITY CRITICAL SYSTEM
Security critical systems deal with the loss of
sensitive data through theft or accidental loss.
• Credit card numbers.
• Medical record
• Contracts
Formal method converts “Statement it into its mathematical equivalent.