ssfsm is a constructive library implementing deterministic finite state machines. The fun thing is, that it has a stupidly simple API. Example:
# A FSM that accepts b*a(ab)* import ssfsm A = ssfsm.Machine() A.One['a'] = A.Two A.One['b'] = A.One A.Two['ab'] = A.Two # a and b transition A.Two = True # Set state Two to accepting A().reset(A.One)
And transitions are done this way:
A('a') # a-Transition
A('ab') # a-Transition followed by b-Transition
bool(A) # is A in an accepting state
Some helpers to make construction even easier so the first example can be written as:
import ssfsm
A = ssfsm.Machine('One')
A().alphabet = 'ab'
A.One['b'] = A.One
A().polyfill(A.Two)
A.Two = True
Metadata
Release files for ssfsm 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ssfsm-0.6.0.tar.gz | 3.2 kB | Details |
Release files / ssfsm-0.6.0.tar.gz
| Download URL | ssfsm-0.6.0.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f93e65bcd7e4067707e9bc99ebc15fed7e9389de4b38b82d21e5b1431b016828
|
|
BLAKE2b-256 checksum How to use checksums |
13374f7438529ae5a7175b9e6e328baaeff6d42c456cc2b75274a7bd3d429c98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |