- Notifications
You must be signed in to change notification settings - Fork0
A full-stack web application that allows users to define a Deterministic Finite State Machine (DFSM), simulate input strings, and generate a visual PDF representation of the DFA.
mobasith/Simulation-of-DFSM
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A full-stack web application that allows users to define aDeterministic Finite State Machine (DFA), simulate input strings against it, and generate avisual PDF representation of the DFA. Built usingAngular andFastAPI, with DFA logic powered byautomata-lib and Graphviz.
- Define DFA (states, alphabet, transitions, start/accept states)
- Input a string and check if it's accepted
- Visualize the DFA structure as a downloadable PDF
- Practical tool for automata theory
- Frontend: Angular 17+
- Backend: FastAPI (Python 3.10+)
- DFA logic: automata-lib v1.0.0
- Visualization: graphviz
Navigate to backend:
- cd backend
Create and activate virtual environment:
- python -m venv venv
- source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
- pip install -r requirements.txt
Install Graphviz (Required for PDF output):
- Linux/macOS:
- sudo apt install graphviz
- Windows:
- Download fromhttps://graphviz.org/download/
- Linux/macOS:
Run the FastAPI server:
- uvicorn main:app --reload
Navigate to frontend folder:
- cd Angular_frontend
Install dependencies:
- npm install
Run the frontend app:
- ng serve
Visit:http://localhost:4200
- Backend (requirements.txt):
- fastapi==0.111.0
- uvicorn==0.30.1
- automata-lib
- graphviz==0.20.3
- pydantic==2.7.1
- Frontend (Angular v17+):
- Angular CLI v17
- RxJS v7+
- TypeScript v5+
States: q0,q1,q2
Alphabet: 0,1
Start State: q0
Accept States: q2
Input String: 010
Transitions:
- q0,0,q1
- q0,1,q0
- q1,0,q1
- q1,1,q2
- q2,0,q2
- q2,1,q2(remove the number bullets and paste )
String verdict: Accepted ✅ or Rejected ❌
DFA PDF: Downloadable file from /pdf/dfa_output.pdf
Mohammed Basith📫 LinkedIn:www.linkedin.com/in/mohammed-basith-97326321b
About
A full-stack web application that allows users to define a Deterministic Finite State Machine (DFSM), simulate input strings, and generate a visual PDF representation of the DFA.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.