-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to minimize a chained mealy automata #57
Comments
|
Hi, @mtf90 public static void main(String[] args) throws IOException {
Alphabet<Character> alphabet = Alphabets.characters('a', 'b');
CompactMealy<Character, Integer> mealy = AutomatonBuilders.<Character, Integer>newMealy(alphabet)
.withInitial(0)
.from(0).on('a').withOutput(1).to(1)
.from(1).on('b').withOutput(2).to(2)
.from(2).on('a').withOutput(1).to(3).from(3).on('b').withOutput(2).to(4)
.create();
StringBuilder b = new StringBuilder();
GraphDOT.write(mealy, mealy.getInputAlphabet(), b);
System.out.println(b.toString());
CompactMealy<Character, Integer> mealy_minimized = Automata.invasiveMinimize(mealy, mealy.getInputAlphabet());
GraphDOT.write(mealy_minimized, mealy_minimized.getInputAlphabet(), b);
System.out.println(b.toString());
} The output is
The mealy automata was not minimized. Did I use it wrong? Thanks. |
Sorry, I should have looked at the automaton models more closely. Your two models are not equivalent. Your first model only supports translating the input sequence "abab" (there are no successors to state 4) whereas your expected model supports translating alternations of "a" and "b" of indefinite length. You probably want to change the last As a result, the minimization essentially reconstructs the original automaton and only renames the existing nodes. |
Got it! Thank you for your time and expertise.
By modeling each tuple of request and response, we can generate the following chained Mealy machine:
Since the protocol session has a limited length, it is impossible to construct a chained Mealy machine of indefinite length. However, based on the insight, we can infer that the protocol state machine should be:
I wonder if there is any tool that can help me minimize the chained Mealy machine generated from a protocol session and can be used as the protocol state machine. |
Your description sounds exactly like the problem that automata learning is trying to solve: based on a finite set of observations, try to generalize the observed behavior to a finite state machine. Depending on how you can provide the observations either passive automata learning or active automata learning may be better suited. Conveniently, LearnLib offers solutions for both use-cases 😆. If it is of any help, there also has been some research on applying automata learning to TCP implementations in the recent past (https://doi.org/10.1007/978-3-319-10702-8_6, https://doi.org/10.1007/978-3-319-67113-0_12). However, the register automata stuff is not yet implemented in LearnLib. |
@mtf90 Thanks for your helpful guidance! As my task involves inferring a protocol model based on a set of traffic observations, I believe that passive automata learning is the way to go. However, I have been unsuccessful in finding any examples or tutorials on how to accomplish this in LearnLib. LearnLib is a powerful tool, but there are relatively few tutorials available for it. Could you please let me know which class/function can help me achieve this? Thanks so much for your time and expertise. |
There exists an |
@mtf90 Thanks for your helpful guidance! I'll try it 😆. |
@grandnew are there any question left to this particular issue, or can it be closed? |
I'm closing this issue for now since the problem seems to be solved. Feel free to open it again, if you find an actual problem within AutomataLib. |
Hi, I want to minimize the following mealy machine:
with dot graph:
The expected minimized machine is:
How to achieve this? Thanks.
The text was updated successfully, but these errors were encountered: