Formal Methods in Software Engineering
Formal Methods in Software Engineering
Formal Methods in Software Engineering
Lecture 07
What is Temporal Logic?
In concurrent reactive systems, correctness not only validates the correct input
and output of the computational system, but also objectively monitors the
execution of the system.
Temporal logics have played vital role in formal verification wherever needed to
state the specification requirements for hardware and software systems.
Time: It represents the set of rules for reasoning in terms of time and the time
domain is expressed in terms of state.
Reasoning in the temporal logic is much easier with the translation into the
predicate calculus because relationship among time is implicit manner.
Temporal Logic Operators
Temporal logic has introduced some additional operators that represent the
time variable and reflect their relationships.
With the set of temporal operators, these enable the definition of formulas with
the accessibility relation.
The first three operators are unary whereas the last one is binary
Computational Paths, System run
Safety property means “something bad must not happen”. E.g.: system should not crash.
Liveness property means “something good must happen”. E.g.: every packet sent must
be received at its destination
Guarantee of Service states that if one process sends a request, it must have to be
responded by other process.
Mutually exclusion occur when two processes execute concurrently at the same critical
section. Then, it is prescribed as “bad thing”.
Temporal Logic Operators
Temporal Logic Operators
Globally (Always) p: G p
G p is true for a computation path if p holds at all states
(points of time) along the path
Temporal Logic Operators
Eventually p: F p
F p is true for a path if p holds at some state along that
path
Temporal Logic Operators
Next p: X p
X p is true along a path starting in state si (suffix of the
main path) if p holds in the next state si+1
Temporal Logic Operators
GFp
FGp
G( p F q )
F( p (X X q) )
Temporal Logic Operators
p Until q: p U q
p U q is true along a path starting at s if
q is true in some state reachable from s
p is true in all states from s until q holds
Temporal Logic Types
There are two types of temporal logics, each having their own temporal
operators.
Linear Temporal Logic has been proposed as a formal verification tool by Amir
Pnueli.
LTL models time as a sequence of states and the future state is seen as a path
in LTL.
Accordingly, there are different future paths from where any path is taken as an
actual path.
There are many LTL model checking tools available which use LTL as a
property specification language
LTL Syntax
LTL Semantics
LTL Semantics