Search in sources :

Example 26 with LTLNode

use of de.bmoth.parser.ast.nodes.ltl.LTLNode 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 27 with LTLNode

use of de.bmoth.parser.ast.nodes.ltl.LTLNode 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)

Example 28 with LTLNode

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

the class LTLBuechiTest method testGraphConstructionRelease.

@Test
public void testGraphConstructionRelease() throws ParserException {
    String formula = "{0=1} R {1=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)

Example 29 with LTLNode

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

the class LTLBuechiTest method testGraphConstructionGp1Up2.

@Test
public void testGraphConstructionGp1Up2() throws ParserException {
    String formula = "(G {3=4}) U ({2=3})";
    LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
    LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
    BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
    assertEquals(5, 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 30 with LTLNode

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

the class LTLBuechiTest method testGraphConstructionGFp1ImpliesGFp2.

@Test
@Ignore
public void testGraphConstructionGFp1ImpliesGFp2() throws ParserException {
    String formula = "(GF {3=4}) => (GF {2=3})";
    LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
    LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
    BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
    // should be 9?
    assertEquals(6, 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) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

LTLNode (de.bmoth.parser.ast.nodes.ltl.LTLNode)31 LTLFormula (de.bmoth.parser.ast.nodes.ltl.LTLFormula)20 Test (org.junit.Test)20 BuechiAutomaton (de.bmoth.parser.ast.nodes.ltl.BuechiAutomaton)19 LTLPrefixOperatorNode (de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode)11 LTLInfixOperatorNode (de.bmoth.parser.ast.nodes.ltl.LTLInfixOperatorNode)7 LTLBPredicateNode (de.bmoth.parser.ast.nodes.ltl.LTLBPredicateNode)2 LTLKeywordNode (de.bmoth.parser.ast.nodes.ltl.LTLKeywordNode)2 Node (de.bmoth.parser.ast.nodes.Node)1 PredicateNode (de.bmoth.parser.ast.nodes.PredicateNode)1 Ignore (org.junit.Ignore)1