Search in sources :

Example 1 with PLtl

use of de.be4.ltl.core.parser.node.PLtl in project probparsers by bendisposto.

the class PrologGeneratorHelper method det.

public void det(ADetLtl node, PrologGenerator gen) {
    LinkedList<PActions> list = node.getArgs();
    pto.openTerm("ap");
    pto.openTerm("det");
    pto.openList();
    for (PActions pLtl : list) {
        pLtl.apply(gen);
    }
    pto.closeList();
    pto.closeTerm();
    pto.closeTerm();
}
Also used : PActions(de.be4.ltl.core.parser.node.PActions)

Example 2 with PLtl

use of de.be4.ltl.core.parser.node.PLtl in project probparsers by bendisposto.

the class LTLFormulaVisitor method handleQuantification.

private void handleQuantification(de.be4.ltl.core.parser.node.Node node, String parameterName, String bPredicateString, PLtl ltl) {
    // create an identifier (b ast node) for the parameter of the
    // quantification
    List<TIdentifierLiteral> list = new ArrayList<TIdentifierLiteral>();
    list.add(new TIdentifierLiteral(parameterName));
    AIdentifierExpression parameterNode = new AIdentifierExpression(list);
    // add the created identifier to the current context
    Hashtable<String, AIdentifierExpression> currentContext = new Hashtable<String, AIdentifierExpression>();
    currentContext.put(parameterName, parameterNode);
    this.contextTable.add(currentContext);
    // collection the all parameters in
    ltlIdentifierTable.put(parameterName, parameterNode);
    // parse the b predicate and create a reference to the b ast node
    de.be4.classicalb.core.parser.node.Start start = parseBPredicate(bPredicateString);
    ltlNodeToBNodeTable.put(node, start);
    // collect all identifiers which can be used in the bPredicate and
    // verify the bPredicate
    LTLBPredicate ltlBPredicate = new LTLBPredicate(getUnifiedContext(), start);
    this.bPredicates.add(ltlBPredicate);
    machineContext.checkLTLBPredicate(ltlBPredicate);
    // remaining LTL formula
    ltl.apply(this);
    // remove currentContext from contextTable
    contextTable.remove(contextTable.size() - 1);
}
Also used : AIdentifierExpression(de.be4.classicalb.core.parser.node.AIdentifierExpression) Hashtable(java.util.Hashtable) ArrayList(java.util.ArrayList) TIdentifierLiteral(de.be4.classicalb.core.parser.node.TIdentifierLiteral)

Example 3 with PLtl

use of de.be4.ltl.core.parser.node.PLtl in project probparsers by bendisposto.

the class PrologGenerator method caseAAndFair2Ltl.

@Override
public void caseAAndFair2Ltl(final AAndFair2Ltl node) {
    final PLtl left_node = node.getLeft();
    final PLtl right_node = node.getRight();
    helper.and_fair2(left_node, right_node, this);
}
Also used : PLtl(de.be4.ltl.core.parser.node.PLtl)

Example 4 with PLtl

use of de.be4.ltl.core.parser.node.PLtl in project probparsers by bendisposto.

the class PrologGenerator method caseAAndFair1Ltl.

@Override
public void caseAAndFair1Ltl(final AAndFair1Ltl node) {
    final PLtl left_node = node.getLeft();
    final PLtl right_node = node.getRight();
    helper.and_fair1(left_node, right_node, this);
}
Also used : PLtl(de.be4.ltl.core.parser.node.PLtl)

Example 5 with PLtl

use of de.be4.ltl.core.parser.node.PLtl in project probparsers by bendisposto.

the class PrologGeneratorHelper method dlk.

public void dlk(ADlkLtl node, PrologGenerator gen) {
    LinkedList<PActions> list = node.getArgs();
    pto.openTerm("ap");
    pto.openTerm("dlk");
    pto.openList();
    for (PActions pLtl : list) {
        pLtl.apply(gen);
    }
    pto.closeList();
    pto.closeTerm();
    pto.closeTerm();
}
Also used : PActions(de.be4.ltl.core.parser.node.PActions)

Aggregations

PActions (de.be4.ltl.core.parser.node.PActions)3 PLtl (de.be4.ltl.core.parser.node.PLtl)2 AIdentifierExpression (de.be4.classicalb.core.parser.node.AIdentifierExpression)1 TIdentifierLiteral (de.be4.classicalb.core.parser.node.TIdentifierLiteral)1 ArrayList (java.util.ArrayList)1 Hashtable (java.util.Hashtable)1