Lexical analysis
Finite Automata
Draw or load a DFA or NFA, check whether it is deterministic, and run strings through it step by step.
- Lecture reference: Lexical Analysis III
DFA: strings ending in 00
Lecture reference: Lexical Analysis IIIA complete DFA over { 0, 1 }: every state has a 0- and a 1-transition.
What language does this recognize? Give the RE.
Show answer
L(R) where R = (0 | 1)*00
The strings over { 0, 1 } that end in 00.
Automaton
3 states · 6 transitions. Select a state or a transition to edit it.
Run
1100
Step 1 of 5
Start in state A.
Path
- →1
- →1
- →0
- →0
The outcome is decided at the end of the input.
M = (Σ, S, s0, F, T)
- Σ
- = { 0, 1 }
- input alphabet
- S
- = { A, B, C }
- states
- s0
- = A
- start state
- F
- = { C }
- accepting states
T : S × Σ → S transition function
- A→0B
- A→1A
- B→0C
- B→1A
- C→0C
- C→1A
Batch run
3 of 6 accepted.
- Accept "00" ends in C
- Accept "100" ends in C
- Accept "1100" ends in C
- Reject "001" ends in A
- Reject "0" ends in B
- Reject "" ends in A