Execution of examples from binaries

27 views
Skip to first unread message

Fabio Patrizi

unread,
Jul 11, 2019, 12:53:18 PM7/11/19
to LearnLib Q&A
Hi All,
I would like to try executing some examples that should be included in the binary distribution (I downloaded the binary version 0.14.0).
According to the API documentation the distribution should include a package named de.learnlib.examples, offering some sample executable classes (e.g., Example1), which I would like to execute.
However, in the jar distribution such package seems missing.

Any hint? (See that I would like to use the jar distribution)

Thanks in advance for any help.

Fabio.


Markus Frohme

unread,
Jul 11, 2019, 4:50:46 PM7/11/19
to Fabio Patrizi, LearnLib Q&A
Hi Fabio,


the examples are not deployed to Maven Central or contained in the distribution artifact, because from a library perspective, it is non-functional code.

The idea of the examples is to give you a hint, how your own application code could look like. So in a first instance, you could just copy one of the examples of your choice to your project to see if everything is set up correctly (build path, etc.) and then go on from there. Make sure, to use the examples from the release tag [0], because the develop version may have already seen some refactorings.

P.S.: you mentioned, according to the documentation, that the examples are part of the distribution artifact. Could you point me towards where it says that? Because that should be clarified.


Kind regards,
Markus

[0] - https://github.com/LearnLib/learnlib/tree/learnlib-0.14.0/examples/src/main/java/de/learnlib/examples
> --
> 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/1c95fd54-68b1-45cf-8684-c7bd6519d1c9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Fabio Patrizi

unread,
Jul 12, 2019, 5:23:14 AM7/12/19
to Markus Frohme, LearnLib Q&A
Dear Markus,
thanks a lot for your prompt reply.

My doubts arose because from the download page [1], by clicking on the link to the JavaDoc of v. 0.14.0 and then navigating, I could see a package named de.learnlib.examples, and some classes included in it, among which Example1. This made me believe that the distribution would include the examples.

As an additional source of confusion, the file you pointed me to on github ([0]) includes the following line (which I had to comment out in order for Example1 to compile):  package de.learnlib.examples; 
this also might make one expect the examples to be included in the distribution.

In any case, I easily managed to run Example1 (and I guess I can run all others in the same way) and I can now use the library. I just wanted to make sure that this was the right way to proceed and there was nothing missing from the library. 


Thanks again!
Fabio.


--
Fabio Patrizi
Dipartimento di Ingegneria informatica, automatica e gestionale "A. Ruberti"
Sapienza Università di Roma
Room B214
Via Ariosto, 25 - 00185 Rome, Italy

Markus Frohme

unread,
Jul 13, 2019, 3:38:57 PM7/13/19
to Fabio Patrizi, LearnLib Q&A
Hi Fabio,


this is actually a good catch! While we disabled deploying and bundling the example code, our toolchain still (wrongfully) publishes the associated JavaDoc. I'll make sure to clean this up, to prevent confusion in future versions. Thanks!


Regarding whether or not you have everything, there are two things to consider:

* AutomataLib offers a "brics-adapter" module, which allows you to wrap BRICS automata into AutomataLib automata. By design, the BRICS library is not shipped with AutomataLib. So if you want to "import" any BRICS automata, you would have to supply the BRICS JAR yourself.

* Currently LearnLib targets Java 8. While the code is compatible with newer versions (e.g Java 11+), we depend on classes shipped with JRE8 that have been removed/refactored in newer JREs (specifically, the javax annotations [0]). So if you want to use LearnLib in a 9+ environment, you would have to provide this JAR as well. We are looking forward to clean this up in future versions, so that this will no longer be an issue.


Kind regards,
Markus


[0] - https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api/1.3.2
> Fabio Patrizi
> Dipartimento di Ingegneria informatica, automatica e gestionale "A. Ruberti"
> Sapienza Universitą di Roma

Fabio Patrizi

unread,
Jul 15, 2019, 7:45:53 AM7/15/19
to Markus Frohme, LearnLib Q&A
Hi Markus,
thanks for the info. That's indeed the case, as I'm using J11. 
Best,
F

Sapienza Università di Roma
Reply all
Reply to author
Forward
0 new messages