Search in sources :

Example 26 with MachineNode

use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.

the class LiftsTest method testSlowDoors.

@Test
public void testSlowDoors() {
    MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "SlowDoors.mch");
    ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
    assertEquals(false, result.isCorrect());
}
Also used : MachineNode(de.bmoth.parser.ast.nodes.MachineNode) ModelCheckingResult(de.bmoth.modelchecker.ModelCheckingResult) Test(org.junit.Test)

Example 27 with MachineNode

use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.

the class LiftsTest method testLowerHigher.

@Test
public void testLowerHigher() {
    MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "LiftLowerHigher.mch");
    ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
    assertEquals(false, result.isCorrect());
    assertEquals("{doors_open=false, moving=true, current_floor=-1}", result.getLastState().toString());
}
Also used : MachineNode(de.bmoth.parser.ast.nodes.MachineNode) ModelCheckingResult(de.bmoth.modelchecker.ModelCheckingResult) Test(org.junit.Test)

Example 28 with MachineNode

use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.

the class ModelCheckerMachineFilesTest method testSimpleModelWithoutVariables.

@Test
public void testSimpleModelWithoutVariables() {
    MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "OnlyConstants.mch");
    ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
    assertEquals(true, result.isCorrect());
}
Also used : MachineNode(de.bmoth.parser.ast.nodes.MachineNode) ModelCheckingResult(de.bmoth.modelchecker.ModelCheckingResult) Test(org.junit.Test)

Example 29 with MachineNode

use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.

the class ModelCheckerMachineFilesTest method testSimpleModelsWithoutOperations.

@Test
public void testSimpleModelsWithoutOperations() {
    MachineNode simpleMachineWithViolation = parseMachineFromFile(dir + "OnlyInitViolation.mch");
    ModelCheckingResult result = ExplicitStateModelChecker.check(simpleMachineWithViolation);
    assertEquals(false, result.isCorrect());
    assertEquals(1, result.getSteps());
    MachineNode simpleMachineWithoutViolation = parseMachineFromFile(dir + "OnlyInitNoViolation.mch");
    result = ExplicitStateModelChecker.check(simpleMachineWithoutViolation);
    assertEquals(true, result.isCorrect());
    assertEquals(1, result.getSteps());
}
Also used : MachineNode(de.bmoth.parser.ast.nodes.MachineNode) ModelCheckingResult(de.bmoth.modelchecker.ModelCheckingResult) Test(org.junit.Test)

Example 30 with MachineNode

use of de.bmoth.parser.ast.nodes.MachineNode in project bmoth by hhu-stups.

the class Issue66Test method testMachine.

@Test
public void testMachine() throws IOException {
    MachineNode theMachine = parseMachineFromFile(dir + "LargeExponent.mch");
    ModelCheckingResult result = ExplicitStateModelChecker.check(theMachine);
    assertEquals(false, result.isCorrect());
}
Also used : MachineNode(de.bmoth.parser.ast.nodes.MachineNode) ModelCheckingResult(de.bmoth.modelchecker.ModelCheckingResult) Test(org.junit.Test)

Aggregations

MachineNode (de.bmoth.parser.ast.nodes.MachineNode)30 Test (org.junit.Test)25 ModelCheckingResult (de.bmoth.modelchecker.ModelCheckingResult)22 ParserException (de.bmoth.parser.ParserException)2 DeclarationNode (de.bmoth.parser.ast.nodes.DeclarationNode)2 Expr (com.microsoft.z3.Expr)1 BMoThParser (de.bmoth.antlr.BMoThParser)1 LtlStartContext (de.bmoth.antlr.BMoThParser.LtlStartContext)1 StartContext (de.bmoth.antlr.BMoThParser.StartContext)1 SemanticAstCreator (de.bmoth.parser.ast.SemanticAstCreator)1 TypeErrorException (de.bmoth.parser.ast.TypeErrorException)1 AnySubstitutionNode (de.bmoth.parser.ast.nodes.AnySubstitutionNode)1 OperationNode (de.bmoth.parser.ast.nodes.OperationNode)1 LTLFormula (de.bmoth.parser.ast.nodes.ltl.LTLFormula)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 StringJoiner (java.util.StringJoiner)1 Ignore (org.junit.Ignore)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1