Package net.maswag.falcaun
Class BlackBoxVerifier<I>
java.lang.Object
net.maswag.falcaun.BlackBoxVerifier<I>
- Type Parameters:
I- The type of input symbols at each step.
Verifies a black-box system against specified properties using various equivalence oracles and model checking techniques.
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>
-
Field Summary
FieldsModifier and TypeFieldDescriptionA list of input words that led to counterexamples found during the verification process.A list of Mealy machines representing counterexamples found during the verification process.A list of output words produced by the black-box system for the counterexamples found during the verification process.private List<TemporalLogic<I>>A list of Signal Temporal Logic (STL) properties that were violated by the counterexamples found during the verification process.private 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 booleanSet the counter example input/output.booleanrun()voidsetTimeout(long timeout) Set timeout to the equivalence oracle added next time.voidvisualizeCex(int index) Visualize the found counter example.voidVisualize the learned Mealy machinevoidwriteDOTCex(int index, Appendable a) Wirte the DOT of the found counter example.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. -
cexMealy
A list of Mealy machines representing counterexamples found during the verification process. -
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. -
cexInput
A list of input words that led to counterexamples found during the verification process. -
cexProperty
A list of Signal Temporal Logic (STL) properties that were violated by the counterexamples found during the verification process. -
cexOutput
A list of output words produced by the black-box system for the counterexamples found during the verification process. -
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
public boolean run()- Returns:
- Returns
trueif and only if the given black-box system is verified i.e., no counter example is found.
-
writeDOTCex
Wirte the DOT of the found counter example.- Parameters:
a- 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
public void visualizeCex(int index) Visualize the found counter example. -
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
private boolean processMealy()Set the counter example input/output.- Returns:
- Returns
trueif and only if the black-box system is verified i.e., no counter example is found for any system.
-