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