use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class CliTask method doModelCheck.
private ModelCheckingResult doModelCheck(ModelChecker modelChecker) {
ModelCheckingResult result;
long start = isBenchmark ? System.nanoTime() : 0;
result = modelChecker.check();
nanoDiffTime = isBenchmark ? System.nanoTime() - start : 0;
return result;
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class CliTask method execute.
public void execute() {
if (isBenchmark) {
executeBenchmarks();
} else {
MachineNode machineNode = parseMachine(readMachineContent());
ModelCheckingResult result = doModelCheck(getModelChecker(machineNode));
logger.info("Result: " + result.toString());
}
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class LiftsTest method testCrashing.
@Test
public void testCrashing() {
MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "CrashingLift.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
assertEquals(false, result.isCorrect());
assertEquals("{old_floor=3, old_time=3, current_time=4, current_floor=0}", result.getLastState().toString());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class LiftsTest method testNotMoving.
@Test
public void testNotMoving() {
MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "NotMoving.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
assertEquals(false, result.isCorrect());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class LiftsTest method testTargetAndCurrentCorrespond.
@Test
public void testTargetAndCurrentCorrespond() {
MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "TargetAndCurrentCorrespond.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
assertEquals(false, result.isCorrect());
Expr targetFloor = result.getLastState().getValues().get("target_floor");
Expr currentFloor = result.getLastState().getValues().get("current_floor");
assertNotEquals(targetFloor.toString(), currentFloor.toString());
}
Aggregations