Skip to main content

ssfsm is a constructive library implementing deterministic finite state machines. The fun thing is, that it has a stupidly simple API.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssfsm-0.6.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file ssfsm-0.6.0.tar.gz.

File metadata

  • Download URL: ssfsm-0.6.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ssfsm-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f93e65bcd7e4067707e9bc99ebc15fed7e9389de4b38b82d21e5b1431b016828
MD5 5a0cc1498afd6c0a64368a7eb676a32a
BLAKE2b-256 13374f7438529ae5a7175b9e6e328baaeff6d42c456cc2b75274a7bd3d429c98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page