11package de .learnlib .algorithm .lstar ;
22
3- import java .io .IOException ;
43import java .util .Collections ;
54import java .util .List ;
65
7- import de .learnlib .algorithm .lstar .it .ExtensibleLStarMMLTIT ;
6+ import de .learnlib .algorithm .lstar .it .ExtensibleLStarMMLTIT . Example ;
87import de .learnlib .algorithm .lstar .mmlt .ExtensibleLStarMMLT ;
98import de .learnlib .driver .simulator .MMLTSimulatorSUL ;
109import de .learnlib .oracle .equivalence .mmlt .SimulatorEQOracle ;
1110import de .learnlib .oracle .membership .TimedSULOracle ;
1211import de .learnlib .oracle .symbol_filters .AcceptAllSymbolFilter ;
1312import de .learnlib .query .DefaultQuery ;
13+ import de .learnlib .testsupport .example .LearningExample .MMLTLearningExample ;
1414import de .learnlib .testsupport .example .mmlt .MMLTExamples ;
15- import de .learnlib .testsupport .example .mmlt .MMLTModel ;
1615import net .automatalib .automaton .mmlt .MMLT ;
17- import net .automatalib .exception .FormatException ;
1816import net .automatalib .symbol .time .InputSymbol ;
1917import net .automatalib .symbol .time .TimedInput ;
2018import net .automatalib .symbol .time .TimedOutput ;
2826@ Test
2927public class ExtensibleLStarMMLTCounterexampleTests {
3028
31- private static <S , I , T , O > void learnModel (MMLTModel <S , I , T , O > model , List <Word <TimedInput <I >>> counterexamples ) {
29+ private static <I , O > void learnModel (MMLTLearningExample <I , O > example ,
30+ List <Word <TimedInput <I >>> counterexamples ) {
3231
33- var sul = new MMLTSimulatorSUL <>(model . automaton ().getSemantics ());
34- var timeOracle = new TimedSULOracle <>(sul , model . params ());
32+ var sul = new MMLTSimulatorSUL <>(example . getReferenceAutomaton ().getSemantics ());
33+ var timeOracle = new TimedSULOracle <>(sul , example . getParams ());
3534
36- var learner = new ExtensibleLStarMMLT <>(model .automaton ().getInputAlphabet (), model .params (), Collections .emptyList (),
37- timeOracle , new AcceptAllSymbolFilter <>());
35+ var learner = new ExtensibleLStarMMLT <>(example .getReferenceAutomaton ().getInputAlphabet (),
36+ example .getParams (),
37+ Collections .emptyList (),
38+ timeOracle ,
39+ new AcceptAllSymbolFilter <>());
3840
3941 learner .startLearning ();
4042
@@ -44,7 +46,7 @@ private static <S, I, T, O> void learnModel(MMLTModel<S, I, T, O> model, List<Wo
4446 }
4547
4648 // Now continue until arriving at an accurate model:
47- SimulatorEQOracle <I , O > simOracle = new SimulatorEQOracle <>(model . automaton ());
49+ SimulatorEQOracle <I , O > simOracle = new SimulatorEQOracle <>(example . getReferenceAutomaton ());
4850
4951 DefaultQuery <TimedInput <I >, Word <TimedOutput <O >>> cex ;
5052 MMLT <Integer , I , ?, O > hyp = learner .getHypothesisModel ();
@@ -56,9 +58,9 @@ private static <S, I, T, O> void learnModel(MMLTModel<S, I, T, O> model, List<Wo
5658 }
5759
5860 @ Test
59- public void testOverApproxReset () throws IOException , FormatException {
61+ public void testOverApproxReset () {
6062 // Infers a missing local reset instead of a missing discriminator first.
61- var model = ExtensibleLStarMMLTIT . automatonFromFile ("over_approx_reset.dot" );
63+ var model = new Example ("over_approx_reset.dot" );
6264
6365 // Missing discriminator at non-del in stable config:
6466 List <Word <TimedInput <String >>> cex1 = List .of (
@@ -69,9 +71,9 @@ public void testOverApproxReset() throws IOException, FormatException {
6971 }
7072
7173 @ Test
72- public void testRecursiveDecomp () throws IOException , FormatException {
74+ public void testRecursiveDecomp () {
7375 // Triggers recursive decomposition
74- var model = ExtensibleLStarMMLTIT . automatonFromFile ("recursive_decomp.dot" , 3 );
76+ var model = new Example ("recursive_decomp.dot" , 3 );
7577
7678 // Missing discriminator at non-del in stable config:
7779 List <Word <TimedInput <String >>> cex1 = List .of (
@@ -108,7 +110,7 @@ public void testMissingDiscriminators() {
108110 @ Test
109111 public void testMissingResets () {
110112 var model = MMLTExamples .SensorCollector ();
111- model .params ().setMaxTimerQueryWaitingTime (40 );
113+ model .getParams ().setMaxTimerQueryWaitingTime (40 );
112114
113115 // Missing reset in stable config:
114116 List <Word <TimedInput <String >>> cex1 = List .of (
@@ -133,7 +135,7 @@ public void testMissingResets() {
133135 public void testMissingOneShotModelB () {
134136 // Setting max waiting = 6 -> all inferred timers are periodic:
135137 var model = MMLTExamples .SensorCollector ();
136- model .params ().setMaxTimerQueryWaitingTime (6 );
138+ model .getParams ().setMaxTimerQueryWaitingTime (6 );
137139
138140 // Missing one-shot via bad return to entry:
139141 List <Word <TimedInput <String >>> cex1 = List .of (
@@ -156,7 +158,7 @@ public void testMissingOneShotModelB() {
156158 @ Test
157159 public void testMissingOneShotModelA () {
158160 var model = MMLTExamples .SensorCollector ();
159- model .params ().setMaxTimerQueryWaitingTime (40 );
161+ model .getParams ().setMaxTimerQueryWaitingTime (40 );
160162
161163 // Missing one-shot via bad output:
162164 List <Word <TimedInput <String >>> cex1 = List .of (
@@ -176,5 +178,4 @@ public void testMissingOneShotModelA() {
176178 learnModel (model , cex2 );
177179 }
178180
179-
180181}
0 commit comments