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

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

Post on 15-Jan-2016

23 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

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 ) - PowerPoint PPT Presentation

TRANSCRIPT

<ul><li><p>EECS 20Lecture 9 (February 5, 2001)Tom Henzinger Transition Diagrams</p></li><li><p>Discrete-Time Reactive System : input/output function F</p><p>State-Machine Implementation : decomposition of F into 1. memory-free part ( called Update ) 2. delay part ( what delay stores is called state ) </p></li><li><p> Discrete-Time Reactive SystemNats0 InputsNats0 OutputsF : [ Nats0 Inputs ] [ Nats0 Outputs ]F</p></li><li><p>The Parity SystemParity : [ 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 &lt; y x (z) = true } </p></li><li><p>The Count SystemCount : [ 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) | &lt; | falseValues (x,y) | {where falseValues (x,y) = { z Nats0 | z &lt; y x (z) = false } </p></li><li><p>State-Machine ImplementationNats0 InputsNats0 OutputsDinitialStateUpdate1122Nats0 StatesNats0 Statesupdate : States Inputs States OutputsinitialState States Fmemory-freedelay stores state</p></li><li><p>Nats0 InputsNats0 OutputsDinitialStateOutput12Nats0 StatesNats0 StatesNextState12Fmemory-freedelay stores statenextState : States Inputs Statesoutput : States Inputs OutputsinitialState States </p></li><li><p>State-Machine Implementation of the Parity SystemState after i-th input :true, if first i inputs contain even number of truesfalse, if first i inputs contain odd number of truesTwo states </p></li><li><p>Inputs = BoolsOutputs = BoolsStates = Bools initialState = truenextState : 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</p></li><li><p>Nats0 BoolsNats0 BoolsDtrueNats0 BoolsNats0 Bools Parity</p></li><li><p>State-Machine Implementation of the Count SystemState after i-th input :i, if first i inputs contain i more trues than falses-i, if first i inputs contain i more falses than truesInfinitely many states</p></li><li><p>Inputs = BoolsOutputs = BoolsStates = Ints initialState = 0nextState : 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)</p></li><li><p>Nats0 BoolsNats0 BoolsD0Nats0 Ints Countpos</p></li><li><p>A State MachineInputs ( set of possible input values )Outputs ( set of possible output values )States ( set of states ) initialState States update : States Inputs States Outputs</p></li><li><p>State-Machine Implementation of the Parity SystemInputs = BoolsOutputs = BoolsStates = Bools initialState = trueupdate : States Inputs States Outputs such that q States, x Inputs, update (q,x) 1 = ( q x ) update (q,x) 2 = q</p></li><li><p>State-Machine Implementation of the Count SystemInputs = BoolsOutputs = BoolsStates = Ints initialState = 0update : States Inputs States Outputs such that q States, x Inputs, update (q,x) 1 = (x,q) update (q,x) 2 = pos (q)</p></li><li><p>Transition Diagram of the Parity Systemtruefalsetrue / truetrue / falsefalse / truefalse / falseStates = Bools Inputs = Bools Outputs = Bools</p></li><li><p>Transition Diagram of the Count SystemStates = Ints Inputs = Bools Outputs = Bools</p></li><li><p>Transition DiagramGraph: Nodes = states Edges = transitions</p><p>Determinism : for every state and input, at most one outgoing edgeReceptiveness : for every state and input, at least one outgoing edge( because update is a function )</p></li><li><p>ExerciseDraw the transition diagram of a state machine with Inputs = Bools Outputs = BoolsAt all times t, the output is true iff the inputs at times t-2, t-1, and t are all true .</p></li><li><p>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 false2, if both i-th and (i-1)-st inputs are trueThree states( or i = 1 )</p></li><li><p>Transition DiagramStates = { 0, 1, 2 } Inputs = Bools Outputs = Bools021true / falsefalse / falsefalse / falsefalse / falsetrue / truetrue / false</p></li><li><p>The Parity System : States [ Parity] = { true, false } initialState [ Parity ] = true nextState [ Parity ] (q,x) = (q x) output [ Parity ] (q,x) = qThe LastThree System : States [ LastThree] = { 0, 1, 2 } initialState [ LastThree ] = 0 nextState [ LastThree ] (q,x) = output [ LastThree ] (q,x) = ( ( q = 2 ) x )0 if xmin (q+1, 2) if x{</p></li><li><p>ParityLastThreeParityOrLastThreeNats0 BoolsNats0 Boolst, t, t, </p></li><li><p>ParityLastThreeParityOrLastThreeNats0 BoolsNats0 Boolst, t, t, t, f, t, </p></li><li><p>What is the state space of ParityOrLastThree ?What is the initial state of ParityOrLastThree ?What is the nextState function of ParityOrLastThree ? What is the output function of ParityOrLastThree ?</p></li><li><p>ParityLastThreeParityOrLastThreeNats0 BoolsNats0 BoolsOut1 Nxt1 Dinit1Out2 Nxt2 Dinit2</p></li><li><p>ParityOrLastThreeNats0 BoolsNats0 BoolsOut1 Nxt1 Dinit1Out2 Nxt2 Dinit2</p></li><li><p>ParityOrLastThreeNats0 BoolsNats0 BoolsOut1 Nxt1 Dinit1Out2 Nxt2 Dinit2</p></li><li><p>ParityOrLastThreeNats0 BoolsNats0 BoolsOut1 Nxt1 Dinit1Out2 Nxt2 Dinit2</p></li><li><p>ParityOrLastThreeNats0 BoolsNats0 BoolsoutputnextStateDinitialState</p></li><li><p>The ParityOrLastThree SystemInputs [ ParityOrLastThree ] = BoolsOutputs [ ParityOrLastThree ] = BoolsStates [ ParityOrLastThree ] = States [ Parity ] States [ LastThree ] = { true, false } { 0, 1, 2 }initialState [ ParityOrLastThree ] = ( initialState [ Parity ], initialState [ LastThree ] ) = ( true, 0 )</p></li><li><p>The ParityOrLastThree System, continuednextState [ 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)</p></li><li><p>t, 0f, 0f, 1f, 2t, 2t, 1</p></li><li><p>t, 0f, 0f, 1f, 2t, 2t, 1f/tt/t</p></li><li><p>t, 0f, 0f, 1f, 2t, 2t, 1f/tt/tt/ff/f</p></li><li><p>t, 0f, 0f, 1f, 2t, 2t, 1f/tt/tt/ff/ft/ff/f</p></li><li><p>t, 0f, 0f, 1f, 2t, 2t, 1f/tt/tt/ff/ft/ff/ft/tf/t</p></li><li><p>t, 0f, 0f, 1f, 2t, 2t, 1f/tt/tt/ff/ft/ff/ft/tf/tt/tf/t</p></li><li><p>t, 0f, 0f, 1f, 2t, 2t, 1f/tt/tt/ff/ft/ff/ft/tf/tt/tf/tt/tf/f</p></li></ul>

Recommended

View more >