Skip to main content
AALpy Logo

Python application CodeQL PyPI - Downloads

GitHub issues GitHub pull requests Python 3.6 PyPI - Wheel Maintenance License: MIT


AALpy is a light-weight automata learning library written in Python. You can start learning models of black-box systems with a few lines of code.

Automata Type Supported Formalisms Active Algorithms Passive Algorithms
Deterministic DFAs
Mealy Machines
Moore Machines
L*
KV
L#
hW
RPNI
EDSM
Non-Deterministic ONFSM
Non-deterministic Moore Machines
Abstracted ONFSM
L*ONFSM k-tails
Stochastic Markov Decision Processes
Stochastic Mealy Machines
Markov Chains
L*MDP
L*SMM
Alergia
IoAlergia
AlergiaEDSM
Pushdown VPA/SEVPA KVVPA PAPNI

Installation

Use the package manager pip to install the latest release of AALpy:

pip install aalpy

To install current version of the master branch (it might contain bugfixes and added functionalities between releases):

pip install https://github.com/DES-Lab/AALpy/archive/master.zip

The minimum required version of Python is 3.6.
Ensure that you have Graphviz installed and added to your path if you want to visualize models.

For manual installation, clone the repo and install pydot (the only dependency).

Documentation and Wiki

High level introduction to automata learning can be found at the following Medium post. If you are interested in automata learning or would like to understand the automata learning process in more detail, please check out our Wiki. On Wiki, you will find more detailed examples on how to use AALpy.

Examples.py contains examples covering almost the whole of AALpy's functionality and its a great starting point.

Usage

All active automata learning procedures follow this high-level approach:

Passive learning algorithm simply require you to provide data in the appropriate format (check Wiki and Examples) and run the learning function.

Code snipped demonstrating some of AALpy's functionalities

The following snippet demonstrates a short example in which an automaton is either loaded or randomly generated and then learned.

from aalpy.utils import load_automaton_from_file, generate_random_deterministic_automata
from aalpy.SULs import AutomatonSUL
from aalpy.oracles import RandomWalkEqOracle
from aalpy.learning_algs import run_Lstar, run_KV

# load an automaton
# automaton = load_automaton_from_file('path_to_the_file.dot', automaton_type='dfa')

# or randomly generate one
random_dfa = generate_random_deterministic_automata(automaton_type='dfa', num_states=8, 
                                                    input_alphabet_size=5, output_alphabet_size=2)

# get input alphabet of the automaton
alphabet = random_dfa.get_input_alphabet()

# loaded or randomly generated automata are considered as BLACK-BOX that is queried
# learning algorithm has no knowledge about its structure
# create a SUL instance for the automaton/system under learning
sul = AutomatonSUL(random_dfa)

# define the equivalence oracle
eq_oracle = RandomWalkEqOracle(alphabet, sul, num_steps=5000, reset_prob=0.09)

# start learning
# run_KV is for the most part reacquires much fewer interactions with the system under learning
learned_dfa = run_KV(alphabet, sul, eq_oracle, automaton_type='dfa')
# or run L*
# learned_dfa_lstar = run_Lstar(alphabet, sul, eq_oracle, automaton_type='dfa')

# save automaton to file and visualize it
# save_automaton_to_file(learned_dfa, path='Learned_Automaton', file_type='dot')
# or
learned_dfa.save()

# visualize automaton
# visualize_automaton(learned_dfa)
learned_dfa.visualize()
# or just print its DOT representation
print(learned_dfa)

To make experiments reproducible, define a random seed at the beginning of your program.

from random import seed
seed(2) # all experiments will be reproducible

Selected Applications

AALpy has been used to:

Cite AALpy and Research Contact

If you use AALpy in your research, please cite us with of the following:

If you have research suggestions or you need specific help concerning your research, feel free to start a discussion. We are happy to help you and consult you in developing automata learning algorithms and in applying automata learning in various domains.

Contributing

Pull requests are welcome. For significant changes, please open an issue first to discuss what you would like to change. In case of any questions or possible bugs, please open issues.

Metadata

Release files for aalpy 1.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aalpy 1.6.2
File Size Uploaded
aalpy-1.6.2.tar.gz 153.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aalpy 1.6.2
File Interpreter ABI Platform
aalpy-1.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 343.7 kB

Release files / aalpy-1.6.2.tar.gz

Download URL aalpy-1.6.2.tar.gz
Size 153.6 kB
Tags Source
SHA-256 checksum
How to use checksums
67bc36a988cf35e16d95927f2a824ef27d4bd067ba85acd083c0dc2cc732da02
BLAKE2b-256 checksum
How to use checksums
8168969ae10576a802ba3339295ed56d080961814782468b7a4cf598163bcce0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / aalpy-1.6.2-py3-none-any.whl

Download URL aalpy-1.6.2-py3-none-any.whl
Size 190.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da2034eab661506f634c5c69dd793527b658daf6fb5fead4e2c9498bd464f6ec
BLAKE2b-256 checksum
How to use checksums
3541b6227b467bb8e9e3420245d4d14885182af4ae6f64980dc02253a22c4f0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

2 release files

1.6.0

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.9

1 release file

1.2.8

1 release file

1.2.7

1 release file

1.2.6

1 release file

1.2.5

1 release file

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.13

1 release file

1.1.12

1 release file

1.1.11

1 release file

1.1.10

1 release file

1.1.9

1 release file

1.1.8

1 release file

1.1.7

1 release file

1.1.6

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page