Class BlackBoxVerifier<I>
- Type Parameters:
I- The type of input symbols at each step.
This class provides a comprehensive framework for verifying the behavior of a black-box system by comparing it against a set of Signal Temporal Logic (STL) properties. It utilizes learning algorithms, equivalence oracles, and model checkers to identify any discrepancies between the expected and actual behaviors of the system.
- Author:
- Masaki Waga <masakiwaga@gmail.com>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MealyEQOracleChain<String, String> The equivalence oracle used to find counterexamples by comparing the learned model with the black-box system.private final net.automatalib.alphabet.Alphabet<String> The alphabet of input symbols used in the verification process.The learned Mealy machine that models the behavior of the black-box system based on test cases.private final LearningAlgorithm.MealyLearner<String, String> The learning algorithm used to learn the behavior of the black-box system from test cases.(package private) MembershipOracle.MealyMembershipOracle<String, String> The membership oracle used to evaluate test cases and provide the system's output for given inputs.private final net.automatalib.modelchecking.ModelChecker.MealyModelChecker<String, String, String, net.automatalib.automaton.transducer.MealyMachine<?, String, ?, String>> The model checker used to verify the learned Mealy machine against Signal Temporal Logic (STL) properties.private final AdaptiveSTLUpdater<I> The adaptive STL updater that manages and updates the Signal Temporal Logic (STL) properties to be verified.private LongThe timeout value in seconds used for equivalence oracle operations.private final List<TimeoutEQOracle<String, String>> A list of timeout oracles used to manage timeouts for equivalence oracle operations.The System Under Learning (SUL) representing the black-box system to be verified. -
Constructor Summary
ConstructorsConstructorDescriptionBlackBoxVerifier(MembershipOracle.MealyMembershipOracle<String, String> memOracle, SUL<String, String> verifiedSystem, AdaptiveSTLUpdater<I> properties, net.automatalib.alphabet.Alphabet<String> inputAlphabet) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBFOracle(double multiplier) voidaddCompleteExplorationEQOracle(int minDepth, int maxDepth, int batchSize) addCornerCaseEQOracle(int length, int minStep) Add a corner case equivalence oracle.voidvoidaddRandomWalkEQOracle(double restartProbability, long maxSteps, Random random) voidaddRandomWordEQOracle(int minLength, int maxLength, int maxTests, Random random, int batchSize) voidaddWpMethodEQOracle(int maxDepth) private VerificationResult<I> processMealy(int rounds) Extract the counterexamples from the learned Mealy machine and validate them by the SUL.private static introunds(MealyExperiment<String, String> experiment) Returns the number of the learning rounds of an experiment recorded by LearnLib's statistics service.run()Run black-box checking.voidsetTimeout(long timeout) Set timeout to the equivalence oracle added next time.private booleanviolates(String ltlProperty, net.automatalib.word.Word<String> input, net.automatalib.word.Word<String> output) Checks if an observed trace violates an LTL formula.voidVisualize the Mealy machine witnessing a counterexample.voidVisualize the learned Mealy machinevoidWirte the DOT of the Mealy machine witnessing a counterexample.voidWirte the DOT of the learned Mealy machine.voidWrite the ETF of the learned Mealy machine.
-
Field Details
-
EDGE_PARSER
-
memOracle
MembershipOracle.MealyMembershipOracle<String,String> memOracleThe membership oracle used to evaluate test cases and provide the system's output for given inputs. -
verifiedSystem
The System Under Learning (SUL) representing the black-box system to be verified. -
learnedMealy
The learned Mealy machine that models the behavior of the black-box system based on test cases. -
inputAlphabet
The alphabet of input symbols used in the verification process. -
learner
The learning algorithm used to learn the behavior of the black-box system from test cases. -
eqOracle
The equivalence oracle used to find counterexamples by comparing the learned model with the black-box system. -
properties
The adaptive STL updater that manages and updates the Signal Temporal Logic (STL) properties to be verified. -
modelChecker
private final net.automatalib.modelchecking.ModelChecker.MealyModelChecker<String,String, modelCheckerString, net.automatalib.automaton.transducer.MealyMachine<?, String, ?, String>> The model checker used to verify the learned Mealy machine against Signal Temporal Logic (STL) properties. -
timeoutOracles
A list of timeout oracles used to manage timeouts for equivalence oracle operations. -
timeout
The timeout value in seconds used for equivalence oracle operations.
-
-
Constructor Details
-
BlackBoxVerifier
public BlackBoxVerifier(MembershipOracle.MealyMembershipOracle<String, String> memOracle, SUL<String, String> verifiedSystem, AdaptiveSTLUpdater<I> properties, net.automatalib.alphabet.Alphabet<String> inputAlphabet) - Parameters:
memOracle- The membership oracleproperties- The LTL properties to be verified. What we verify is the conjunction of the properties.inputAlphabet- The input alphabet.
-
-
Method Details
-
addWpMethodEQOracle
public void addWpMethodEQOracle(int maxDepth) -
addBFOracle
public void addBFOracle(double multiplier) -
addRandomWordEQOracle
public void addRandomWordEQOracle(int minLength, int maxLength, int maxTests, Random random, int batchSize) -
addRandomWalkEQOracle
-
addCompleteExplorationEQOracle
public void addCompleteExplorationEQOracle(int minDepth, int maxDepth, int batchSize) -
addCornerCaseEQOracle
public EvaluationCountable.MealyEquivalenceOracle<String,String> addCornerCaseEQOracle(int length, int minStep) Add a corner case equivalence oracle.This oracle tries the corner case input, i.e., the inputs with the same values
- Parameters:
length- The length of the input.minStep- The minimum step of the corner case.
-
addEqOracle
-
setTimeout
public void setTimeout(long timeout) Set timeout to the equivalence oracle added next time.- Parameters:
timeout- timeout in seconds.
-
run
Run black-box checking.The equivalence oracles are tried in the order of their addition until a counterexample is found, all the target specifications are falsified, or all the equivalence oracles are exhausted. Then, the counterexamples are extracted from the final learned Mealy machine and validated by the SUL. A failure of the SUL execution is reported as
VerificationResult.TerminationReason.EXECUTION_FAILUREinstead of an exception. If the failure happens while validating the counterexamples, the counterexamples validated before the failure are still reported.- Returns:
- the result of black-box checking
-
writeDOTCex
Wirte the DOT of the Mealy machine witnessing a counterexample.- Parameters:
cex- The counterexamplea- Write the DOT toa- Throws:
IOException- The exception by GraphDOT.write
-
writeDOTLearnedMealy
Wirte the DOT of the learned Mealy machine.- Parameters:
a- Write the DOT toa- Throws:
IOException- The exception by GraphDOT.write
-
visualizeCex
Visualize the Mealy machine witnessing a counterexample. -
visualizeLearnedMealy
public void visualizeLearnedMealy()Visualize the learned Mealy machine -
writeETFLearnedMealy
Write the ETF of the learned Mealy machine.- Parameters:
os- Write the ETF toos
-
processMealy
Extract the counterexamples from the learned Mealy machine and validate them by the SUL.- Parameters:
rounds- the number of the learning rounds- Returns:
- the result of black-box checking
-
violates
private boolean violates(String ltlProperty, net.automatalib.word.Word<String> input, net.automatalib.word.Word<String> output) Checks if an observed trace violates an LTL formula.We check the formula by the same model checker as the learned Mealy machine. The Mealy machine given to the model checker has only the observed trace, so the semantics is the same as the check of the learned Mealy machine restricted to this trace.
- Parameters:
ltlProperty- the LTL formulainput- the input word of the traceoutput- the output word of the trace- Returns:
trueif and only if the trace violatesltlProperty
-
rounds
Returns the number of the learning rounds of an experiment recorded by LearnLib's statistics service. The experiment records the rounds with itself as the owner, also before a failure of the learning.
-