use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class LiftsTest method testInvalidPositions.
@Test
public void testInvalidPositions() {
MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "LiftStopsAtInvalidPositions.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
assertEquals(false, result.isCorrect());
assertEquals("{MAX_FLOOR=5, MIN_FLOOR=0, doors_open=false, moving=false, current_floor=1, betweenFloors=true}", result.getLastState().toString());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class ModelCheckerPerformanceTest method testLeuschelPerformanceMachines3.
@Test
public // @Benchmark
void testLeuschelPerformanceMachines3() throws IOException {
MachineNode machine = parseMachineFromFile(dir + "/performance/CounterErr2.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(machine);
assertEquals(false, result.isCorrect());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class AppView method checkwithChecker.
public void checkwithChecker(ModelChecker modelChecker) {
task = new Task<ModelCheckingResult>() {
@Override
protected ModelCheckingResult call() throws Exception {
return AppView.this.modelChecker.check();
}
};
task.setOnSucceeded(event -> {
ModelCheckingResult result = task.getValue();
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("Model Checking Result");
switch(result.getType()) {
case VERIFIED:
alert.setHeaderText("The model is...");
alert.setContentText("...VERIFIED via K-Induction Model Checking!\nNo counter-example found.");
break;
case EXCEEDED_MAX_STEPS:
alert.setHeaderText("The model is...");
alert.setContentText("...correct for " + result.getSteps() + " steps!\n(Warning: Exceeded max steps)");
break;
case COUNTER_EXAMPLE_FOUND:
alert.setHeaderText("The model is...");
alert.setContentText("...not correct!\nCounter-example found in state " + result.getLastState().toString() + ".\nReversed path: " + result.getCounterExamplePath());
break;
case LTL_COUNTER_EXAMPLE_FOUND:
alert.setHeaderText("The LTL-model is...");
alert.setContentText("...not correct!\nCounter-example found in state " + result.getLastState().toString() + ".\nReversed path: " + result.getCounterExamplePath());
break;
case UNKNOWN:
alert.setHeaderText("Model checking result unknown...");
alert.setContentText("... reason: " + result.getReason());
break;
case ABORTED:
alert.setHeaderText("Model checking aborted...");
alert.setContentText("... after " + result.getSteps() + " steps");
break;
}
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.showAndWait();
});
task.setOnCancelled(event -> {
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("Model Checking Result");
alert.setHeaderText("Modelchecking was canceled!");
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.showAndWait();
});
modelCheckingThread = new Thread(task);
modelCheckingThread.start();
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class ModelCheckerPerformanceTest method testLeuschelPerformanceMachines2.
@Test
public // @Benchmark
void testLeuschelPerformanceMachines2() throws IOException {
MachineNode machine = parseMachineFromFile(dir + "/performance/SimpleSetIncrease.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(machine);
assertEquals(false, result.isCorrect());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class ModelCheckerPerformanceTest method testLeuschelPerformanceMachines1.
@Test
@Benchmark
public void testLeuschelPerformanceMachines1() throws IOException {
MachineNode machine = parseMachineFromFile(dir + "/performance/CounterErr.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(machine);
assertEquals(false, result.isCorrect());
}
Aggregations