Search in sources :

Example 6 with LTLInfixOperatorNode

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

the class ConvertFinallyPhiToTrueUntilPhi method transformNode.

@Override
public Node transformNode(Node oldNode) {
    LTLPrefixOperatorNode finallyOperator = (LTLPrefixOperatorNode) oldNode;
    LTLNode argument = finallyOperator.getArgument();
    LTLKeywordNode trueNode = new LTLKeywordNode(LTLKeywordNode.Kind.TRUE);
    return new LTLInfixOperatorNode(LTLInfixOperatorNode.Kind.UNTIL, trueNode, argument);
}
Also used : LTLPrefixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) LTLKeywordNode(de.bmoth.parser.ast.nodes.ltl.LTLKeywordNode) LTLInfixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLInfixOperatorNode)

Example 7 with LTLInfixOperatorNode

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

the class ConvertGloballyPhiToFalseReleasePhi method transformNode.

@Override
public Node transformNode(Node oldNode) {
    LTLPrefixOperatorNode globallyOperator = (LTLPrefixOperatorNode) oldNode;
    LTLNode argument = globallyOperator.getArgument();
    return new LTLInfixOperatorNode(LTLInfixOperatorNode.Kind.RELEASE, new LTLKeywordNode(LTLKeywordNode.Kind.FALSE), argument);
}
Also used : LTLPrefixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode) LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) LTLKeywordNode(de.bmoth.parser.ast.nodes.ltl.LTLKeywordNode) LTLInfixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLInfixOperatorNode)

Example 8 with LTLInfixOperatorNode

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

the class ConvertImplicationToOr method transformNode.

@Override
public Node transformNode(Node oldNode) {
    LTLInfixOperatorNode implicationOperator = (LTLInfixOperatorNode) oldNode;
    LTLNode innerLeft = implicationOperator.getLeft();
    LTLNode innerRight = implicationOperator.getRight();
    return new LTLInfixOperatorNode(OR, new LTLPrefixOperatorNode(NOT, innerLeft), 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)

Example 9 with LTLInfixOperatorNode

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

Example 10 with LTLInfixOperatorNode

use of de.bmoth.parser.ast.nodes.ltl.LTLInfixOperatorNode 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));
}
Also used : LTLNode(de.bmoth.parser.ast.nodes.ltl.LTLNode) LTLInfixOperatorNode(de.bmoth.parser.ast.nodes.ltl.LTLInfixOperatorNode)

Aggregations

LTLInfixOperatorNode (de.bmoth.parser.ast.nodes.ltl.LTLInfixOperatorNode)10 LTLPrefixOperatorNode (de.bmoth.parser.ast.nodes.ltl.LTLPrefixOperatorNode)9 LTLNode (de.bmoth.parser.ast.nodes.ltl.LTLNode)7 LTLKeywordNode (de.bmoth.parser.ast.nodes.ltl.LTLKeywordNode)4 LTLBPredicateNode (de.bmoth.parser.ast.nodes.ltl.LTLBPredicateNode)2 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 Parser (org.antlr.v4.runtime.Parser)1 RuleContext (org.antlr.v4.runtime.RuleContext)1 Token (org.antlr.v4.runtime.Token)1