Download presentation
Presentation is loading. Please wait.
Published byAnissa Byrd Modified over 9 years ago
1
Automata Based Programming Margarita Spitšakova Institute of Cybernetics at Tallinn University of Technology 19.03.08
2
Outline Introduction Definition of FSM Usage of FSM FSM as programs Example Future work Conclusions Software, further reading
3
Introduction Master thesis: “Genetic Inference of Finite State Machines” Finite state machine is something abstract Why I need to generate FSMs?
4
Finite State Machines States, transitions, input and output alphabets, final state, initial state. Moore machine (output at state) Mealy machine (output at transition) Deterministic machine
5
Using FSM FSM as hardware model Text recognition (regular expressions) Text transformations Pushdown automata in parsers
6
FSM as program Event Controller = Finite State Machines Controlled object Event Controlled object
7
Example. Traffic Lights Red Green Yellow Blinking green Red + yellow
8
Model
9
Source code. Controlled object public class TrafficLight implements ControlledObject { public void red(StateMachineContext context) { System.out.println("Red"); } public void green(StateMachineContext context) { System.out.println("Green"); } public void yellow(StateMachineContext context) { System.out.println("Yellow"); } public void greenblink(StateMachineContext context) { System.out.println("Green Blinking"); } public void redyellow(StateMachineContext context) { System.out.println("red yellow"); }
10
FSM
11
Source code. Controller switch (s) { case green: switch (event) { case next tick: if (counter_x4 < 20) { make transition to state “blinking green”; return new StateMachineConfig("blinking green"); } if (counter_x4 >= 20) { make transition to final state; return new StateMachineConfig(" final state "); } … } Switch technology
12
Conclusions Modeling system Modeling=writing the code Step-by-step Easier to verify Good for modeling reactive systems
13
Future work Event Controller = Finite State Machine Controlled object Event Controlled object Can be generated
14
Software. Further reading Unimod. Eclipse plugin for designing object- oriented event-driven applications using automata-based programming adapted for UML. http://unimod.sourceforge.nethttp://unimod.sourceforge.net AutoFSM. http://autogen.sourceforge.nethttp://autogen.sourceforge.net Сайт по автоматному программированию http://is.ifmo.ru/http://is.ifmo.ru/
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.