use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class Issue39Test method testMachine2.
@Test
public void testMachine2() throws IOException {
MachineNode theMachine = parseMachineFromFile(dir + "SetVarToConstantNoViolation.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(theMachine);
assertEquals(true, result.isCorrect());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class Issue39Test method testMachine1.
@Test
public void testMachine1() throws IOException {
MachineNode theMachine = parseMachineFromFile(dir + "SetVarToConstantViolation.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(theMachine);
assertEquals(false, result.isCorrect());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class Issue59Test method testArithmeticLawsMachine.
@Test
public void testArithmeticLawsMachine() {
MachineNode simpleMachineWithoutViolation = parseMachineFromFile("src/test/resources/machines/OnlyInitNoViolation.mch");
ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithoutViolation);
assertEquals(true, result.isCorrect());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class Issue59Test method testIssue59.
@Test
public void testIssue59() {
String machine = "MACHINE SimpleMachine\n";
machine += "VARIABLES x\n";
machine += "INVARIANT x : INTEGER &\n";
machine += "\tx**2 = x*x \n";
machine += "INITIALISATION x := -3\n";
machine += "OPERATIONS\n";
machine += "\tIncX = SELECT x < 50 THEN x := x+1 END\n";
machine += "END";
ModelCheckingResult result = new ExplicitStateModelChecker(parseMachine(machine)).check();
assertEquals(true, result.isCorrect());
}
use of de.bmoth.modelchecker.ModelCheckingResult in project bmoth by hhu-stups.
the class Issue89Test method testPinDownPowProblem.
@Test
public void testPinDownPowProblem() {
String machine = "MACHINE PinDownPowProblem\n";
machine += "VARIABLES\n";
machine += "\tx, y\n";
machine += "INVARIANT\n";
machine += "\tx : INTEGER\n";
machine += "\t& y : INTEGER\n";
machine += "\t& x < 100\n";
machine += "INITIALISATION\n";
machine += "\tx := 10**5\n";
machine += "\t|| y := 2**32-1\n";
machine += "OPERATIONS\n";
machine += "inc = BEGIN x := 2 * x END\n" + "END";
ModelCheckingResult result = ExplicitStateModelChecker.check(parseMachine(machine));
assertFalse(result.isCorrect());
assertEquals(1, result.getSteps());
assertEquals("{x=100000, y=4294967295}", result.getLastState().toString());
}
Aggregations