2022-07-16 19:55:57 -04:00
|
|
|
## Concatenation
|
|
|
|
|
2022-07-17 07:32:57 -04:00
|
|
|
Regex : `/^AB$/`
|
|
|
|
Psuedo: `start AB end`
|
2022-07-16 19:55:57 -04:00
|
|
|
|
|
|
|
Machine:
|
|
|
|
```
|
|
|
|
->o --A--> o --epsilon--> o --B--> (o)
|
|
|
|
|
|
|
|
Submachine_A --epsilon--> Submachine_B
|
|
|
|
```
|
|
|
|
|
|
|
|
## Union
|
|
|
|
|
2022-07-17 07:32:57 -04:00
|
|
|
Regex : `/^A|B$/`
|
|
|
|
Psuedo: `start A | B end`
|
2022-07-16 19:55:57 -04:00
|
|
|
|
|
|
|
Machine:
|
|
|
|
```
|
2022-07-16 20:01:13 -04:00
|
|
|
epsilon--> o --A--> o --epsilon
|
|
|
|
/ \
|
|
|
|
->o ->(o)
|
|
|
|
\ /
|
|
|
|
epsilon--> o --B--> o --epsilon
|
2022-07-16 19:55:57 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
## Kleene Closure
|
|
|
|
|
2022-07-17 07:32:57 -04:00
|
|
|
Regex : `/^A*$/`
|
|
|
|
Psuedo: `start A.repeat(0-) end`
|
2022-07-16 19:55:57 -04:00
|
|
|
|
|
|
|
Machine:
|
|
|
|
```
|
2022-07-17 03:09:42 -04:00
|
|
|
<------episilon-------
|
2022-07-16 20:01:13 -04:00
|
|
|
/ \
|
2022-07-16 19:55:57 -04:00
|
|
|
->o --epsilon--> o --A--> o --epsilon--> (o)
|
2022-07-16 20:01:13 -04:00
|
|
|
\ /
|
|
|
|
-------------epsilon---------------->
|
2022-07-16 19:55:57 -04:00
|
|
|
```
|