1 / 40

EECS 20 Lecture 9 (February 5, 2001) Tom Henzinger

Transition Diagrams. EECS 20 Lecture 9 (February 5, 2001) Tom Henzinger. Discrete-Time Reactive System : input/output function F State-Machine Implementation : decomposition of F into 1. memory-free part ( called “ Update ” )

mayda
Download Presentation

EECS 20 Lecture 9 (February 5, 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. Transition Diagrams EECS 20 Lecture 9 (February 5, 2001) Tom Henzinger

  2. Discrete-Time Reactive System : input/output function F State-Machine Implementation : decomposition of F into 1. memory-free part ( called “Update” ) 2. delay part ( what delay stores is called “state” )

  3. Discrete-Time Reactive System F Nats0  Inputs Nats0  Outputs F : [ Nats0 Inputs ]  [ Nats0 Outputs ]

  4. The Parity System Parity : [ Nats0 Bools ]  [ Nats0  Bools ] such that  x  [ Nats0 Bools ] ,  y  Nats0, ( Parity (x) ) (y) = true if | trueValues (x,y) | is even false if | trueValues (x,y) | is odd { where trueValues (x,y) = { z  Nats0 | z < y  x (z) = true }

  5. The Count System Count : [ Nats0 Bools ]  [ Nats0  Bools] such that  x  [ Nats0 Bools ] ,  y  Nats0, ( Count (x) ) (y) = true if | trueValues (x,y) |  | falseValues (x,y) | false if | trueValues (x,y) | < | falseValues (x,y) | { where falseValues (x,y) = { z  Nats0 | z < y  x (z) = false }

  6. State-Machine Implementation memory-free F 2 2 Update Nats0 Inputs Nats0 Outputs 1 1 DinitialState delay stores state Nats0 States Nats0 States update: States  Inputs  States  Outputs initialState  States

  7. F 2 Output 1 Nats0 Inputs Nats0 Outputs 2 NextState 1 memory-free DinitialState delay stores state Nats0 States Nats0 States nextState: States  Inputs  States output: States  Inputs  Outputs initialState  States

  8. State-Machine Implementation of the Parity System State after i-th input : true, if first i inputs contain even number of true’s false, if first i inputs contain odd number of true’s Two states

  9. Inputs = Bools Outputs = Bools States = Bools initialState = true nextState : States  Inputs  States such that  q  States,  x  Inputs, nextState (q,x) = ( q  x ) output : States  Inputs  Outputs such that  q  States,  x  Inputs, output (q,x) = q

  10. Parity Nats0 Bools Nats0 Bools  Dtrue Nats0 Bools Nats0 Bools

  11. State-Machine Implementation of the Count System State after i-th input : i, if first i inputs contain i more true’s than false’s -i, if first i inputs contain i more false’s than true’s Infinitely many states

  12. Inputs = Bools Outputs = Bools States = Ints initialState = 0 nextState : States  Inputs  States such that  q  States,  x  Inputs, nextState (q,x) = ± (x,q) output : States  Inputs  Outputs such that  q  States,  x  Inputs, output (q,x) = pos (q)

  13. Count pos Nats0 Bools Nats0 Bools ± D0 Nats0 Ints

  14. A State Machine Inputs ( set of possible input values ) Outputs ( set of possible output values ) States ( set of states ) initialState  States update: States  Inputs  States  Outputs

  15. State-Machine Implementation of the Parity System Inputs = Bools Outputs = Bools States = Bools initialState = true update : States  Inputs  States  Outputs such that  q  States,  x  Inputs, update (q,x) 1 = ( q  x ) update (q,x) 2 = q

  16. State-Machine Implementation of the Count System Inputs = Bools Outputs = Bools States = Ints initialState = 0 update : States  Inputs  States  Outputs such that  q  States,  x  Inputs, update (q,x) 1 = ± (x,q) update (q,x) 2 = pos (q)

  17. Transition Diagram of the Parity System true / true true false true / false false / false false / true States = Bools Inputs = BoolsOutputs = Bools

  18. true / true true / true true / true true / false true / false 2 0 1 -1 false / true false / true false / true false / false false / true Transition Diagram of the Count System States = Ints Inputs = BoolsOutputs = Bools

  19. Transition Diagram Graph: Nodes = states Edges = transitions Determinism : for every state and input, at most one outgoing edge Receptiveness : for every state and input, at least one outgoing edge ( because “update” is a function )

  20. Exercise Draw the transition diagram of a state machine with Inputs = Bools Outputs = Bools At all times t, the output is true iff the inputs at times t-2, t-1, and t are all true .

  21. State after i-th input : 0, if i-th input is false ( or i = 0 ) 1, if i-th input is true and (i-1)-st input is false 2, if both i-th and (i-1)-st inputs are true ( or i = 1 ) Three states

  22. Transition Diagram true / false true / false 1 2 0 false / false true / true false / false false / false States = { 0, 1, 2 } Inputs = BoolsOutputs = Bools

  23. The Parity System : States [ Parity] = { true, false } initialState [ Parity ] = true nextState [ Parity ] (q,x) = (q  x) output [ Parity ] (q,x) = q The LastThree System : States [ LastThree] = { 0, 1, 2 } initialState [ LastThree ] = 0 nextState [ LastThree ] (q,x) = output [ LastThree ] (q,x) = ( ( q = 2 )  x ) 0 if x min (q+1, 2) if x {

  24. ParityOrLastThree Parity Nats0  Bools Nats0  Bools  t, t, t, … LastThree

  25. ParityOrLastThree Parity Nats0  Bools Nats0  Bools  t, t, t, … LastThree t, f, t, …

  26. What is the state space of ParityOrLastThree ? What is the initial state of ParityOrLastThree ? What is the nextStatefunction of ParityOrLastThree ? What is the output function of ParityOrLastThree ?

  27. ParityOrLastThree Parity Out1 Nxt1 Nats0  Bools Nats0  Bools Dinit1  Out2 Nxt2 Dinit2 LastThree

  28. ParityOrLastThree Out1 Nxt1 Nats0  Bools Nats0  Bools Dinit1  Out2 Nxt2 Dinit2

  29. ParityOrLastThree Out1  Out2 Nats0  Bools Nats0  Bools Nxt1 Nxt2 Dinit1 Dinit2

  30. ParityOrLastThree Out1  Out2 Nats0  Bools Nats0  Bools Nxt1 Nxt2 Dinit1 Dinit2

  31. ParityOrLastThree output Nats0  Bools Nats0  Bools nextState DinitialState

  32. The ParityOrLastThree System Inputs [ ParityOrLastThree ] = Bools Outputs [ ParityOrLastThree ] = Bools States [ ParityOrLastThree ] = States [ Parity ]  States [ LastThree ] = { true, false }  { 0, 1, 2 } initialState [ ParityOrLastThree ] = ( initialState [ Parity ], initialState [ LastThree ] ) = ( true, 0 )

  33. The ParityOrLastThree System, continued nextState [ ParityOrLastThree ] ( ( q1, q2 ) , x ) = ( nextState [ Parity ] (q1, x) , nextState [ LastThree ] (q2, x) ) output [ ParityOrLastThree ] ( ( q1, q2 ) , x ) = output [ Parity ] (q1, x)  output [ LastThree ] (q2, x)

  34. t, 0 t, 1 t, 2 f, 0 f, 1 f, 2

  35. f/t t, 0 t, 1 t, 2 t/t f, 0 f, 1 f, 2

  36. f/t t, 0 t, 1 t, 2 t/f t/t f, 0 f, 1 f, 2 f/f

  37. f/t t, 0 t, 1 t, 2 t/f t/t t/f f, 0 f, 1 f, 2 f/f f/f

  38. f/t f/t t, 0 t, 1 t, 2 t/t t/f t/f t/t f, 0 f, 1 f, 2 f/f f/f

  39. f/t f/t f/t t, 0 t, 1 t, 2 t/t t/f t/f t/t t/t f, 0 f, 1 f, 2 f/f f/f

  40. f/t f/t f/t t, 0 t, 1 t, 2 t/t t/f t/f t/t t/t t/t f, 0 f, 1 f, 2 f/f f/f f/f

More Related