Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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.

NotificationsYou must be signed in to change notification settings

mobasith/Simulation-of-DFSM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

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.

🚀 Features

  • 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

🛠️ Tech Stack

  1. Frontend: Angular 17+
  2. Backend: FastAPI (Python 3.10+)
  3. DFA logic: automata-lib v1.0.0
  4. Visualization: reportlab, matplotlib

🧑‍💻 Installation

Backend:

  1. Navigate to backend:
    cd backend
  2. Create and activate virtual environment:
    python -m venv venv
    source venv/bin/activate

On Windows: venv\Scripts\activate

  1. Install dependencies:

    pip install -r requirements.txt
  2. Install Graphviz (Required for PDF output):

  3. Run the FastAPI server:

    uvicorn main:app --reload

Frontend:

  1. Navigate to frontend folder:
    cd Angular_frontend
  2. Install dependencies:
    npm install
  3. Run the frontend app:
    ng serve

Visit:http://localhost:4200

🧱 Dependencies:

  • Backend (requirements.txt):
  1. annotated-types==0.7.0
  2. anyio==4.9.0
  3. automata-lib==9.0.0
  4. cached_method==0.1.0
  5. charset-normalizer==3.4.2
  6. click==8.2.1
  7. colorama==0.4.6
  8. contourpy==1.3.2
  9. cycler==0.12.1
  10. fastapi==0.115.14
  11. fonttools==4.58.5
  12. frozendict==2.4.6
  13. graphviz==0.21
  14. h11==0.16.0
  15. idna==3.10
  16. kiwisolver==1.4.8
  17. matplotlib==3.10.3
  18. networkx==3.5
  19. numpy==2.3.1
  20. packaging==25.0
  21. pillow==11.3.0
  22. pydantic==2.11.7
  23. pydantic_core==2.33.2
  24. pyparsing==3.2.3
  25. python-dateutil==2.9.0.post0
  26. reportlab==4.4.2
  27. six==1.17.0
  28. sniffio==1.3.1
  29. starlette==0.46.2
  30. typing-inspection==0.4.1
  31. typing_extensions==4.14.1
  32. uvicorn==0.35.0
  • Frontend (Angular v17+):
  1. Angular CLI v17
  2. RxJS v7+
  3. TypeScript v5+

🧪 Example Input

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

📥 Output

String verdict: Accepted ✅ or Rejected ❌

DFA PDF: Downloadable file from /pdf/dfa_output.pdf

🙌 Author

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp