On the instability of generative automata

109 views
Skip to first unread message

guo guo

unread,
Aug 30, 2021, 9:54:09 PM8/30/21
to LearnLib Q&A
Dear Markus,

The same input characters, but the EXPLORATION_DEPTH is different. I ran the  EXPLORATION_DEPTH   of 1, 2 and 3 respectively. However, the generated automata diagrams are different. Some have multiple states, but the states can be merged. Why is that? In other words, they are actually a picture, but they are different.I looked at the OT table. Will the sequence of the OT table generate prefixes in different depths in different priority? Because the prefix character order of  EXPLORATION_DEPTH   1 and  EXPLORATION_DEPTH  2 is different, although they are the same input characters. Or do I need to run deeper? For example, 4. Thank you very much!

Kind regards,
Guo

Markus Frohme

unread,
Aug 31, 2021, 6:35:29 PM8/31/21
to guo guo, LearnLib Q&A
Dear Guo,


usually, the learner only posts queries until a stable hypothesis can be constructed from the observations. If, for example, the initial state of your SUL behaves identical for all input symbols, only a single-state hypothesis will be constructed initially.

The driving force in active automata learning are counterexamples because they are witnesses for in-equivalent behavior and are used to refine (i.e. increase the number of states of) the hypothesis. Consequently, the more counterexamples you find, the more refined your final hypothesis will be.

The problem in practice is often the question "when to stop?" because the black-box equivalence problem is undecidable and without any additional assumptions you can never be sure when you are finished. In practice, it often becomes a question of "how much time do you want to spend on finding counterexamples?". The longer you search (i.e. the bigger your EXPLORATION_DEPTH is), the more counterexamples you are able to find and the more precise your final hypothesis will be, but the longer the whole learning process will take.

I hope this gives a general idea of how the different components affect the learning process.

Kind regards,
Markus
> --
> You received this message because you are subscribed to the Google Groups "LearnLib Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to learnlib-qa...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/learnlib-qa/868400be-1e75-477f-8bbe-f7a069cca7aen%40googlegroups.com.

guo guo

unread,
Sep 9, 2021, 3:15:47 AM9/9/21
to LearnLib Q&A
Dear Markus,

I want to call DFARandomWpMethodEQOracle, but I don't understand the meaning of the parameters. What is bound? What does "specify the bound" mean? What is batchsize? Can you give me an example? Or where can I know? What should I do if I want to rewrite the equivalent query? Thank you again for your helpful answer!

Sincerely,
Guo

Markus Frohme

unread,
Sep 9, 2021, 8:04:52 AM9/9/21
to guo guo, LearnLib Q&A
Dear Guo,


since the DFARandomWpMethodEQOracle uses (partially) randomly generated
words, you never really finish generating test words -- there always
exists a next random word. In the worst-case, when you have already
learned the final hypothesis, i.e., the exist no more counterexamples, the
DFARandomWpMethodEQOracle would generate test words indefinitely. With the
"bound" parameter, you can limit how many test words you want to generate
at maximum.

With the "batchSize" parameter, you can decide how many test words are
sent to the membership oracle at once. This is usually only useful when
you are using parallel membership oracles that can split the batches to
different SUL instances. If you are using a single-threaded environment
(i.e., a single membership oracle instance) you can ignore this parameter.


If you are unsure about what the code does, remember that LearnLib is
open-source and we publish our source-archives to Maven central as well.
Most IDEs allow you automatically download and open the source archives so
that you can jump directly to the actual code and do not have to look at
pre-compiled bytecode.


Kind regards,
Markus


Am Do, 9.09.2021, 09:15 schrieb guo guo:
> Dear Markus,
>
> I want to call DFARandomWpMethodEQOracle, but I don't understand the
> meaning of the parameters. What is bound? What does "specify the bound"
> mean? What is batchsize? Can you give me an example? Or where can I know?
> What should I do if I want to rewrite the equivalent query? Thank you
> again
> for your helpful answer!
>
> Sincerely?
> Guo


guo guo

unread,
Sep 16, 2021, 3:02:36 AM9/16/21
to LearnLib Q&A

Dear Markus,

I can understand the meaning of learning rounds as the number of conjectures proposed by the algorithm? The conjecture comes from Learning Regular Sets from Queries
And Counterexamples *, how can I get every  conjecture ? I think the code uses Hypothesis instead. How can I dynamically get the number of Hypothesis each time?

Sincerely,
Guo

Markus Frohme

unread,
Sep 16, 2021, 10:31:25 AM9/16/21
to guo guo, LearnLib Q&A
Dear Guo,


I assume, you have only used the "Experiment" class (like in [0]) to
construct your setups, right? This class encapsulates the boiler-plate
code that is necessary for running the learn-loop. But you can also
re-implement its "run" method yourself. This allows you to sprinkle some
of your own code in between. For example, the following code visiualizes
each hypothesis between two refinement steps (variables are the same from
[0]).

//---
lstar.startLearning();
DFA<?, Character> hyp = lstar.getHypothesisModel();
Visualization.visualize(hyp, inputs);

DefaultQuery<Character, Boolean> ce = wMethod.findCounterExample(hyp,
inputs);
while (ce != null) {
lstar.refineHypothesis(ce);
hyp = lstar.getHypothesisModel();
ce = wMethod.findCounterExample(hyp, inputs);

Visualization.visualize(hyp, inputs);
}
//---


Depending on your needs, you can also do things like printing internal
data-structures of the learner (observation table, discrimination trees,
etc.).


Kind regards,
Markus


[0] -
https://github.com/LearnLib/learnlib/blob/develop/examples/src/main/java/de/learnlib/examples/Example1.java#L81


Am Do, 16.09.2021, 09:02 schrieb guo guo:
>
> Dear Markus,
>
> I can understand the meaning of learning rounds as the number of
> conjectures proposed by the algorithm? The conjecture comes from Learning
> Regular Sets from Queries
> And Counterexamples *, how can I get every conjecture ? I think the code
> uses Hypothesis instead. How can I dynamically get the number of
> Hypothesis
> each time?
>
> Sincerely?
> Guo

guo guo

unread,
Sep 25, 2021, 7:04:48 AM9/25/21
to LearnLib Q&A
Dear Markus,

Can DFARandomWMethodEQOracle only be called once? I want to make the bound parameter in DFARandomWMethodEQOracle dynamic, not fixed. For example, add 1 dynamically every time I call, so that I can provide sequences according to the number I need. What should I do? I may need to call DFARandomWMethodEQOracle multiple times, and I need to change the bound parameter every time.Thank you!

Sincerely,
Guo

Markus Frohme

unread,
Sep 26, 2021, 11:45:53 AM9/26/21
to guo guo, LearnLib Q&A
Dear Guo,


instead of using the same "wMethod" variable, you can also create new EQ oracle instances with new parameters in the learning loop. For the learner it is not important how the counterexample has been computed, as long as it is valid.

If you don't care about the randomization of the middle part, you can also use the "regular" W- or partial W-method oracles (e.g. DFAWMethodOracle, DFAWpMethodOracle). These oracles support input parameters for the minimal lookahead and the expected size of the hypothesis in order to dynamically adjust to increasing hypothesis sizes. See, e.g., [0,1] for reference.


Kind regards,
Markus


[0] - https://learnlib.github.io/learnlib/maven-site/0.16.0/apidocs/de/learnlib/oracle/equivalence/DFAWMethodEQOracle.html
[1] - https://learnlib.github.io/learnlib/maven-site/0.16.0/apidocs/de/learnlib/oracle/equivalence/DFAWpMethodEQOracle.html

Am Sat, Sep 25, 2021 at 04:04:48AM -0700 schrieb guo guo:
> Dear Markus,
>

guo guo

unread,
Dec 8, 2021, 8:54:00 AM12/8/21
to LearnLib Q&A
Dear Markus,

Long time no see, I found the application jABC, but it seems out of date. Does the popular learnlib framework still have  jABC  ?, How to use it? I want to use it to learn web applications. What should I do? Look forward to your reply.

Sincerely,
Guo

Markus Frohme

unread,
Dec 8, 2021, 7:46:51 PM12/8/21
to guo guo, LearnLib Q&A
Dear Guo,


just to make things clear: jABC is not a part of LearnLib. jABC is a general purpose tool for modelling and executing business processes (either interpreted or via code generation) that is independent of LearnLib. However, there was a "LearnLib Studio" which was a jABC "productline" tailored towards automata learning (i.e. you could model learning processes with it).

That said, jABC is currently no longer maintained and probably won't be in the future. However, there is a spiritual successor to jABC (some may even call it jABC 5) called "Cinco" [0]. There has even been a Master's thesis to lift the old LearnLib Studio to the new Cinco stack [1]. However, I haven't been following the project, so I can't really say anything about it.

If you are interested in learning web applications, I'd like to suggest you ALEX [2] which is a LearnLib-based tool for specifically learning and testing web applications. Since ALEX itself is a docker-based web-application as well, it is easy to setup and use. There is also a lot of documentation available which should get you going easily.


Kind regards,
Markus


[0] - https://cinco.scce.info/
[1] - https://github.com/LearnLib/learnlib-studio
[2] - https://github.com/LearnLib/alex

guo guo

unread,
Jan 6, 2022, 3:32:45 AM1/6/22
to LearnLib Q&A
Dear Markus,

    I want to implement examples in Alex docs, but I don't know how to start todoMVC, and I can't find this  todomvc-react.project.json   file. I look forward to your reply and thank you again for your help!

Sincerely,
Guo

Alexander Bainczyk

unread,
Jan 7, 2022, 4:45:16 AM1/7/22
to LearnLib Q&A
Hi Guo,

you can find the project file for TodoMVC in the React implementation here: https://raw.githubusercontent.com/LearnLib/alex/master/docs/.vuepress/public/files/todomvc-react.project.json 

Setting up TodoMVC locally isn't that straightforward, since the project is not maintained very well. I advice you to install any HTTP server locally and then serve the static contents of the downloadable archive from their homepage. With Nodejs, you could install the http-server package 'npm install -g http-server', navigate to the TodoMVC directory, run 'http-server .' and open 'http://localhost:8080' in a web browser.

Greetings,
Alex

guo guo

unread,
Jan 7, 2022, 8:55:38 AM1/7/22
to LearnLib Q&A
Dear Alexander,

   Thank you very much for your help. According to the content of the example part in the file and the information you provided, I should be able to realize it, but it shows the content on the picture. Why? (I provided some relevant pictures to help you understand my question more) I look forward to your reply.

Sincerely,
Guo
p1.pngp2.pngp3.pngp4.pngp5.png

Alexander Bainczyk

unread,
Jan 7, 2022, 9:09:33 AM1/7/22
to LearnLib Q&A
Hi,

If you are using ALEX with Docker, the base URL of a project can not be "localhost" because of the way how Docker handles the networking stuff.  So, instead of "localhost", the base URL of a project should start with: "http://docker.host.internal" (for Linux) and "http://192.168.65.2" (for MacOS and Windows) which will be resolved to the address of your localhost by Docker internally.

Greetings,
Alex

guo guo

unread,
Jan 7, 2022, 9:41:22 AM1/7/22
to LearnLib Q&A
Dear Alexander,

 What should I do? I changed several URLs, but none of them succeeded. Thank you very much.

Sincerely,
Guo

guo guo

unread,
Jan 7, 2022, 10:32:51 AM1/7/22
to LearnLib Q&A
Dear Alexander,

Thank you. I didn't configure it well. Now it's solved!

Sincerely,
Guo
Reply all
Reply to author
Forward
0 new messages