Top Banner
EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence
39

EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

EECS 20

Lecture 12 (February 12, 2001)

Tom Henzinger

Equivalence

Page 2: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Quiz

1. Draw the transition diagram of the system

Delay0 : [ Nats0 Bins ] [ Nats0 Bins ]

x [ Nats0 Bins ] , y Nats0 ,

( Delay0 (x)) (y) =

2. Draw the transition diagram of the system

0 if y = 0

x (y-1) if y > 0{

Delay0 Delay0

Page 3: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

State before time t :

0 if input at time t-1 was 0, or if t = 0

1 if input at time t-1 was 1

Page 4: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

0 1

Page 5: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

0 1

Page 6: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

0 1

1 / 0

0 / 0

Page 7: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

0 1

1 / 0

0 / 1

1 / 10 / 0

Page 8: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0 Delay0

State: ( q1, q2 )

q2q1

Page 9: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0 Delay0q2q1

0,0 1,0

0,1

1,1

Page 10: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0 Delay0q2q1

0,0 1,0

0,1

1,1

Page 11: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0 Delay0q2q1

0,0 1,0

0,1

1,1

1 / 0

0 / 0

Page 12: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0 Delay0q2q1

0,0 1,0

0,1

1,1

1 / 0

0 / 0

0/0

1 / 0

Page 13: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0 Delay0q2q1

0,0 1,0

0,1

1,1

1 / 0

0 / 0

0/0

1 / 01/1

0 / 1

0 / 11 / 1

Page 14: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

Page 15: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

Well-formed !

Page 16: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

Feedback

Feedback : [ Nats0 Unit ] [ Nats0 Bins ]

where Unit = { } .

Page 17: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

Feedback

Inputs : Unit

Outputs: Bins

States: { 0, 1 }

initialState = 0

q x output (q,x) nextState (q,x)

0 0 0

1 1 1

Page 18: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

Feedback

0 1

/ 0 / 1

Page 19: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

Feedback

Only one run !

Time 0 1 2 3 4 5 6 7

Input

Output 0 0 0 0 0 0 0 0

State 0 0 0 0 0 0 0 0 0

Page 20: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

Feedback

0 1

/ 0 / 1

unreachable

Page 21: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

A state q of a state machine M is unreachable

iff

q occurs on no run of M ;

that is, iff

there is no path from the initial state of M to q .

Unreachable states can be removed without changing the system (input/output function) implemented by M .

Page 22: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Delay0

Feedback

0

/ 0

Page 23: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

A more interesting system without inputs

Counter

Nats0 Nats0

0, 1, 2, 3, 4, 5, …

Page 24: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

State-machine implementation of Counter

Counter

Nats0 Nats0

0, 1, 2, 3, 4, 5, …

Delay0

Inc

where n Nats0, inc (n) = n + 1 .

Page 25: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Time 0 1 2 3 4 5 6 7

Input

Output 0 1 2 3 4 5 6 7

State 0 1 2 3 4 5 6 7 8

One run

Infinitely many states

0 4321/0 /3/2/1

Page 26: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Yet another system without inputs

ModCounter

Nats0 Nats0

0, 1, 2, 3, 0, 1, 2, …

Delay0

IncMod4

where n Nats0, incMod4 (n) = ( n + 1 ) mod 4.

Page 27: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Transition diagram of ModCounter

0 321/0

/3

/2/1

Page 28: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

A discrete-time reactive system can have many different state-machine implementations.

Page 29: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Two state machines M1 and M2 are equivalent

iff

they implement the same system (input/output function);

that is, iff

1. Inputs [M1] = Inputs [M2] ,

2. Outputs [M1] = Outputs [M2] , and

3. x [ Nats0 Inputs ], M1 (x) = M2 (x) .

[ Nats0 Outputs ]

Page 30: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Equivalent State Machines

0 1

1/0

0/11/10/0

M1

a b

1/0

0/11/10/0

M2

Page 31: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Equivalent State Machines

0 1

/ 0 / 1

M1

0

/ 0

M2

2 states

1 state

Page 32: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Equivalent State Machines

0 1

1/0

0/11/10/0

M1

0 1

M2i

1/0

0/11/10/0

0/0 1/0

3 states

2 states

Page 33: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Theorem :

Two state machines M1 and M2 are equivalent

iff

there exists a bisimulation between M1 and M2 .

A binary relation B between States [M1] and States [M2] ;

that is, B States [M1] States [M2] .

Page 34: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

A binary relation B States [M1] States [M2] is a bisimulation

iff

1. ( initialState [M1] , initialState [M2] ) B and

2. p States [M1] , q States [M2] ,

if ( p, q ) B ,

then x Inputs [M1] ,

output [M1] ( p, x ) = output [M2] ( q, x ) and

( nextState [M1] ( p, x ) , nextState [M2] ( q, x) ) B .

Page 35: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

0 1

1/0

0/11/10/0

M1

a b

1/0

0/11/10/0

M2

Bisimulation B = { ( 0, a ), ( 1, b) }

Page 36: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

/ 0 / 1

M1

/ 0

M2

Bisimulation B = { ( p0, q0 ) }

p0

q0

p1

Page 37: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Bisimulation B = { ( p0, qi ), ( p0, q0 ), ( p1, q1 ) }

p0

1/0

0/11/10/0

M1

M2

1/0

0/11/10/0

0/0 1/0

q0q1

qi

p1

Page 38: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Equivalence between state machines:

refers only to input and output signals.

Bisimulation between state machines:

refers to states.

Page 39: EECS 20 Lecture 12 (February 12, 2001) Tom Henzinger Equivalence.

Why is bisimulation useful ?

“Equivalence” says something about infinitely many possible input signals.

For finite state machines, “bisimulation” says something about finitely many possible relationships between states.

Bisimulation, therefore, is easier to check than equivalence.