A web application for converting Non-deterministic Finite Automata (NFA) to Deterministic Finite Automata (DFA) with AI-powered diagram analysis.
- AI-powered Diagram Analysis: Upload images of NFA diagrams and have them automatically analyzed
- Interactive Editing: Review and edit the AI analysis results before conversion
- NFA to DFA Conversion: Convert NFAs to DFAs using the subset construction algorithm
- Visualization: View and download both the original NFA and the converted DFA diagrams
The application consists of:
- Frontend: Streamlit-based web interface
- AI Analysis: Mistral AI vision model for analyzing automata diagrams
- Conversion Engine: C++ implementation of the subset construction algorithm
- Visualization: Graphviz-based rendering of the resulting DFA
- Python 3.8+
- C++ compiler (g++ with C++17 support)
- Graphviz
-
Clone the repository:
git clone https://github.com/yourusername/automata-converter.git cd automata-converter -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up your Mistral API key:
- Create a
.streamlit/secrets.tomlfile with:MISTRAL_API_KEY = "your-mistral-api-key"
- Create a
-
Start the application:
streamlit run app.py
-
Open your browser and navigate to the URL shown in the terminal (typically http://localhost:8501)
-
Follow the steps in the application:
- Upload an image of an NFA diagram
- Review and edit the AI analysis results
- Convert the NFA to a DFA
- View and download the visualizations
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
- Mistral AI for providing the vision model capabilities
- Graphviz for graph visualization
- Streamlit for the web application framework