The tag has no wiki summary.

learn more… | top users | synonyms

13
votes
10answers
3k views

State machines vs threads

Alan Cox once said "A Computer is a state machine. Threads are for people who can't program state machines". Since asking Alan directly is not an option for humble me, I'd rather ask here: how does ...
11
votes
10answers
9k views

Examples of Finite State Machines [closed]

I'm looking for good examples of finite state machines, language isn't particularly important, just good examples. Code implementations are useful (generalized pseudo-code), but it's also very useful ...
8
votes
4answers
311 views

How can a child state machine relinquish control back to the parent state machine?

My top level state machine has some states and edges. I will call this the parent state machine. A ----> B ----> C Any state within the parent state machine can be a state machine too. I will ...
7
votes
5answers
2k views

Are exceptions as control flow considered a serious antipattern? If so, Why?

Back in the late 90's I worked quite a bit with a code base that used exceptions as flow control. It implemented a finite state machine to drive telephony applications. Lately I am reminded of those ...
7
votes
4answers
873 views

Can an object oriented program be seen as a Finite State Machine?

This might be a philosophical/fundamental question, but I just want to clarify it. In my understanding a Finite State Machine is a way of modeling a system in which the system's output will not only ...
7
votes
4answers
246 views

Definition of “state”

What is a good way to define "state", as in state variable or state machine, to a new (previously non) programmer? What are some good ways to explain why this concept is useful for writing software? ...
6
votes
6answers
582 views

How to recover from finite-state-machine breakdown?

My question may seems very scientific but I think it's a common problem and seasoned developers and programmers hopefully will have some advice to avoid the problem I mention in title. Btw., what I ...
4
votes
2answers
202 views

Good ways to jump to a particular state in a yielding stateful function?

I'm working on some embedded code using C. Various pieces of functionality need non-blocking stateful functions, which are mostly implemented using a switch on various states. For example, a modem ...
3
votes
4answers
2k views

Advantages/Disadvantages of NFA over DFA and vice versa

What are the relative pro's and con's of both DFA's and NFA's when compared to each other? I know that DFA's are easier to implement than NFA's and that NFA's are slower to arrive at the accept state ...
3
votes
1answer
366 views

Constructing a Deterministic Finite State Automaton for a given Regex

I have a couple of exam questions for my compilers class and wanted to check if my solutions are correct. The first question is: Consider a language in which numbers start with an optional minus ...
3
votes
2answers
196 views

How do I reuse a state machine in a slightly different way?

Problem I have a big state machine. The design requirements of the project have changed such that I need to re-use this state machine in another place. All the states remain the same in this new ...
3
votes
1answer
352 views

Passing data between concrete states?

I have a state machine pattern implementation that's pretty straightforward, but I've got a design problem I don't know an elegant solution to. Here's some partly pseudo code to illustrate. class ...
2
votes
1answer
136 views

Why does F. Wagner consider “NOT (AI_LARGER_THAN_8.1)” to be ambiguous?

In his article on Virtual Environments (a part of his VFSM specification method) Ferdinand Wagner describes some new ways of thinking about Boolean Algebra as a software design tool. On page 4 of ...
2
votes
1answer
99 views

Application protocols and state machines: designing a complicated server

I'm designing and prototyping a server that has the following characteristics: during the daemon's initialization it spawns nine "manager" servers, each of which solves one part of the overall ...
2
votes
2answers
458 views

How to present asynchronous state change in chart or diagram?

I started to study about state transition chart. As I see, it assumes all state transition is done instantly with no time consuming. But in most of my case, I'm heavily depending on asynchronous I/O, ...
2
votes
2answers
154 views

Constructs for wrapping a hardware state machine

I am using a piece of hardware with a well defined C API. The hardware is stateful, with the relevant API calls needing to be in the correct order for the hardware to work properly. The API calls ...
2
votes
2answers
209 views

Communication between state machines with hidden transitions

The question emerged for me in embedded programming but I think it can be applied to quite a number of general networking situations e.g. when a communication partner fails. Assume we have an ...
2
votes
2answers
475 views

Visualize flowchart diagram with multiple end symbols

I am looking for a standardize way to visualize the following hierarchical logic: The state of the thread is represented by the answers to the hierarchical set of question You can read this listing ...
1
vote
2answers
196 views

Can the Turing machine be classified?

Can the Turing machine be classified e.g. as a Mealy machine? Why not? Can a Turing machine be input to another Turing machine without complication like halting problems? Thanks
1
vote
1answer
176 views

How do you diagram global or shared state?

Say you're building an FSM for something like a game and you've got states like: MainMenu Options SinglePlayer MultiPlayer Your state diagram might look something like this: Now say you have a ...
0
votes
1answer
267 views

Good example of a State Machine / State Pattern based Workflow Engine?

I am looking to implement a workflow engine using the State pattern but I cannot find a good example of this. Does anyone know of a good resource that shows building a workflow engine that utilizes ...
0
votes
0answers
41 views

Using a Finite State Machine for access management?

My intranet site uses LDAP and Active Directory to authenticate users. There are 2 kinds of Users: Managers and Employees. They are differentiated by having membership in a particular AD group. In an ...
-1
votes
1answer
170 views

Need theoretical help, how to comprehend an if-else dependency net

I am going to face a following issue: I'm writing a program that manages some properties of my application. Each property is a pair of key and value. Application has general skin and also few ...