- They use finite automata to compute the result of the regex.
Abstract
They create DFA / NFA, then usually perform depth first search.
or represented by a DFARegular Language
A regular language is any language that can be representeed by a regular expression. A language is regular if for some regular expression .
Link to original- You can represent any set of strings as a sequence of characters as a regex.
Tip
You can concatenate any set of strings to form regex.
graph LR; start-->A; A(( ))-->|a|B; B(( ))-->|a,b|B; B-->|c|C((( )));
- s \in \Sigma^* \\ \\ B(\Sigma, Q, Qs, F, P) \\ \rho(q,c,q'): \text{Boolean} \\ \\ \hat \rho (qs, []) &= qs \\ \hat \rho (qs, c::s) &= \hat \rho \begin{pmatrix} \bigcup_{q \in qs} \{ q' | p(q,c,q') \}, s \end{pmatrix} \text{ (breadth first search)} \\ &= \bigcup_{q \in qs} \hat \rho (\{ q' | \rho(q,c,q') \}, s) \text{ (depth first search)} \end{aligned}$$
- Begin by making sure the finite automaton is complete:
graph LR; start; q0((q0)); q1(((q1))); start-->q0; q0-->|a|q1; q1-->|b|q1;
Now, flip accepting and non accepting states.
graph LR; q0(((q0))); q1((q1)); q2(((q2))); start-->q0; q0-->|a|q1; q1-->|b|q1; q0-->q2; q1-->q2; q2-->|a,b|q2;
- DFA:
graph LR; start; q0((q0)); q1((q1)); q2(((q2))); start-->q0; q0-->|b|q0; q0-->|a|q1; q1-->|b|q0; q1-->|a|q2; q2-->|a|q2; q2-->|b|q0;
10
Mark all pairs that are accepting and non-accepting (brz algorithm)
Example: we look at the pair 3,2, if we try 0, we end up at 3,4, one accept/reject 3,1, if we try 0, we end up both at 4, two accept, so don’t mark

We merge the states resulting in:
graph LR; start; a((2,0)); b((3,1)); c(((4))); start-->a; a-->|1|a; a-->|0|b; b-->|1|a; b-->|0|c; c-->|0,1|c;
11
Sub into other equations.
Arden’s lemma
Sub back in and Arden’s lemma
and are accepting states hence we find .
12
13
Some regular expressions are exponential in length (even after minimisation) when building the actual autonoma.
14
Base Case Prove for
Show equivalence between known rules for nullable for these 3 cases, and check the RHS .
Recursive Case Prove for sequence, alternate, star.
[proofs 1 video explains this]