use of de.bmoth.parser.ast.nodes.ltl.LTLNode in project bmoth by hhu-stups.
the class LTLBuechiTest method testGraphConstructionUntilNext.
@Test
public void testGraphConstructionUntilNext() throws ParserException {
String formula = "{0=1} U (X {1=1})";
LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
assertEquals(4, buechiAutomaton.getFinalNodeSet().size());
logger.log(Level.INFO, buechiAutomaton::toString);
}
use of de.bmoth.parser.ast.nodes.ltl.LTLNode in project bmoth by hhu-stups.
the class LTLBuechiTest method testGraphConstructionUntil2.
@Test
public void testGraphConstructionUntil2() throws ParserException {
String formula = "{1=1} U ({2=2} U {3=3})";
LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
// should be 4?
// assertEquals(6, buechiAutomaton.getFinalNodeSet().size());
logger.log(Level.INFO, buechiAutomaton::toString);
}
use of de.bmoth.parser.ast.nodes.ltl.LTLNode in project bmoth by hhu-stups.
the class LTLBuechiTest method testGraphConstructionAnd.
@Test
public void testGraphConstructionAnd() throws ParserException {
String formula = "G (X ( {0=1} & {2=3} ) )";
LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
LTLNode node = LTLTransformations.transformLTLNode(ltlFormula.getLTLNode());
BuechiAutomaton buechiAutomaton = new BuechiAutomaton(node);
assertEquals(2, buechiAutomaton.getFinalNodeSet().size());
logger.log(Level.INFO, buechiAutomaton::toString);
}
use of de.bmoth.parser.ast.nodes.ltl.LTLNode in project bmoth by hhu-stups.
the class LTLBuechiTest method testGraphConstructionUntil.
@Test
public void testGraphConstructionUntil() throws ParserException {
String formula = "{0=1} U {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);
}
use of de.bmoth.parser.ast.nodes.ltl.LTLNode in project bmoth by hhu-stups.
the class LTLFormulaTest method testGloballyFinally.
@Test
public void testGloballyFinally() throws ParserException {
String formula = "FG { 1=1 }";
LTLFormula ltlFormula = Parser.getLTLFormulaAsSemanticAst(formula);
Node f1 = ltlFormula.getLTLNode();
assertTrue(f1 instanceof LTLPrefixOperatorNode);
LTLPrefixOperatorNode p1 = (LTLPrefixOperatorNode) f1;
assertEquals(LTLPrefixOperatorNode.Kind.FINALLY, p1.getKind());
LTLNode f2 = p1.getArgument();
assertTrue(f2 instanceof LTLPrefixOperatorNode);
LTLPrefixOperatorNode p2 = (LTLPrefixOperatorNode) f2;
assertEquals(LTLPrefixOperatorNode.Kind.GLOBALLY, p2.getKind());
LTLNode f3 = p2.getArgument();
assertTrue(f3 instanceof LTLBPredicateNode);
LTLBPredicateNode p3 = (LTLBPredicateNode) f3;
assertTrue(p3.getPredicate() != null);
}
Aggregations