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