Basic Operations on Temporal Logic - Design Verification and Test - Lecture Notes, Study notes of Design and Analysis of Algorithms

Main points of Design Verification and Test are: Basic Operations On Temporal Logic, Represented, Collection, Output Function, Boolean Function, Decision Diagram, Reduced Order Binary, Design Process, Detailed Level, Equivalence Checking

Typology: Study notes

2012/2013

Uploaded on 04/29/2013

awais
awais 🇮🇳

4.3

(15)

148 documents

1 / 56

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Module-IV
Lecture-I
Introduction and Basic Operations on Temporal Logic
1. Introduction
As discussed in the third module of the “Design” part of the course, any digital system
can be represented by a collection of Boolean expressions. Each Boolean expression
represents one output function/signal of the system. In the previous module (of the
“Verification” part of the course) we have discussed one data structure by which we can
represent the Boolean function in an efficient way. It is also mentioned that ROBDD
(Reduced Order Binary Decision Diagram) provides the canonical representation of a
Boolean function. Due to this, the checking for validity, satisfiability of Boolean
expressions has become easy. During the design process, we move through different
levels of abstractions, starting from very high level to detailed level. While moving from
one level to other level of abstraction, sometime it is needed to check for their
equivalence. BDD representation provides an efficient method for equivalence checking
mainly at the Boolean level.
During the design phase, it is always not required to go for Boolean expression for each
function. We may go for design at the functional level and represent the whole system
with some abstracted model. But while going through the design phases, it is better to
check for correctness of design in every stage. While conceiving the idea of a digital
system, we know the system should meet some specifications or properties. While
designing the system, we must always ensure that the design will always meet those
specification or requirements. One way of checking for the correctness of specification is
logical reasoning. We may use some logical formalism to represent the specification and
use the underlying theory of that logical framework to reason about it. In this lecture we
will look for some logical framework by which we can formally represent the
specification. We will start with propositional logic and predicate logic. Then we will see
why we need some other logic to capture the specifications.
The aim of logic in computer science is to develop languages to model the situations we
encounter as computer science professionals, in such a way that we can reason about
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38

Partial preview of the text

Download Basic Operations on Temporal Logic - Design Verification and Test - Lecture Notes and more Study notes Design and Analysis of Algorithms in PDF only on Docsity!

Module-IV

Lecture-I

Introduction and Basic Operations on Temporal Logic

1. Introduction As discussed in the third module of the “Design” part of the course, any digital system can be represented by a collection of Boolean expressions. Each Boolean expression represents one output function/signal of the system. In the previous module (of the “Verification” part of the course) we have discussed one data structure by which we can represent the Boolean function in an efficient way. It is also mentioned that ROBDD (Reduced Order Binary Decision Diagram) provides the canonical representation of a Boolean function. Due to this, the checking for validity, satisfiability of Boolean expressions has become easy. During the design process, we move through different levels of abstractions, starting from very high level to detailed level. While moving from one level to other level of abstraction, sometime it is needed to check for their equivalence. BDD representation provides an efficient method for equivalence checking mainly at the Boolean level. During the design phase, it is always not required to go for Boolean expression for each function. We may go for design at the functional level and represent the whole system with some abstracted model. But while going through the design phases, it is better to check for correctness of design in every stage. While conceiving the idea of a digital system, we know the system should meet some specifications or properties. While designing the system, we must always ensure that the design will always meet those specification or requirements. One way of checking for the correctness of specification is logical reasoning. We may use some logical formalism to represent the specification and use the underlying theory of that logical framework to reason about it. In this lecture we will look for some logical framework by which we can formally represent the specification. We will start with propositional logic and predicate logic. Then we will see why we need some other logic to capture the specifications. The aim of logic in computer science is to develop languages to model the situations we encounter as computer science professionals, in such a way that we can reason about

them formally. Reasoning about situations means constructing arguments about them; we want to do this formally, so that the arguments are valid and can be defended rigorously, or executed on a machine.

2.1 The Need for a Richer Language: The propositional logic is not powerful enough to represent all types of assertions that are used in computer science and mathematics, or to express certain types of relationship between the propositions such as equivalence. For example, the assertion ‘ x is greater than 1’, where x is a variable, is not a proposition because you cannot tell whether it is true or false unless you know the value of x. Thus, propositional logic cannot deal with such sentences. However, such assertions appear quite often in mathematics and we want to do inferencing on those assertions. Also the pattern involved in the following logical equivalences cannot be captured by the propositional logic: ‘Not all objects that glitter is gold’ is equivalent to ‘Some objects that glitter are not gold’. ‘Not all integers are prime’ is equivalent to ‘Some integers are not prime’ ‘Not all cars are driven by petrol’ is equivalent to ‘Some cars are not driven by petrol’ Each of the above propositions are treated independently of the others in propositional logic. For example, if P represents ‘Not all objects that glitter is gold’ and Q represents ‘Some integers are not prime’, then there is no mechanism in propositional logic to find out whether or not P is equivalent to Q. Hence, to be used in inferencing, each of these equivalences must be listed individually rather than dealing with a general formula that covers all these equivalences collectively and instantiating these become necessary, if only propositional logic is used. Thus we need more powerful logic to deal with these and other problems. Predicate logic is one type of such logic family.

3. Predicate Logic A predicate is a generalization of a propositional variable. Suppose we have three propositions R : ‘He is working hard’, U : ‘He gets good marks’, and W : ‘He gets fail grade’. Suppose, further we have three hypotheses or expressions that we assume are true: R→ U ‘If he is working hard, then he gets good marks’, U→ ¬W ‘If he gets good marks, then he doesn’t get fail grade’, and ¬R→¬U ‘If he is not working hard, then he doesn’t get good marks’ What is true for “He” is also true for Ram, and Shyam, and Madhu, and so on. We can define symbol U to be a predicate that takes an argument X. The expression: U(X): ‘X gets good marks’ Possibly, for some values of X, U(X) is true, and for other values of X, U(X) is false. Similarly, W(X):X gets fail grade.” R(X) : “ X is working hard”, In predicate logic, we also use two quantifiers, one is universal quantifier, for all (  ), and the other is existential quantifier, there exists (  ). We can write:  x [R(x) → U(x)] for all those who work hard will get good marks. Also,  x [U(x)] There exists someone who gets good marks.

Propositional/predicate logic, can represent statements whose truth value is constant in time. However, there are statements and we need to reason about them whose truth values change over time, e.g., there is peace in the country. This truth of the statement may vary with time. To represent such statements we need a more powerful logic namely, temporal logic.

4.1 Temporal Operators: Temporal logic has two kinds of operators namely, (i) logical and modal and (ii) temporal. Logical operators are usual truth-functional operators ( ) (used for propositional and predicate logic). The basic temporal operators are of two types namely (i) future and (ii) past; the details are as follows. Operator (^) Textual Explanation Future Operators

○ (^) X φ neXt: φ holds at the next state.

◊ (^) F φ Future : φ eventually holds (somewhere on the subsequent path).

(^) G φ Globally: φ holds on the entire subsequent path.

U φ U ψ

Until: ψ holds at the current or a future position, and φ has to hold until that position. At that position φ does not have to hold any more.

R φ^ R^ ψ^ Release: φ is true (or forever if such a position does not exist).^ φ^ releases^ ψ^ if^ ψ^ is true until the first position in which

Past Operators

● ●φ Previous: φ has to hold in the previous state.

◆ ◆φ Eventually in past: φ eventually has to hold in the past.

■ ■φ Globally in past: φ has to hold on the entire previous path.

β (^) φ β ψ Back to:^ φ^ holds in all previous positions (including the present) starting at the last position ψ held.

Temporal formulas are interpreted over a model, which is an infinite sequence of states. Given a model M and a temporal formula φ, we define an inductive definition for the notion of φ holding at a position Sj for j  0 in M and denoted

by ( M S , j ) | . The inductive definitions are discussed as follows.

A. Next: φ has to hold at the next state. Symbol:

X 

Definition:

( M S , j ) |  X  ( M S , j  1 ) | 

Example:

s 0 s^ j s j+

Figure 1. Example of X  In Figure 1, state S (^) j satisfies X  as its next state Sj+1 satisfies φ.

B. Future: φ eventually has to hold (somewhere on the subsequent path). Symbol: F φ Definition: ( M S , (^) j ) |  F   k k ,  j , ( M S , (^) k ) |  Example:

s 0 s^ j s^ k

Figure 2. Example of F  In Figure 2, state S (^) j satisfies F  as future state Sk satisfies φ.

E. Release: φ releases ψ if ψ is true until the first position in which φ is true (or forever if such a position does not exist). Symbol:

( φ R ψ)

Definition: ( , ) | , ( , ) | and ( , ) | OR ( , ) |

j j k j

M S j j k M S M S j M S

  R       

Example

s 0 s^ j s^ k

...........

Figure 5. Example of (φ R ψ)

In Figure 5, Sj satisfies ( φ R ψ) because ψ is true for all states Sj through Sk and then ψ is true for states starting from Sk.

F. Previous: φ has to hold at the previous state. Symbol:

Definition: ( M S , (^) j ) |     ( M S , (^) j  1 ) |  Example:

s 0 s j-1 s^ j s k

...........

Figure 6. Example of ●φ

In Figure 6, state S (^) j satisfies ●φ as its previous state Sj-1 satisfies φ.

G. Eventually in past: φ eventually has to hold in the past. Symbol:

Definition:

( M S , j ) | ◆   k k ,  j M S ( , k ) | 

Example:

s 0 s (^) j ...........

s k

Figure 7. Example of ◆φ

In Figure 7, state S j satisfies ◆φ as eventually a past state Sk satisfies φ.

H. Globally in past: φ has to hold on the entire previous path. Symbol:

Definition:

( M S , j ) | ■   k k ,  j M S ( , k ) | 

Example:

s 0 s k s^ j

...........

Figure 8. Example of ■φ

In Figure 8, state Sj satisfies ■φ, as globally in all past states staring backward

from Sj , satisfies φ.

I. Back to: φ holds in all previous states (including the present) starting at the last position ψ held. Symbol:

s 0 s^ j s^ k

P Q

............

Figure 9. P→ FQ holds in state Sj

For state Sj, P→ FQ is true because P is true at S j and for future state Sk, Q

is true.

In state S0, P→ F Q is also vacuously true --If P is not true at S 0 then

there is no need for any constraints.

B. (P  XQ): Either P holds in a state or in next state Q holds

s 0 s^ j s^ k ...........

P Q^ P PQ

Figure 10. (P  XQ) holds in all sates

As shown in Figure 10, (P  XQ) is true for all states because either P is

true or XQ (i.e., Q holds in next state) is true for all states.

C. (P(Q U R): Either P holds in a state or Q U R ( Q until R ) holds

s 0 s^ j s^ k

P Q Q Q R

Figure 11. (P  (Q U R) holds in all states

Here P(Q U R) is true for all states because P is true for S 0 and for others (Q U R) is true. D. (P(Q U R) : P holds in a state and also Q U R ( Q until R ) holds in the state

s 0 s^ j s^ k

P Q P^ Q^ P^ Q P^ R PR

............ Figure 12. (P(Q U R) holds in all sates

Here P(Q U R) is true for all states because P is true for all state and (Q U R) is also true for all the states.

E. (P  ● Q): P holds in a state and in the previous state Q holds

s 0 s^ j s k

P Q P Q P Q P Q P

........... Figure 13. (P (^)  ● Q) holds in all sates Here every state satisfy P and^ ● Q^ (i.e., Q holds in the previous state).

5. Conclusions

[1]. Michael Huth and Mark Ryan, “Logic in Computer Science: Modelling and Reasoning about Systems”, 2nd^ edition, Cambridge University Press, New York, NY, USA.

Question and Answers

Question : What does the temporal formula (P→Q) mean? Give an example where this formula is valid in all the states.

Answer: (P→Q) means that “If P holds in a state then eventually in past Q holds”. In the example given below, (P→Q) holds in all states because (i) in all states except Sk, (P→Q) is vacuously true because P does not hold, (ii)At state Sk, P is true and eventually in past Q holds at Sj.

s 0 s^ j s^ k

Q P

............

Figure 14. (P→Q) holds in all sates

s

s1 s2 s

s4 s5 s6 s7 s

There exists a path from s3 where.... Path: Either through C or D

C D

In all paths from s1 where....

Path: Both through A and B

A (^) B Figure 2. Statements over ALL paths and a SINGLE path in branching time temporal logic

2. Syntax of CTL A CTL formula comprises 1. Atomic propositions such as {p, q, r…..} 2. Path Quantifiers {A,E} a. A : all paths starting from a given state. b. E : there exists at least one path from a given state. 3. Propositional logic operators such as AND ( ), OR ( ), NOT ( ) 4. Temporal operators {X,F,G,U} a. NE X T: next states of current state. b. F UTURE: any one of future states from the current state. c. G LOBAL: all future states from the current state. d. U NTIL: Some CTL formula holds until another CTL formula, from the current state. X,F,G are unary operators and U is binary operator. These temporal operators are illustrated using an example in Figure. 3.