Search in sources :

Example 21 with LTLFormula

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

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

Example 23 with LTLFormula

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

the class LTLBuechiTest method testGraphConstructionNotGloballyNextUntil.

@Test
public void testGraphConstructionNotGloballyNextUntil() throws ParserException {
    String formula = "not G ( X ({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)

Aggregations

LTLFormula (de.bmoth.parser.ast.nodes.ltl.LTLFormula)23 Test (org.junit.Test)21 LTLNode (de.bmoth.parser.ast.nodes.ltl.LTLNode)20 BuechiAutomaton (de.bmoth.parser.ast.nodes.ltl.BuechiAutomaton)19 BMoThParser (de.bmoth.antlr.BMoThParser)1 LtlStartContext (de.bmoth.antlr.BMoThParser.LtlStartContext)1 SemanticAstCreator (de.bmoth.parser.ast.SemanticAstCreator)1 TypeErrorException (de.bmoth.parser.ast.TypeErrorException)1 MachineNode (de.bmoth.parser.ast.nodes.MachineNode)1 Node (de.bmoth.parser.ast.nodes.Node)1 LTLBPredicateNode (de.bmoth.parser.ast.nodes.ltl.LTLBPredicateNode)1 LTLPrefixOperatorNode (de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode)1 Ignore (org.junit.Ignore)1