use of de.bmoth.parser.ast.nodes.ltl.LTLNode in project bmoth by hhu-stups.
the class ConvertWeakToRelease method transformNode.
@Override
public Node transformNode(Node oldNode) {
LTLInfixOperatorNode weakOperator = (LTLInfixOperatorNode) oldNode;
LTLNode innerLeft = weakOperator.getLeft();
LTLNode innerRight = weakOperator.getRight();
return new LTLInfixOperatorNode(LTLInfixOperatorNode.Kind.RELEASE, innerRight, new LTLInfixOperatorNode(LTLInfixOperatorNode.Kind.OR, innerLeft, innerRight));
}
use of de.bmoth.parser.ast.nodes.ltl.LTLNode in project bmoth by hhu-stups.
the class LTLBuechiTest method testGraphConstructionGloballyFalsity.
@Test
public void testGraphConstructionGloballyFalsity() throws ParserException {
String formula = "G ({0=1})";
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);
}
use of de.bmoth.parser.ast.nodes.ltl.LTLNode 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);
}
use of de.bmoth.parser.ast.nodes.ltl.LTLNode 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);
}
use of de.bmoth.parser.ast.nodes.ltl.LTLNode 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);
}
Aggregations