Search in sources :

Example 11 with BuechiAutomaton

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

the class LTLBuechiTest method testGraphConstructionFp1UGp2.

@Test
public void testGraphConstructionFp1UGp2() throws ParserException {
    String formula = "(F {3=4}) U (G {2=3})";
    LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
    LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
    BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
    assertEquals(8, buechiAutomaton.getFinalNodeSet().size());
    logger.log(Level.INFO, buechiAutomaton::toString);
}
Also used : LTLFormula(de.bmoth.parser.ast.nodes.ltl.LTLFormula) BuechiAutomaton(de.bmoth.parser.ast.nodes.ltl.BuechiAutomaton) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) Test(org.junit.Test)

Example 12 with BuechiAutomaton

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

the class LTLBuechiTest method testGraphConstructionRelease2.

@Test
public void testGraphConstructionRelease2() throws ParserException {
    String formula = "{1=1} R ({2=2} R {3=3})";
    LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
    LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
    BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
    assertEquals(7, buechiAutomaton.getFinalNodeSet().size());
    logger.log(Level.INFO, buechiAutomaton::toString);
}
Also used : LTLFormula(de.bmoth.parser.ast.nodes.ltl.LTLFormula) BuechiAutomaton(de.bmoth.parser.ast.nodes.ltl.BuechiAutomaton) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) Test(org.junit.Test)

Example 13 with BuechiAutomaton

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

the class LTLBuechiTest method testGraphConstructionAnd2.

@Test
public void testGraphConstructionAnd2() throws ParserException {
    String formula = "G ( {0=1} & {2=3} )";
    LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
    LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
    BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
    assertEquals(1, buechiAutomaton.getFinalNodeSet().size());
    logger.log(Level.INFO, buechiAutomaton::toString);
}
Also used : LTLFormula(de.bmoth.parser.ast.nodes.ltl.LTLFormula) BuechiAutomaton(de.bmoth.parser.ast.nodes.ltl.BuechiAutomaton) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) Test(org.junit.Test)

Example 14 with BuechiAutomaton

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

the class LTLBuechiTest method testGraphConstructionGloballyFinally.

@Test
public void testGraphConstructionGloballyFinally() throws ParserException {
    String formula = "G (F (X {0=1}))";
    LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
    LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
    assertEquals("RELEASE(FALSE,UNTIL(TRUE,NEXT(EQUAL(0,1))))", node.toString());
    BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
    assertEquals(4, buechiAutomaton.getFinalNodeSet().size());
    logger.log(Level.INFO, buechiAutomaton::toString);
}
Also used : LTLFormula(de.bmoth.parser.ast.nodes.ltl.LTLFormula) BuechiAutomaton(de.bmoth.parser.ast.nodes.ltl.BuechiAutomaton) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) Test(org.junit.Test)

Example 15 with BuechiAutomaton

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

the class LTLBuechiTest method testGraphConstructionFinally.

@Test
public void testGraphConstructionFinally() throws ParserException {
    String formula = "F ({0=1})";
    LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
    LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
    BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
    assertEquals(3, buechiAutomaton.getFinalNodeSet().size());
    logger.log(Level.INFO, buechiAutomaton::toString);
}
Also used : LTLFormula(de.bmoth.parser.ast.nodes.ltl.LTLFormula) BuechiAutomaton(de.bmoth.parser.ast.nodes.ltl.BuechiAutomaton) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) Test(org.junit.Test)

Aggregations

BuechiAutomaton (de.bmoth.parser.ast.nodes.ltl.BuechiAutomaton)19 LTLFormula (de.bmoth.parser.ast.nodes.ltl.LTLFormula)19 LTLNode (de.bmoth.parser.ast.nodes.ltl.LTLNode)19 Test (org.junit.Test)19 Ignore (org.junit.Ignore)1