Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An Automata Learning Library Written in Python

License

NotificationsYou must be signed in to change notification settings

DES-Lab/AALpy

Repository files navigation

AALpy Logo

Python applicationCodeQLPyPI - Downloads

GitHub issuesGitHub pull requestsPython 3.6PyPI - WheelMaintenanceLicense: MIT


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

Automata TypeSupported FormalismsActive AlgorithmsPassive Algorithms
DeterministicDFAs
Mealy Machines
Moore Machines
L*
KV
L#
RPNI
EDSM
Non-DeterministicONFSM
Non-deterministic Moore Machines
Abstracted ONFSM
L*ONFSMk-tails
StochasticMarkov Decision Processes
Stochastic Mealy Machines
Markov Chains
L*MDP
L*SMM
Alergia
IoAlergia
AlergiaEDSM
PushdownVPA/SEVPAKVVPAPAPNI

Installation

Use the package managerpip 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 haveGraphviz installed and added to your path if you want to visualize models.

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

Documentation and Wiki

High level introduction to automata learning can be found at the followingMedium post.If you are interested in automata learning or would like to understand the automata learning process in more detail,please check out ourWiki. 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 eitherloaded orrandomly generated and thenlearned.

fromaalpy.utilsimportload_automaton_from_file,generate_random_deterministic_automatafromaalpy.SULsimportAutomatonSULfromaalpy.oraclesimportRandomWalkEqOraclefromaalpy.learning_algsimportrun_Lstar,run_KV# load an automaton# automaton = load_automaton_from_file('path_to_the_file.dot', automaton_type='dfa')# or randomly generate onerandom_dfa=generate_random_deterministic_automata(automaton_type='dfa',num_states=8,input_alphabet_size=5,output_alphabet_size=2)# get input alphabet of the automatonalphabet=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 learningsul=AutomatonSUL(random_dfa)# define the equivalence oracleeq_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 learninglearned_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')# orlearned_dfa.save()# visualize automaton# visualize_automaton(learned_dfa)learned_dfa.visualize()# or just print its DOT representationprint(learned_dfa)

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

fromrandomimportseedseed(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 adiscussion or contactedi.muskardin@silicon-austria.com.We are happy to help you and consult you 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.


[8]ページ先頭

©2009-2025 Movatter.jp