Package net.maswag.falcaun
Class NumericSULVerifier
java.lang.Object
net.maswag.falcaun.NumericSULVerifier
- Direct Known Subclasses:
SimulinkSULVerifier
Verifier of a NumericSUL
- Author:
- Masaki Waga <masakiwaga@gmail.com>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EvaluationCountable.Sumprivate final NumericSULMapperprivate final NumericMembershipOracleprivate final List<NumericMembershipOracleCost> protected final NumericSULprivate final doubleprotected de.learnlib.sul.SUL<List<Double>, IOSignalPiece<List<Double>>> private final BlackBoxVerifier<List<Double>> -
Constructor Summary
ConstructorsConstructorDescriptionNumericSULVerifier(NumericSUL rawSUL, double signalStep, AdaptiveSTLUpdater<List<Double>> properties, NumericSULMapper mapper) Constructor for SimulinkVerifier. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBFOracle(double multiplier) voidaddCompleteExplorationEQOracle(int minDepth, int maxDepth, int batchSize) voidaddCornerCaseEQOracle(int length, int minStep) Add a corner case equivalence oracle.voidaddGAEQOracle(Function<IOSignal<List<Double>>, Double> costFunc, int length, int maxTests, ArgParser.GASelectionKind selectionKind, int generationSize, double crossoverProb, double mutationProbability, de.learnlib.oracle.PropertyOracle.MealyPropertyOracle<String, String, String> ltlOracle) add a Genetic algorithm-based equivalence oraclevoidaddGAEQOracleAll(int length, int maxTest, ArgParser.GASelectionKind selectionKind, int populationSize, double crossoverProb, double mutationProb) voidaddHillClimbingEQOracle(Function<IOSignal<List<Double>>, Double> costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord, de.learnlib.oracle.PropertyOracle.MealyPropertyOracle<String, String, String> ltlOracle) addHillClimbingEQOracle.voidaddHillClimbingEQOracle(TemporalLogic.STLCost costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord) voidaddHillClimbingEQOracleAll(int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord) (package private) voidaddMutateSelectEQOracle(Function<IOSignal<List<Double>>, Double> costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, int changeSize, boolean resetWord) voidaddRandomWalkEQOracle(double restartProbability, long maxSteps, Random random) voidaddRandomWordEQOracle(int minLength, int maxLength, int maxTests, Random random, int batchSize) voidaddSAEQOracle(Function<IOSignal<List<Double>>, Double> costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord, double alpha, de.learnlib.oracle.PropertyOracle.MealyPropertyOracle<String, String, String> ltlOracle) addSAEQOracle.voidaddSAEQOracleAll(int length, Random random, int maxTest, int generationSize, int childrenSize, boolean resetWord, double alpha) (package private) voidaddSimulinkEqOracle(Function<IOSignal<List<Double>>, Double> costFunc, Function<NumericMembershipOracleCost, ? extends EvaluationCountable.MealyEquivalenceOracle<String, String>> constructor) voidaddWpMethodEQOracle(int maxDepth) voidclose()Close the MATLAB engine.Returns the falsified STL formulas in the string representation.doubleintintbooleanrun()run.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 machinevoidWrite the ETF of the learned Mealy machine.
-
Field Details
-
simulink
-
rawSUL
-
mapper
-
verifier
-
memOracle
-
memOracleCosts
-
evaluationCountables
-
signalStep
private final double signalStep
-
-
Constructor Details
-
NumericSULVerifier
public NumericSULVerifier(NumericSUL rawSUL, double signalStep, AdaptiveSTLUpdater<List<Double>> properties, NumericSULMapper mapper) Constructor for SimulinkVerifier.
- Parameters:
rawSUL- The system under test.signalStep- The signal step in the simulationproperties- The LTL properties to be verifiedmapper- The I/O mapper between abstract/concrete Simulink models.
-
-
Method Details
-
getCexProperty
Returns the falsified STL formulas in the string representation. -
addSimulinkEqOracle
void addSimulinkEqOracle(Function<IOSignal<List<Double>>, Double> costFunc, Function<NumericMembershipOracleCost, ? extends EvaluationCountable.MealyEquivalenceOracle<String, String>> constructor) -
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 void 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.
-
setTimeout
public void setTimeout(long timeout) Set timeout to the equivalence oracle added next time.- Parameters:
timeout- timeout in seconds.
-
addHillClimbingEQOracle
public void addHillClimbingEQOracle(TemporalLogic.STLCost costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord) -
addHillClimbingEQOracle
public void addHillClimbingEQOracle(Function<IOSignal<List<Double>>, Double> costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord, de.learnlib.oracle.PropertyOracle.MealyPropertyOracle<String, String, String> ltlOracle) addHillClimbingEQOracle.
-
addHillClimbingEQOracleAll
public void addHillClimbingEQOracleAll(int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord) -
addSAEQOracle
public void addSAEQOracle(Function<IOSignal<List<Double>>, Double> costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord, double alpha, de.learnlib.oracle.PropertyOracle.MealyPropertyOracle<String, String, String> ltlOracle) addSAEQOracle.
-
addMutateSelectEQOracle
-
addGAEQOracle
public void addGAEQOracle(Function<IOSignal<List<Double>>, Double> costFunc, int length, int maxTests, ArgParser.GASelectionKind selectionKind, int generationSize, double crossoverProb, double mutationProbability, de.learnlib.oracle.PropertyOracle.MealyPropertyOracle<String, String, String> ltlOracle) add a Genetic algorithm-based equivalence oracle- Parameters:
costFunc- The cost function assigning a Double to each OutputSignal. This is typically an STL formula.length- length of the generated signalsmaxTests- maximum test sizeselectionKind- kind of the selection methodgenerationSize- size of each generation. This must be an even number.crossoverProb- probability to have crossovermutationProbability- probability to have mutationltlOracle- the LTL formula
-
getCexAbstractInput
-
getCexConcreteInput
-
getCexOutput
-
run
public boolean run()run.
- Returns:
- Returns
trueif and only if the Simulink model 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
-
writeETFLearnedMealy
Write the ETF of the learned Mealy machine.- Parameters:
os- Write the ETF toos
-
visualizeCex
public void visualizeCex(int index) Visualize the found counter example. -
visualizeLearnedMealy
public void visualizeLearnedMealy()Visualize the learned Mealy machine -
getSimulinkCount
public int getSimulinkCount()- Returns:
- the number of the Simulink executions
-
getSimulinkCountForEqTest
public int getSimulinkCountForEqTest() -
getProperties
-
addSAEQOracleAll
public void addSAEQOracleAll(int length, Random random, int maxTest, int generationSize, int childrenSize, boolean resetWord, double alpha) -
addGAEQOracleAll
public void addGAEQOracleAll(int length, int maxTest, ArgParser.GASelectionKind selectionKind, int populationSize, double crossoverProb, double mutationProb) -
close
Close the MATLAB engine. This method must be called when the object is no longer used.- Throws:
Exception
-
getSimulationTimeSecond
public double getSimulationTimeSecond()
-