Overview
This project focuses on building a system to represent and manipulate Non-deterministic Finite Automata (NFA), with the goal of converting them into equivalent Deterministic Finite Automata (DFA).
At its core, the project implements:
- A fully functional
NFAclass - Support for validating input strings
- An intersection operation between two NFAs
- visualization for understand the automata
BackGround
An NFA is defined as:
M = {Q, Σ, δ, q₀, F}
Where:
Q: Finite set of statesΣ: Finite input alphabetδ: Transition function mapping (state, symbol) → subset of statesq₀: Initial stateF: Set of accepting (final) states
What I Worked On
This was a 2 person group project, I focused on...
Base NFA Class
I implemented the foundational structure of the NFA class, including:
- State management (
Q) - Alphabet handling (
Σ) - Transition function (
δ) - Initial and final state validation
Epsilon Closure Logic
A big part of working with NFAs is handling epsilon moves. An epsilon move in an NFA is a transition that happens without consuming any input character. I implemented the logic needed to correctly compute epsilon closures, which is essential for:
- Accurate simulation of NFAs
- Future conversion to DFA
Visualization
I did almost the entire visual side of the project, my understanding only goes as far as I can explain it and using visuals is a great tool for this so I always like to do some. The visuals show:
- how states connect
- the transitions
- See the result of operations like intersection
this is just a quick overview, read the git link below for more (: