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.4.tar.gz
(4.1 kB
view details)
File details
Details for the file automathon-0.0.4.tar.gz
.
File metadata
- Download URL: automathon-0.0.4.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- 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 | 9be37107a9549271fff3cfe302efb0dbabf26a4dd8bdb70249cbf0fc7c174a2b |
|
MD5 | 7df4ec70a94c2c81c6cd465c5e371858 |
|
BLAKE2b-256 | 010f56ca5e17a0754cedfeb4711402e99083c40a6ccb033e232eb1df5ef1f04d |