Search in sources :

Example 1 with And

use of org.btrplace.safeplace.spec.prop.And in project scheduler by btrplace.

the class MyCstrSpecVisitor method visitFormulaOp.

@Override
public Proposition visitFormulaOp(@NotNull CstrSpecParser.FormulaOpContext ctx) {
    Proposition p1 = (Proposition) visit(ctx.f1);
    Proposition p2 = (Proposition) visit(ctx.f2);
    switch(ctx.op.getType()) {
        case CstrSpecParser.AND:
            return new And(p1, p2);
        case CstrSpecParser.OR:
            return new Or(p1, p2);
        case CstrSpecParser.IMPLIES:
            return new Implies(p1, p2);
        case CstrSpecParser.IFF:
            return new Iff(p1, p2);
        default:
            throw SpecException.unsupportedOperation(filename, BoolType.getInstance(), ctx.op, BoolType.getInstance());
    }
}
Also used : Or(org.btrplace.safeplace.spec.prop.Or) Implies(org.btrplace.safeplace.spec.prop.Implies) And(org.btrplace.safeplace.spec.prop.And) Iff(org.btrplace.safeplace.spec.prop.Iff) Proposition(org.btrplace.safeplace.spec.prop.Proposition) ProtectedProposition(org.btrplace.safeplace.spec.prop.ProtectedProposition)

Aggregations

And (org.btrplace.safeplace.spec.prop.And)1 Iff (org.btrplace.safeplace.spec.prop.Iff)1 Implies (org.btrplace.safeplace.spec.prop.Implies)1 Or (org.btrplace.safeplace.spec.prop.Or)1 Proposition (org.btrplace.safeplace.spec.prop.Proposition)1 ProtectedProposition (org.btrplace.safeplace.spec.prop.ProtectedProposition)1