Dear Simone,
a few things:
* are your negative and positive "inputs" complete input words that should
be accepted/rejected or individual input symbols, such that a word should
e.g. be rejected if it contains "bad" symbols? If the former, wouldn't the
SampleSetEQOracle from before already be the type of EQ oracle you need?
If the latter, what happens if test sequences contain both good and bad
symbols?
* counterexamples (DefaultQueries) can hold the expected output of the
query. So in case of acceptor-based systems (DFAs) you can provide a
boolean value to describe either a positive (should be accepted) or
negative (should be rejected) counterexample. What would help here is
using the generic types of Java so that you get better compiler support.
* I think in your case it would be easier to just implement the EQ oracle
interface rather than trying to extend the WMethod oracle. After
delegating the counterexample search to super.findCounterexample you are
already past the point of testing, which is exactly what you want to
override. However, you can simply use the same (internal) methods of the
WMethodOracle to generate test-sequences of the WMethod.
* Be careful to not let the MQ oracle and EQ oracle go out-of-sync.
Altering only the equivalence check and e.g. returning negative
counterexamples if they contain "bad" symbols can be problematic if the
normal MQ oracle still accepts them. You would then have
non-output-deterministic systems (MQ says 'yes', EQ says 'no') which for
the current algorithms in LearnLib is forbidden. Maybe a "filter" for you
MQ oracle that disables certain "bad" input symbols (rejects them) and
sticking to the regular EQ oracles would be the better approach?
Anyway, I hacked together a few lines [0] which hopefully do what I
understood from your scenario. At least they should give you a starting
point for your own equivalence check.
Kind regards,
Markus
[0] -
https://gist.github.com/mtf90/6806e3bf210b21bb285b2bab34f44bc4
Am Mo, 17.02.2020, 12:24 schrieb 'Simone Agostinelli' via LearnLib Q&A:
> Dear Markus,
>
> Thank you for the directions you spell ;)
>
> I want to share with you the skeleton of my code and the basic idea of
> what
> my code should do.
>
>
https://pastebin.com/cuzQTthq
>
> The SUL works in the following way: it (i) accepts both the positives
> input
> and (ii) rejects all the negatives ones. The goal is to build an automaton
> that captures and models this behavior. The problem I have with the code
> is
> that I can't find *programmatically* a way that allows me to capture all
> the negatives input in the automaton, that is, I am not able to find a
> method that allows me to model the rejection of the negatives input. With
> the method *findCounterExample()* I am able to model the positives input