Skip to main content

Python state machine learning library

Project description

STMLearn

STMLearn is a python library which implements several active state machine learning algorithms. This library is currently under active development, and things may change at any time. If you want to use this for anything important right now you would probably be better off with LearnLib :)

Learning algorithms:

at the moment L* and TTT are supported for DFAs and Mealy machines.

Algorithm DFA Mealy machine
L* ✔️
TTT ✔️

Equivalence checking methods:

The following equivalence checking methods are available, or will be soon:

  • W-method
  • Smart W-method (early stopping etc.)
  • Random walk
  • Brute force

Simple example:

# Set up a SUL using regex
sm = RegexMachine('(bb)*(aa)*(bb)*')

# We are using the brute force equivalence checker
eqc = BFEquivalenceChecker(sm, max_depth=15)

# Set up the teacher, with the system under learning and the equivalence checker
teacher = Teacher(sm, eqc)

# Set up the learner who only talks to the teacher
learner = LStarDFALearner(teacher)

# Get the learners hypothesis
hyp = learner.run()

# Draw the learned dfa
hyp.render_graph(tempfile.mktemp('.gv'))

For the SUL described by the regular expression (bb)*(aa)*(bb)* the following dfa is learned: simple dfa

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

stmlearn-0.0.3.tar.gz (53.6 kB view hashes)

Uploaded Source

Built Distribution

stmlearn-0.0.3-py3-none-any.whl (82.1 kB view hashes)

Uploaded Python 3

Supported by

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