Each state is a member of some group, and for each group you have a list of the states in the group. To find the transitions for a group G1, pick one of the states S1 in the group, take the transitions for S1, and for each target state S2...

string,algorithm,substring,dfa,knuth-morris-pratt

Let us take a look at the following FA for pattern ACACAGA. The abvoe diagrams represent graphical and tabular representations of pattern ACACAGA. Here, number of states in DFA is M + 1 where M is length of the pattern. The main thing to construct DFA is to get the...

Regarding your first question, on the runtime of the non-optimal DFA. Purely theoretically your intuition that it should still run in O(n) is correct. However, imagine (as an example) the following pseudo-code for the Kleene-Star operator: // given that the kleene-star operator starts at i=something while string[i] == 'r': accepting...

If you want more of an explanation on how I derived this, I'd be happy to explain, but for now I just drew the DFA and explained each state. Sorry about the screenshot...I didn't know how to convert it straight to an image. On input 0 at state 0, it...

To my understanding, the desired DFA can be obtained by using a modified product automaton, as used for the intersection of L1 and L2, but the terminal states have to be defined differently. Instead of making a product state (q_1,q_2) a terminal state if and only if q_1 and q_2...

racket,fsm,dfa,finite-state-machine,nfa

Your plan does not work. Consider this machine: States: S,L,F Alphabet: a,b Start state: S Final state S S-a->L (arrow from S to L given a) S-b->F L-a->L Strings accepted by this machine: {b} If you make a new machine where L is a final state, then {empty,a,aa,aaa,...} will be...

The error no matching function for call to 'DFA::DFA(int&, char [2], char [4][2], char&, char [1]) is due to the fact that a bonafide 2 dimensional array (in this case, a char[4][2]) is not the same as a char**. That is the simple explanation (I won't go into why it...

If the alphabet is only size two, then the following doesn't require backrefences. I apologize if the syntax isn't quite right: I've not used JavaCC. ("b")? ("b")? ("a" ("a")? "b" ("b")?)* ("a")? ("a")? ...

regular-language,finite-automata,dfa,pumping-lemma

A perhaps easier way to proof this is first modifying the language. Since regular languages are closed under complement and the intersection with another regular expression. This means that you can proof L is not a regular language by proving complement(L) is not a regular language, because if L' is...

intersection,dfa,deterministic,automaton

To the best of my knowledge, there's no "direct" algorithm that accomplishes this. You can do this by minimizing the two input DFAs, computing their Cartesian product (which produces another DFA, by the way, not an NFA), then minimizing the result. It's not strictly necessary to minimize the two input...

regex,grammar,dfa,chomsky-hierarchy

Type 3 Chomsky are the class of regular grammars constricted to the use of following rules: X -> aY X -> a, in which X is an arbitrary non-terminal and a an arbitrary terminal. The rule A -> eps is only allowed if A is not present in any of...