Formal Method An Software
Formal Method An Software
• Modules include
• AN OVERVIEW OF FORMAL METHODS AND SOFTWARE DEVELOPMENT
• FORMAL METHODS
• SOFTWARE DEVELOPMENT OVERVIEW
• OVERVIEW OF SOFTWARE DESIGN, ANALYSIS AND DESIGN TOOLS, DESIGN
STRATEGIES AND USER INTERFACE BASICS
• OVERVIEW OF DESIGN COMPLEXITY, SOFTWARE IMPLEMENTATION, TESTING,
MAINTENANCE AND CASE TOOLS
• However, physical models cannot solve all problems for obvious reasons
• It may be difficult or highly expensive to build a physical model
of the phenomenon under study
Several errors can occur during this process too, both during the
informal steps 1 and 3 and during computation of step 2.
• As such it abstract away from many fine details and reflects only on certain
macroscopic properties of their aggregate behavior
• It is exactly through abstraction that our models allow us to master the enormous
complexity of real phenomena
• In other words the abstraction embodied by the model captures exactly all
properties of the phenomenon which embodies certain abstraction
Example
In a yard there are both chickens and rabbits. The total
number is 20. furthermore, the total number of legs is 60. how
many chickens and rabbits are in the yard?
Suggestions ?
A background knowledge of equation would probably be required
And the thinking may be in the following ways
• The known facts about the animals in the yard can be represented
by the following equations
2x +4Y= 60 ...........(2)
• The solution to the equation yield x = 10 and y =10
• H= U + ½.g.t2
H=1/2.g.t2
• Your reading materials contains the details of the formal method for
this course. Please do well to o a thorough study for this facilitation
to be of help to your understanding
• Finite state automata basics and
theory
The theory of computation begins with a question: What is a computer? It is
perhaps a silly question, as everyone knows that this “thing I type on” is a
computer.
We begin with the simplest model, called the finite state machine or finite
automaton.
• FINITE AUTOMATA
Finite automata are good models for computers with an extremely limited amount of
memory.
What can a computer do with such a small memory? Many useful things!
In fact, we interact with such computers all the time, as they lie at the heart of
various electromechanical devices.
The controller for an automatic door is one example of such a device. Often found at
supermarket entrances and exits, automatic doors swing open when sensing that a
person is approaching.
An automatic door has a pad in front to detect the presence of a person about to
walk through the doorway.
Another pad is located to the rear of the doorway so that the controller can hold the
door open long enough for the person to pass all the way through and also so that the
door does not strike someone standing behind it as it opens. This configuration is
shown in the following figure.
The controller is in either of two states: "OPEN"
or "CLOSED," representing the corresponding
condition of the door.
But if the input FRONT arrives, it moves to the OPEN state. In the
OPEN state, if input FRONT, REAR, or BOTH is received, it remains in
OPEN. If input NEITHER arrives, it returns to CLOSED.
• For example, a controller might start in state CLOSED and receive the series of
input signals FRONT, REAR, NEITHER, FRONT, BOTH, NEITHER, REAR, and
NEITHER.
• It then would go through the series of states CLOSED (starting), OPEN, OPEN,
CLOSED, OPEN, OPEN, CLOSED, CLOSED, and CLOSED
• This controller is a computer that has just a single bit of memory, capable of
recording which of the two states the controller is in.
• T = TRUE F = FALSE
• Compound Propositions
Compound propositions can be made up from simpler ones in such
a way that their truth value can be determined from those of
their constituents using truth tables.
Note that you don’t need to know what the statements are –
just whether they are true or false.
“p or q” by p + q.
Implication
• very much misunderstood — implication. The
definition of “p implies q” is given by its truth table
• Notation: We denote “p implies q” by p → q. Sometimes
this is written as p ⇒ q or p ⊃ q.
• The problem with this definition is the third row which says that a false
proposition implies a true one
• It might be the case that I’m wealthy and that I’m honest. In the ordinary
sense of the word we would not say however that “being wealthy implies that I am
honest”. Wealth does not cause honesty.
• However if both propositions are true for me then, in the sense of propositional
logic, “I am wealthy” implies “I am honest”.
• Because propositional logic deals with isolated propositions it cannot express the
notion of wealthy people always being honest (or its negation). That requires
• Equivalence
• We say that p is (logically) equivalent to q if they have the same
truth value.
• It is denoted by “p is equivalent to q” and p ↔ q.
• Other notations in use are p ≡ q and p ⇔ q.
• This definition can be set out in a truth table:
Summary of Truth Operators
• Tautologies
• A tautology is a proposition built up from primitive propositions, which is
always true irrespective of the truth values of the constituent
propositions.
• Tautologies are logical theorems.
For example
• “(p and q) implies (q and p)” doesn’t give us any information about the
statements p and q. Rather it tells us about the symmetry of the “and”
operator.
(16) (p → q) ∧ p → q
A syllogism is a logical argument of the form:
p→q
But p.
Therefore q.
• Proof by Contradiction:
(17) (p → q) ∧ −q → −p
• The resulting propositions have truth values that depend on those elements.
• An n-ary predicate is one which applies to a combination of n elements.
Special terms are unary if n = 1, binary if n = 2 and ternary if n = 3. A unary
predicate is what we usually think of as a property, such as “x is even” or “x is
female”.
• In the case of E it might be the set of integers and in the case of F it might
be the set of all students in a particular class.
• Software Engineering
• Industrial manufacturing and distribution is completely
computerized, as is the financial system.
• Custom software systems are still important for large businesses, government
and public bodies.
Project-based
software
• Thank you for listening