A Python library for simulating finite automata
Project description
Automathon
Created by: Robin Hafid Quintero Lopez
A Python library for simulating finite automata
Links
- GitHub repository: https://github.com/rohaquinlop/automathon
- PyPI: https://pypi.org/project/automathon/
- Twitter: https://twitter.com/RobinHafid
- Contact: rohaquinlop301@gmail.com
Installation
PyPI
pip install automathon
Basic Example
Self-made, Public domain, via Wikimedia Commons
Representing the previous automata
from automathon import DFA
Q = {'q0', 'q1', 'q2'}
sigma = {'0', '1'}
delta = { 'q0' : {'0' : 'q0', '1' : 'q1'},
'q1' : {'0' : 'q2', '1' : 'q0'},
'q2' : {'0' : 'q1', '1' : 'q2'}
}
initialState = 'q0'
F = {'q0'}
automata1 = DFA(Q, sigma, delta, initialState, F)
## This is an example about creating a DFA with the library
Verify if the automata is valid
automata1.isValid() #True
Verify if the automata accept a string
automata1.accept("001001") #True
automata1.accept("00100") #False
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
automathon-0.0.3.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file automathon-0.0.3.tar.gz
.
File metadata
- Download URL: automathon-0.0.3.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f397ae06984042c2b42c342cdbb30006eab224812ca84a89c42f3b5929fd929 |
|
MD5 | 34d041070a9fbfb5c6b6758529324394 |
|
BLAKE2b-256 | 1aae1f29f95038e3621b1ed419045308ae0fb9984c5e706c1cc7ae09b350d419 |
File details
Details for the file automathon-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: automathon-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.59.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0548465d674193e71736ce2d1fb11faa1dc14afab49b03af6dd9961aa832838b |
|
MD5 | 914d31fc2c7b373635d46fb32e076d21 |
|
BLAKE2b-256 | e3d55c0860624e05bed99bbda24640fdf7fd66358ceeafc97b3d804d82f450b3 |