finite-automata

How Does Relational Theory Apply in Ways I can Care About while Learning it?

So I'm taking the Discrete Math course from MIT's OpenCourseWare and I'm wondering... I see the connection between relations and graphs but not enough to "own" it. I've implemented a simple state machine in SQL as well so I grok graphs pretty well, just not the more rigorous study of how relations and sets compeltely apply. Should I just...

Is there a typical state machine implementation pattern?

We need to implement a simple state machine in C. Is a standard switch statement the best way to go? We have a current state (state) and a trigger for the transition. switch(state) { case STATE_1: state = DoState1(transition); break; case STATE_2: state = DoState2(transition); break; } ... DoState2(int transitio...

Can regular expressions be used to match nested patterns?

Is it possible to write a regular expression that matches a nested pattern that occurs an unknown number of times. For example, can a regular expression match an opening and closing brace when there are an unknown number of open closing braces nested within the outer braces. For example: public MyMethod() { if (test) { // More ...

Are there any programs to draw and test state machines, turing machines, etc?

When I go back to school after Thanksgiving, I'll be taking a course in CS Theory covering topics such as deterministic and nondeterministic finite state machines, turing machines, pushdown automata and a few other things. However, I haven't found a good application that can produce a visual representation of them as well as testing how ...

Practical non-Turing-complete languages?

Nearly all programming languages used are Turing Complete, and while this affords the language to represent any computable algorithm, it also comes with its own set of problems. Seeing as all the algorithms I write are intended to halt, I would like to be able to represent them in a language that guarantees they will halt. Regular expre...

What are Finite State Automata and why should a programmer know about them?

Erm - what the question said. It's something I keep hearing about, but I've not got round to looking into it yet. (updated) I could look up the definition... but why not (as pointed out by @erikson) get insight into your real experiences and anecdotes. Community Wiki'd incase that helps folks vote up the most insightful answer. Intere...

Can I implement State Transitions for a DFA in Java using java.util.Set

I'm implementing a DFA as close as I can to the formal definition as a learning exercise (and blogging material) I planned on using a java.util.Set where a set is involved in the definition. The definition involves a set of tuples to define the legal state transitions: (state,symbol) -> nextState. I have a Transition class with member...

Graph drawing algorithms - I'm trying to render finite state automata

I want to write something that will draw finite state automata. Does anyone know any algorithms that are related to this? EDIT: I should mention that I know about graphviz. I want to build my own draw program/function, so what I'm looking for is some more theoretical stuff/pseudo-code for algorithms. ...

State Machines and User Interface work -- any examples/experience?

Hello I'm looking for ways to de-spaghttify my front-end widget code. It's been suggested that a Finite State Machine is the right way to think about what I'm doing. I know a State Machine paradigm can be applied to almost any problem. I'm wondering if there are some experienced UI programmers who actually make a habit of this. So, t...

How do I build this finite automaton?

I'm studying for a Discrete Mathematics test and I found this exercise which I can't figure out. "Build a basic finite automaton (DFA,NFA,NFA-lambda) for the language in the alphabet Sigma = {0,1,2} where the sum of the elements in the string is even AND this sum is more than 3" I have tried using Kleene's Theorem concatenating two lan...

Online resources for Finite Automata Theory

Could someone point me to some good online material for finite automata theory? Wikipedia articles are very concise. ...

Building a lexer in C

I want to build a lexer in C and I am following the dragon book, I can understand the state transitions but how to implement them? Is there a better book? The fact that I have to parse a string through a number of states so that I can tell whether the string is acceptable or not! ...

How do you normalize a finite state machine?

How do you find the minimal Deterministic FSM? Is there a way to normalize non-deterministic FSMs? Is there a linear time bound algorithm to find the minimal FSM for a given machine? Is there a way to see if two FSMs are equivalent? This is not a homework question. I was watching this lecture series and just got curious. ...

Finite State Machine in Objective-C

Does anyone have a solution for a basic, compact Finite state machine/automata written in Objective-C code? I am interested in reusable components so that the FSM have states added and actions defined that use reusable state classes. ...

Should a Finite State Machine have a "nested" Finite State Machine?

You can read this question where I ask about the best architecture for a machine application for a little back story, although it's not entirely necessary for helping me with this question. My understanding (especially for implementation) of Finite State Machine's is a little young and may be lacking a bit, but I am implementing this ap...

Finite machine interpreter

I'm doing formal method and one of the project is to create a finite machine interpreter using java.it needs to read NFA from a text file and then convert from NFA to DFA. It also needs to output DFA to a text file.Then it goes to run through the symbol input and process DFA showing result whether accept or reject. I don't have much of ...

nfa to dfa algorithm

I've read a text file of symbols,states and transition n put it all in a table.It looks like this: symbols a, b states q1, q2, q3, q4 start state q4 final state q2, q3 transition state: q4, epsilon, q1 q1, a, q2 q3, a, q3 q3, b, q1 I've read an algorithm of how to convert it but don't really understand it and how would I create transi...

Real time Alerts

Hi All, I am trying to produce a real time Alert system. I am not sure on how to quote this. Eg. I have a network sniffer that would be listening to the Packets. Let us say two packets come from the same machine stating that a Wrong password was entered into a NT System. Than I want to raise an Alert. Let us say a Failed Logon is follo...

Does C# include finite state machines?

I've recently read about the boost::statechart library (finite state machines) and I loved the concept. Does C# have a similar mechanism ? Or can it be implemented using a specific design pattern? ...

what is use of finite automata ?

What is the use of finite automata. And all the concepts that we study in the theory of computation. I've never seen their uses yet. ...