You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Python toolkit for reading, validating, transforming, and testing finite automata from text-based definitions.
3
+
A Python toolkit for parsing, validating, transforming, and testing finite automata from text-based definitions.
4
4
5
5
## Project Overview
6
6
7
-
Automata Toolkit is a command-line application designed to manipulate finite automata from a simple input format. It supports core operations from automatatheory such as standardization, determinism checks, completion, complement construction, and word recognition.
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.
8
8
9
-
The project was originally inspired by an academic formal-languages assignment and has been redesigned as a clean, testable software-engineering project focused on algorithmic correctness, reproducibility, and maintainability.
9
+
The project started from an academic formal-languages assignment and is restructured here as a cleansoftware-engineering project focused on algorithmic correctness, maintainability, reproducibility, and portfolio quality.
10
10
11
11
## Problem Statement
12
12
13
-
Finite automata exercises are often solved manually or with ad hoc scripts that are hard to verify, extend, or demonstrate. This project provides a structured engine to:
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:
14
14
15
-
-load automata from text files,
15
+
-ingest automata definitions from text files,
16
16
- validate structural properties,
17
17
- apply formal transformations,
18
-
- test word recognition,
19
-
- produce readable transition tables and visual exports.
18
+
- test input words,
19
+
- generate readable console output,
20
+
- export JSON and Graphviz-compatible DOT representations.
20
21
21
22
## Features
22
23
23
-
-Load automata from `.txt` files
24
-
-Display states, alphabet, initial/final states, and transition tables
24
+
-Parse automata from `.txt` files
25
+
-Validate automaton integrity
25
26
- Check whether an automaton is:
26
-
- standard
27
-
- deterministic
27
+
- standard,
28
+
- deterministic,
28
29
- complete
29
-
- Standardize a non-standard automaton
30
-
- Determinize and complete a non-deterministic automaton
31
-
- Minimize a deterministic complete automaton
32
-
- Recognize user-provided words
30
+
- Standardize an automaton
31
+
- Determinize an automaton
32
+
- Complete an automaton with a sink state
33
33
- Build the complementary automaton
34
-
- Export automata to Graphviz / JSON
35
-
- Run automated tests on reference automata
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
36
39
37
40
## Tech Stack
38
41
39
-
-**Python**
40
-
-**pytest** for testing
41
-
-**Typer** or **argparse** for CLI
42
-
-**Graphviz** for diagram export
42
+
-**Python 3.10+**
43
+
-**argparse** for the CLI
44
+
-**pytest** for automated testing
43
45
-**GitHub Actions** for CI
46
+
-**DOT / Graphviz** export for diagrams
44
47
45
48
## Architecture
46
49
47
-
The codebase is organized into five layers:
48
-
49
-
-`domain/` → automaton model and core entities
50
-
-`parsers/` → input file parsing
51
-
-`validators/` → property checks
52
-
-`services/` → automata transformations
53
-
-`renderers/` → console, JSON, and graph exports
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
+
```
54
59
55
-
This separation keeps the project easier to test, maintain, and extend.
60
+
This separation keeps the project easier to test, document, and extend.
56
61
57
62
## Installation
58
63
@@ -62,108 +67,116 @@ cd automata-toolkit
62
67
python -m venv .venv
63
68
source .venv/bin/activate
64
69
pip install -e .[dev]
65
-
Usage
66
-
Run the CLI
67
-
python -m automata_toolkit.cli.main
68
-
Example workflow
69
-
python -m automata_toolkit.cli.main \
70
-
--input data/raw/efrei_test_cases/BDX4-08.txt \
71
-
--check-all \
72
-
--determinize \
73
-
--complete \
74
-
--recognize aab
75
-
Example output
76
-
Automaton loaded successfully
77
-
States: [0, 1, 2, 3]
78
-
Alphabet: [a, b]
79
-
Initial states: [0]
80
-
Final states: [3]
81
-
82
-
Properties:
83
-
- Standard: No
84
-
- Deterministic: No
85
-
- Complete: No
86
-
87
-
Actions performed:
88
-
- Standardization: applied
89
-
- Determinization: applied
90
-
- Completion: applied
91
-
92
-
Word recognition:
93
-
- aab -> accepted
94
-
Example Results
95
-
96
-
The toolkit can be used to:
97
-
98
-
validate a full batch of reference automata,
99
-
100
-
compare original and transformed versions,
101
-
102
-
generate deterministic and minimized forms,
103
-
104
-
document algorithm behavior for teaching or demonstrations.
105
-
106
-
Screenshots
107
-
Suggested screenshots to add
108
-
109
-
CLI overview
110
-
111
-
Load an automaton and print its transition table
70
+
```
112
71
113
-
Property checks
72
+
## Input File Format
114
73
115
-
Show standard / deterministic / complete results
74
+
Example:
116
75
117
-
Transformation result
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
88
+
```
118
89
119
-
Show original automaton vs determinized/complete version
90
+
## Usage
120
91
121
-
Graph export
92
+
### Run the CLI
122
93
123
-
Render the transformed automaton as a diagram
124
-
125
-
Test report
126
-
127
-
Show passing unit tests and integration tests
128
-
129
-
Project Structure
130
-
src/automata_toolkit/
131
-
data/raw/efrei_test_cases/
132
-
tests/
133
-
docs/
134
-
assets/
135
-
Future Improvements
136
-
137
-
Add epsilon-transition support with explicit closure computation
0 commit comments