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.Sum
private final NumericSULMapper
private final NumericMembershipOracle
private final List
<NumericMembershipOracleCost> protected final NumericSUL
private final double
protected 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 TypeMethodDescriptionvoid
addBFOracle
(double multiplier) void
addCompleteExplorationEQOracle
(int minDepth, int maxDepth, int batchSize) void
addCornerCaseEQOracle
(int length, int minStep) Add a corner case equivalence oracle.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 oraclevoid
addGAEQOracleAll
(int length, int maxTest, ArgParser.GASelectionKind selectionKind, int populationSize, double crossoverProb, double mutationProb) 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.void
addHillClimbingEQOracle
(TemporalLogic.STLCost costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord) void
addHillClimbingEQOracleAll
(int length, Random random, int maxTests, int generationSize, int childrenSize, boolean resetWord) (package private) void
addMutateSelectEQOracle
(Function<IOSignal<List<Double>>, Double> costFunc, int length, Random random, int maxTests, int generationSize, int childrenSize, int changeSize, boolean resetWord) void
addRandomWalkEQOracle
(double restartProbability, long maxSteps, Random random) void
addRandomWordEQOracle
(int minLength, int maxLength, int maxTests, Random random, int batchSize) 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.void
addSAEQOracleAll
(int length, Random random, int maxTest, int generationSize, int childrenSize, boolean resetWord, double alpha) (package private) void
addSimulinkEqOracle
(Function<IOSignal<List<Double>>, Double> costFunc, Function<NumericMembershipOracleCost, ? extends EvaluationCountable.MealyEquivalenceOracle<String, String>> constructor) void
addWpMethodEQOracle
(int maxDepth) void
close()
Close the MATLAB engine.Returns the falsified STL formulas in the string representation.double
int
int
boolean
run()
run.void
setTimeout
(long timeout) Set timeout to the equivalence oracle added next time.void
visualizeCex
(int index) Visualize the found counter example.void
Visualize the learned Mealy machinevoid
writeDOTCex
(int index, Appendable a) Wirte the DOT of the found counter example.void
Wirte the DOT of the learned Mealy machinevoid
Write 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
true
if 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()
-