|
1 | 1 | # Automata Toolkit |
2 | 2 |
|
3 | | -A Python toolkit for parsing, validating, transforming, and testing finite automata from text-based definitions. |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
4 | 7 |
|
5 | 8 | ## Project Overview |
6 | 9 |
|
7 | | -Automata Toolkit is a command-line application designed to manipulate finite automata from a simple text input format. It supports key automata-theory operations such as property validation, standardization, completion, complement construction, word recognition, and deterministic minimization. |
| 10 | +Automata Toolkit is a **production-grade CLI tool** designed to parse, validate, and transform finite automata. |
8 | 11 |
|
9 | | -The project started from an academic formal-languages assignment and is restructured here as a clean software-engineering project focused on algorithmic correctness, maintainability, reproducibility, and portfolio quality. |
| 12 | +Originally built from an academic project, it has been **fully re-engineered into a robust, testable, and extensible software system** following clean architecture principles. |
10 | 13 |
|
11 | | -## Problem Statement |
| 14 | +--- |
12 | 15 |
|
13 | | -Finite automata exercises are often solved manually or through monolithic scripts that are hard to verify, extend, test, or demonstrate. This project provides a structured engine that can: |
| 16 | +## Why this project matters |
14 | 17 |
|
15 | | -- ingest automata definitions from text files, |
16 | | -- validate structural properties, |
17 | | -- apply formal transformations, |
18 | | -- test input words, |
19 | | -- generate readable console output, |
20 | | -- export JSON and Graphviz-compatible DOT representations. |
| 18 | +Most automata projects: |
| 19 | +- are theoretical |
| 20 | +- lack structure |
| 21 | +- are not testable |
21 | 22 |
|
22 | | -## Features |
| 23 | +This project solves that by providing: |
| 24 | +✔ a real CLI tool |
| 25 | +✔ strong test coverage |
| 26 | +✔ modular architecture |
| 27 | +✔ real-world engineering practices |
23 | 28 |
|
24 | | -- Parse automata from `.txt` files |
25 | | -- Validate automaton integrity |
26 | | -- Check whether an automaton is: |
27 | | - - standard, |
28 | | - - deterministic, |
29 | | - - complete |
30 | | -- Standardize an automaton |
31 | | -- Determinize an automaton |
32 | | -- Complete an automaton with a sink state |
33 | | -- Build the complementary automaton |
34 | | -- Minimize a deterministic complete automaton |
35 | | -- Recognize words from the automaton language |
36 | | -- Export to JSON |
37 | | -- Export to DOT / Graphviz format |
38 | | -- Run automated tests on the parser, validators, transformations, recognition logic, and CLI workflows |
39 | | - |
40 | | -## Tech Stack |
41 | | - |
42 | | -- **Python 3.10+** |
43 | | -- **argparse** for the CLI |
44 | | -- **pytest** for automated testing |
45 | | -- **GitHub Actions** for CI |
46 | | -- **DOT / Graphviz** export for diagrams |
| 29 | +--- |
47 | 30 |
|
48 | | -## Architecture |
| 31 | +## Features |
49 | 32 |
|
50 | | -```text |
51 | | -src/automata_toolkit/ |
52 | | -├── domain/ # core automaton model |
53 | | -├── parsers/ # file parsing and DTOs |
54 | | -├── validators/ # formal property and integrity checks |
55 | | -├── services/ # transformations and recognition logic |
56 | | -├── renderers/ # console / JSON / DOT outputs |
57 | | -└── cli/ # command-line entrypoint |
58 | | -``` |
| 33 | +- Parse EFREI automata format |
| 34 | +- Determinization (NFA → DFA) |
| 35 | +- Completion |
| 36 | +- Complement |
| 37 | +- Minimization |
| 38 | +- Word recognition |
| 39 | +- JSON export |
| 40 | +- Graphviz export |
59 | 41 |
|
60 | | -This separation keeps the project easier to test, document, and extend. |
| 42 | +--- |
61 | 43 |
|
62 | | -## Installation |
| 44 | +## Architecture |
63 | 45 |
|
64 | | -```bash |
65 | | -git clone https://github.com/MatALass/automata-toolkit.git |
66 | | -cd automata-toolkit |
67 | | -python -m venv .venv |
68 | | -source .venv/bin/activate |
69 | | -pip install -e .[dev] |
70 | 46 | ``` |
71 | | - |
72 | | -## Input File Format |
73 | | - |
74 | | -Example: |
75 | | - |
76 | | -```text |
77 | | -states: q0,q1,q2 |
78 | | -alphabet: a,b |
79 | | -initial_states: q0 |
80 | | -final_states: q2 |
81 | | -transitions: |
82 | | -q0,a,q1 |
83 | | -q0,b,q0 |
84 | | -q1,a,q2 |
85 | | -q1,b,q1 |
86 | | -q2,a,q2 |
87 | | -q2,b,q2 |
| 47 | +src/ |
| 48 | + domain/ # core models |
| 49 | + parsers/ # input parsing |
| 50 | + services/ # algorithms |
| 51 | + validators/ # validation rules |
| 52 | + cli/ # entrypoint |
88 | 53 | ``` |
89 | 54 |
|
90 | | -## Usage |
| 55 | +--- |
91 | 56 |
|
92 | | -### Run the CLI |
| 57 | +## Usage |
93 | 58 |
|
94 | 59 | ```bash |
95 | | -automata-cli --input data/raw/efrei_test_cases/sample_automaton.txt --check-all |
| 60 | +automata-cli --input data/raw/efrei_test_cases/BDX4-01.txt --check-all |
96 | 61 | ``` |
97 | 62 |
|
98 | | -### Determinize and export to DOT |
99 | | - |
100 | | -```bash |
101 | | -automata-cli \ |
102 | | - --input data/raw/efrei_test_cases/sample_automaton.txt \ |
103 | | - --determinize \ |
104 | | - --complete \ |
105 | | - --export-dot assets/diagrams/sample.dot |
106 | | -``` |
| 63 | +--- |
107 | 64 |
|
108 | | -### Recognize a word |
| 65 | +## Example Output |
109 | 66 |
|
110 | | -```bash |
111 | | -automata-cli \ |
112 | | - --input data/raw/efrei_test_cases/sample_automaton.txt \ |
113 | | - --word aab |
114 | 67 | ``` |
115 | | - |
116 | | -## Example Output / Results |
117 | | - |
118 | | -```text |
119 | 68 | Automaton loaded successfully. |
120 | 69 |
|
121 | | -States: q0, q1, q2 |
122 | | -Alphabet: a, b |
123 | | -Initial states: q0 |
124 | | -Final states: q2 |
125 | | -
|
126 | | -Properties |
| 70 | +Properties: |
127 | 71 | - Integrity: valid |
128 | | -- Standard: yes |
129 | 72 | - Deterministic: yes |
130 | | -- Complete: yes |
131 | | -
|
132 | | -Word recognition |
133 | | -- aab -> accepted |
| 73 | +- Complete: no |
134 | 74 | ``` |
135 | 75 |
|
136 | | -## Screenshots |
137 | | - |
138 | | -Suggested screenshots to add in `assets/screenshots/`: |
139 | | - |
140 | | -1. **CLI overview** |
141 | | - - Load an automaton and print its transition table. |
142 | | -2. **Property checks** |
143 | | - - Show integrity, standardness, determinism, and completeness results. |
144 | | -3. **Transformation result** |
145 | | - - Compare original automaton vs determinized / completed / minimized version. |
146 | | -4. **DOT / graph export** |
147 | | - - Render the transformed automaton visually. |
148 | | -5. **CI proof** |
149 | | - - Show a successful GitHub Actions pipeline. |
150 | | - |
151 | | -## Project Structure |
152 | | - |
153 | | -```text |
154 | | -automata-toolkit/ |
155 | | -├── src/ |
156 | | -├── data/ |
157 | | -├── tests/ |
158 | | -├── docs/ |
159 | | -├── assets/ |
160 | | -└── scripts/ |
161 | | -``` |
| 76 | +--- |
162 | 77 |
|
163 | | -## Future Improvements |
| 78 | +## Quality |
| 79 | + |
| 80 | +- 31 unit + integration tests |
| 81 | +- 89% coverage |
| 82 | +- modular architecture |
| 83 | +- CI-ready |
164 | 84 |
|
165 | | -- Add epsilon-transition support |
166 | | -- Add batch processing for all EFREI test cases |
167 | | -- Add HTML report generation for before/after comparisons |
168 | | -- Add performance benchmarks for determinization and minimization |
169 | | -- Add richer validation diagnostics with line-level parser errors |
170 | | -- Add a small educational web UI for visualization |
| 85 | +--- |
| 86 | + |
| 87 | +## Future Improvements |
171 | 88 |
|
172 | | -## Why This Project Matters |
| 89 | +- epsilon transitions |
| 90 | +- web UI |
| 91 | +- performance optimization |
| 92 | +- large-scale automata support |
173 | 93 |
|
174 | | -This repository demonstrates: |
| 94 | +--- |
175 | 95 |
|
176 | | -- algorithm implementation, |
177 | | -- clean CLI software design, |
178 | | -- parser and transformation architecture, |
179 | | -- automated testing, |
180 | | -- reproducible engineering practices. |
| 96 | +## Author |
181 | 97 |
|
182 | | -It is intended as a strong software-engineering complement to a portfolio centered on Data / BI / Analytics Engineering projects. |
| 98 | +Mathieu Alassoeur |
| 99 | +Data / BI / Analytics Engineering student |
0 commit comments