1 / 49

EECS 20 Lecture 15 (February 21, 2001) Tom Henzinger

Simulation. EECS 20 Lecture 15 (February 21, 2001) Tom Henzinger. Deterministic Reactive System: for every input signal, there is exactly one output signal. Function:. DetSys : [ Time  Inputs ]  [ Time  Outputs ]. Nondeterministic Reactive System:

carsyn
Download Presentation

EECS 20 Lecture 15 (February 21, 2001) Tom Henzinger

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simulation EECS 20 Lecture 15 (February 21, 2001) Tom Henzinger

  2. DeterministicReactive System: for every input signal, there is exactly one output signal. Function: DetSys : [ Time  Inputs ]  [ Time  Outputs ]

  3. Nondeterministic Reactive System: for every input signal, there is one or more output signals. Binary relation: NondetSys  [ Time  Inputs ]  [ Time  Outputs ] such that  x  [ Time  Inputs ],  y  [ Time  Outputs ], (x,y)  NondetSys Every pair (x,y)  NondetSys is called a behavior.

  4. S1 is a more detailed description of S2; S2 is an abstraction or property of S1. System S1 refines system S2 iff 1. Time [S1] = Time [S2] , 2. Inputs [S1] = Inputs [S2] , 3. Outputs [S1] = Outputs [S2] , 4. Behaviors [S1]  Behaviors [S2] .

  5. Systems S1 and S2 are equivalent iff 1. Time [S1] = Time [S2] , 2. Inputs [S1] = Inputs [S2] , 3. Outputs [S1] = Outputs [S2] , 4. Behaviors [S1] = Behaviors [S2] .

  6. Nondeterministiccausal discrete-time reactive systems can be implemented by nondeterministicstate machines.

  7. Nondeterministic State Machine Inputs Outputs States possibleInitialStates  States possibleUpdates: States  Inputs  P( States  Outputs ) \ Ø receptiveness (i.e., machine must be prepared to accept every input)

  8. Lossy Channel without Delay Nats0 Bins Nats0 Bins LCwD 0 1 1 0 0 0 1 1 … 0  1 0   1 1 … 0 / 0 0 / 1/ 1 1/ 

  9. Channel that never drops two in a row Nats0 Bins Nats0 Bins NotTwice 0 1 1 0 0 0 1 1 … 0  1 0  0  1 … 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 / 

  10. Typical Exam Questions A. Convert between three (possibly nondeterministic) system representations: 1.Input-output definition Deterministic case: define S: [Nats0Inputs]  [Nats0Outputs] such that for all x  [Nats0Inputs] and all y  Nats0, (S(x))(y) = … Nondeterministic case: define S  [Nats0Inputs]  [Nats0Outputs] such that for all x  [Nats0Inputs] and all y  [Nats0Outputs], (x,y)  S iff … 2.Transition diagram 3.Block diagram B. Equivalence, bisimulation, minimization of deterministic state machines

  11. Refinement, simulation, and minimization of nondeterministic state machines

  12. condition on behaviors Theorem : The nondeterministic state machines M1 refines the nondeterministic state machine M2 if there exists a simulation of M1 by M2 . relation between states

  13. Theorem : The nondeterministic state machines M1 refines the nondeterministic state machine M2 if there exists a simulation of M1 by M2 . Not symmetric ! Not “if-and-only-if” ! (We say that “M2 simulates M1”.)

  14. In the following, assume Inputs [M1] = Inputs [M2] Outputs [M1] = Outputs [M2]

  15. A binary relation S  States [M1]  States [M2] is a simulation of M1 by M2 iff 1.  p  possibleInitialStates [M1] ,  q  possibleInitialStates [M2], ( p, q )  S and 2.  p  States [M1] ,  q  States [M2] , if ( p, q )  S, then  x  Inputs ,  y  Outputs ,  p’  States [M1] , if ( p’, y )  possibleUpdates [M1] ( p, x ) then  q’  States [M2] , ( q’, y )  possibleUpdates [M2] ( q, x ) and ( p’, q’ )  S .

  16. S x / y p’ p q

  17. S x / y p’ p x / y q’ q

  18. S x / y p’ p x / y q’ q

  19. 0 / 0 0 / 1/ 1 1/  NotTwice refines Lossy Channel without Delay q 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 / 

  20. 0 / 0 0 / 1/ 1 1/  NotTwice is simulated by Lossy Channel without Delay q Simulation S = { (a, q), (b, q) } 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 / 

  21. 0 / 0 0 / 1/ 1 1/  Lossy Channel without Delay is not simulated by NotTwice q Not a simulation S’ = { (q, b) } 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 / 

  22. 0 / 0 0 / 1/ 1 1/  Lossy Channel without Delay is not simulated by NotTwice q Not a simulation S” = { (q, a), (q, b) } 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 / 

  23. Channel that drops every third zero Nats0 Bins Nats0 Bins ThirdZero 0 1 1 0 0 0 1 1 … 0 1 1 0  0 1 1 …

  24. Channel that drops every third zero Nats0 Bins Nats0 Bins ThirdZero 0 1 1 0 0 0 1 1 … 0 1 1 0  0 1 1 … State between time t-1 and time t: 3 third zero from now will be dropped 2 second zero from now will be dropped 1 next zero will be dropped

  25. Channel that drops every third zero 1 / 1 1 / 1 1 / 1 0 / 0 0 / 0 3 1 2 0 / 

  26. ThirdZero refines NotTwice 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 /  1 / 1 1 / 1 1 / 1 0 / 0 0 / 0 3 1 2 0 / 

  27. ThirdZero is simulated by NotTwice Simulation S = { (3,b), 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 /  1 / 1 1 / 1 1 / 1 0 / 0 0 / 0 3 1 2 0 / 

  28. ThirdZero is simulated by NotTwice Simulation S = { (3,b), (2,b), 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 /  1 / 1 1 / 1 1 / 1 0 / 0 0 / 0 3 1 2 0 / 

  29. ThirdZero is simulated by NotTwice Simulation S = { (3,b), (2,b), (1,b), 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 /  1 / 1 1 / 1 1 / 1 0 / 0 0 / 0 3 1 2 0 / 

  30. ThirdZero is simulated by NotTwice Simulation S = { (3,b), (2,b), (1,b), (3,a) } 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 /  1 / 1 1 / 1 1 / 1 0 / 0 0 / 0 3 1 2 0 / 

  31. NotTwice is not simulated by ThirdZero 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 /  1 / 1 1 / 1 1 / 1 0 / 0 0 / 0 3 1 2 0 / 

  32. NotTwice is not simulated by ThirdZero 0 / 0 1 / 1 a b 0 / 0 0 /  1 / 1 1 /  1 / 1 1 / 1 1 / 1 0 / 0 0 / 0 3 1 2 X 0 /  0 / 

  33. Special cases of nondeterministic state machines • Deterministic • Output-deterministic (“almost deterministic”) For these machines, simulations can be found easily (provided they exist).

  34. A state machine is output-deterministic • iff • there is only one initial state, and • for every state and every input-output pair, there is only one successor state. Deterministic implies output-deterministic, but not vice versa. For example, LCwD and NotTwice are output-deterministic; ThirdZero is deterministic.

  35. Deterministic: for every input signal x, there is exactly one run of the state machine. Output-deterministic: for every behavior (x,y), there is exactly one run.

  36. If M2 is an output-deterministic state machine, then a simulation S of M1 by M2 can be found as follows: 1. If p  possibleInitialStates [M1] and possibleInitialStates [M2] = { q } , then (p,q)  S. 2. If (p,q)  S and (p’,y)  possibleUpdates [M1] (p,x) and possibleUpdates [M2] (q,x) = { q’ } , then (p’,q’)  S.

  37. If M2 is a deterministic state machine, then M1 is simulated by M2 iff M1 is equivalent to M2.

  38. If M2 is a deterministic state machine, then M1 is simulated by M2 iff M1 is equivalent to M2. “if and only if” M1 refines M2, and M2 refines M1

  39. If M2 is a nondeterministic state machine, then M1 is simulated by M2 implies M1 refines M2, but M2 may not refine M1. ( Recall M1 = ThirdZero and M2 = NotTwice .)

  40. If M2 is a nondeterministic state machine, then M1 is simulated by M2 implies M1 refines M2, but M1 refine M2 even if M1 is not simulated by M2.

  41.  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 z  / 0  / 0  / 0 M2 x y  / 1 u  / 0

  42. Two behaviors: 00000…, 01000…  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 is equivalent to z  / 0  / 0  / 0 M2 x y  / 1 u  / 0 Same two behaviors: 00000…, 01000…

  43. Simulation S = { (a, x),  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 is simulated by z  / 0  / 0  / 0 M2 x y  / 1 u  / 0

  44. Simulation S = { (a, x), (b, y), (c, y),  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 is simulated by z  / 0  / 0  / 0 M2 x y  / 1 u  / 0

  45. Simulation S = { (a, x), (b, y), (c, y), (d, z), (e, u) }  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 is simulated by z  / 0  / 0  / 0 M2 x y  / 1 u  / 0

  46.  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 does not simulate z  / 0  / 0  / 0 M2 x y  / 1 u  / 0

  47.  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 does not simulate z  / 0  / 0  / 0 M2 x y  / 1 u  / 0

  48.  / 1 X  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 does not simulate z  / 0  / 0  / 0 M2 x y  / 1 u  / 0

  49.  / 0 b d  / 0  / 0 M1 a  / 1  / 0 c e  / 0 does not simulate X  / 0 z  / 0  / 0  / 0 M2 x y  / 1 u  / 0

More Related