Search in sources :

Example 11 with LTLPrefixOperatorNode

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

the class ConvertNotFinallyToGloballyNot method transformNode.

@Override
public Node transformNode(Node node) {
    LTLPrefixOperatorNode not = (LTLPrefixOperatorNode) node;
    LTLPrefixOperatorNode innerFinally = (LTLPrefixOperatorNode) not.getArgument();
    LTLNode inner = innerFinally.getArgument();
    return new LTLPrefixOperatorNode(GLOBALLY, new LTLPrefixOperatorNode(NOT, inner));
}
Also used : LTLPrefixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode)

Example 12 with LTLPrefixOperatorNode

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

the class ConvertNotFormulaToNegatedBFormula method transformNode.

@Override
public Node transformNode(Node node) {
    LTLPrefixOperatorNode notOperator = (LTLPrefixOperatorNode) node;
    LTLNode argument = notOperator.getArgument();
    LTLBPredicateNode bPredicateNode = (LTLBPredicateNode) argument;
    PredicateNode negatedPredicate = bPredicateNode.getPredicate().getNegatedPredicateNode();
    return new LTLBPredicateNode(negatedPredicate);
}
Also used : LTLPrefixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) LTLBPredicateNode(de.bmoth.parser.ast.nodes.ltl.LTLBPredicateNode) PredicateNode(de.bmoth.parser.ast.nodes.PredicateNode) LTLBPredicateNode(de.bmoth.parser.ast.nodes.ltl.LTLBPredicateNode)

Example 13 with LTLPrefixOperatorNode

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

the class ConvertNotNextToNextNot method transformNode.

@Override
public Node transformNode(Node node) {
    LTLPrefixOperatorNode notOperator = (LTLPrefixOperatorNode) node;
    LTLNode argument = notOperator.getArgument();
    LTLPrefixOperatorNode nextOperator = (LTLPrefixOperatorNode) argument;
    LTLPrefixOperatorNode newNot = new LTLPrefixOperatorNode(NOT, nextOperator.getArgument());
    return new LTLPrefixOperatorNode(NEXT, newNot);
}
Also used : LTLPrefixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode)

Example 14 with LTLPrefixOperatorNode

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

the class ConvertNotRelease method transformNode.

@Override
public Node transformNode(Node node) {
    LTLPrefixOperatorNode not = (LTLPrefixOperatorNode) node;
    LTLInfixOperatorNode release = (LTLInfixOperatorNode) not.getArgument();
    LTLNode innerLeft = release.getLeft();
    LTLNode innerRight = release.getRight();
    return new LTLInfixOperatorNode(UNTIL, new LTLPrefixOperatorNode(NOT, innerLeft), new LTLPrefixOperatorNode(NOT, innerRight));
}
Also used : LTLPrefixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) LTLInfixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLInfixOperatorNode)

Aggregations

LTLPrefixOperatorNode (de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode)14 LTLNode (de.bmoth.parser.ast.nodes.ltl.LTLNode)11 LTLInfixOperatorNode (de.bmoth.parser.ast.nodes.ltl.LTLInfixOperatorNode)9 LTLBPredicateNode (de.bmoth.parser.ast.nodes.ltl.LTLBPredicateNode)4 LTLKeywordNode (de.bmoth.parser.ast.nodes.ltl.LTLKeywordNode)4 Interval (org.antlr.v4.runtime.misc.Interval)2 ParseTree (org.antlr.v4.runtime.tree.ParseTree)2 TerminalNode (org.antlr.v4.runtime.tree.TerminalNode)2 Before (org.junit.Before)2 BMoThParser (de.bmoth.antlr.BMoThParser)1 Node (de.bmoth.parser.ast.nodes.Node)1 PredicateNode (de.bmoth.parser.ast.nodes.PredicateNode)1 LTLFormula (de.bmoth.parser.ast.nodes.ltl.LTLFormula)1 Parser (org.antlr.v4.runtime.Parser)1 RuleContext (org.antlr.v4.runtime.RuleContext)1 Token (org.antlr.v4.runtime.Token)1 Test (org.junit.Test)1