Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dboyliao/pyautomata
https://github.com/dboyliao/pyautomata
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dboyliao/pyautomata
- Owner: dboyliao
- Created: 2016-02-14T15:50:30.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-14T16:07:30.000Z (almost 9 years ago)
- Last Synced: 2024-03-15T01:43:10.748Z (8 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## `automata` - A Simple Python Package for Playing with Automata
## Deterministic Finite Automata
```{python}
from automata.dfa import DFA
from automata.transition import TransitionTablealphabet = ["a", "b"]
states = ["1", "2"]
table = TransitionTable(alphabet, states)
table.add_transition("b", "2", "2")
table.add_transition("a", "1", "2")
table.add_transition("b", "1", "1")dfa = DFA(table)
accepted = dfa.consume("bba")
if accepted:
print "'bba' is accepted."
else:
print "'bba' is not accepted."
```## Install
- run `make install` to install dependencies for this package.
- see `requirements.txt` for required packages.## Test
1. run `make test` to run the tests.
- run `make install` first to install the packages required for testing.
2. see the result of the tests in `tests/reports/index.html`.