Search in sources :

Example 1 with ConstraintCall

use of org.btrplace.safeplace.spec.term.ConstraintCall in project scheduler by btrplace.

the class MyCstrSpecVisitor method visitCstrCall.

@Override
public ConstraintCall visitCstrCall(@NotNull CstrSpecParser.CstrCallContext ctx) {
    List<Term> ps = ctx.call().term().stream().map(t -> (Term<?>) visit(t)).collect(Collectors.toList());
    Function f = resolveFunction(ctx.call().ID().getSymbol(), ps);
    return new ConstraintCall(f, ps);
}
Also used : IntType(org.btrplace.safeplace.spec.type.IntType) Type(org.btrplace.safeplace.spec.type.Type) ConstraintCall(org.btrplace.safeplace.spec.term.ConstraintCall) Eq(org.btrplace.safeplace.spec.prop.Eq) NoPackings(org.btrplace.safeplace.spec.prop.NoPackings) Constant(org.btrplace.safeplace.spec.term.Constant) ExplodedSet(org.btrplace.safeplace.spec.term.ExplodedSet) Token(org.antlr.v4.runtime.Token) NotNull(org.antlr.v4.runtime.misc.NotNull) Iff(org.btrplace.safeplace.spec.prop.Iff) SetPlus(org.btrplace.safeplace.spec.term.SetPlus) ListType(org.btrplace.safeplace.spec.type.ListType) ValueAt(org.btrplace.safeplace.spec.term.func.ValueAt) Var(org.btrplace.safeplace.spec.term.Var) NodeStateType(org.btrplace.safeplace.spec.type.NodeStateType) In(org.btrplace.safeplace.spec.prop.In) Lt(org.btrplace.safeplace.spec.prop.Lt) IntMinus(org.btrplace.safeplace.spec.term.IntMinus) Term(org.btrplace.safeplace.spec.term.Term) Leq(org.btrplace.safeplace.spec.prop.Leq) BoolType(org.btrplace.safeplace.spec.type.BoolType) Collectors(java.util.stream.Collectors) SetBuilder(org.btrplace.safeplace.spec.term.SetBuilder) TerminalNode(org.antlr.v4.runtime.tree.TerminalNode) StringType(org.btrplace.safeplace.spec.type.StringType) List(java.util.List) Proposition(org.btrplace.safeplace.spec.prop.Proposition) ForAll(org.btrplace.safeplace.spec.prop.ForAll) Exists(org.btrplace.safeplace.spec.prop.Exists) SetMinus(org.btrplace.safeplace.spec.term.SetMinus) Implies(org.btrplace.safeplace.spec.prop.Implies) CstrSpecParser(org.btrplace.safeplace.spec.antlr.CstrSpecParser) NIn(org.btrplace.safeplace.spec.prop.NIn) IntPlus(org.btrplace.safeplace.spec.term.IntPlus) ArrayList(java.util.ArrayList) ListBuilder(org.btrplace.safeplace.spec.term.ListBuilder) NEq(org.btrplace.safeplace.spec.prop.NEq) ParseTree(org.antlr.v4.runtime.tree.ParseTree) Or(org.btrplace.safeplace.spec.prop.Or) UserVar(org.btrplace.safeplace.spec.term.UserVar) FunctionCall(org.btrplace.safeplace.spec.term.func.FunctionCall) Function(org.btrplace.safeplace.spec.term.func.Function) And(org.btrplace.safeplace.spec.prop.And) SetType(org.btrplace.safeplace.spec.type.SetType) ProtectedProposition(org.btrplace.safeplace.spec.prop.ProtectedProposition) Packings(org.btrplace.safeplace.spec.prop.Packings) Mult(org.btrplace.safeplace.spec.term.Mult) NInc(org.btrplace.safeplace.spec.prop.NInc) ProtectedTerm(org.btrplace.safeplace.spec.term.ProtectedTerm) VMStateType(org.btrplace.safeplace.spec.type.VMStateType) Inc(org.btrplace.safeplace.spec.prop.Inc) Atomic(org.btrplace.safeplace.spec.type.Atomic) CstrSpecBaseVisitor(org.btrplace.safeplace.spec.antlr.CstrSpecBaseVisitor) Function(org.btrplace.safeplace.spec.term.func.Function) Term(org.btrplace.safeplace.spec.term.Term) ProtectedTerm(org.btrplace.safeplace.spec.term.ProtectedTerm) ConstraintCall(org.btrplace.safeplace.spec.term.ConstraintCall)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Token (org.antlr.v4.runtime.Token)1 NotNull (org.antlr.v4.runtime.misc.NotNull)1 ParseTree (org.antlr.v4.runtime.tree.ParseTree)1 TerminalNode (org.antlr.v4.runtime.tree.TerminalNode)1 CstrSpecBaseVisitor (org.btrplace.safeplace.spec.antlr.CstrSpecBaseVisitor)1 CstrSpecParser (org.btrplace.safeplace.spec.antlr.CstrSpecParser)1 And (org.btrplace.safeplace.spec.prop.And)1 Eq (org.btrplace.safeplace.spec.prop.Eq)1 Exists (org.btrplace.safeplace.spec.prop.Exists)1 ForAll (org.btrplace.safeplace.spec.prop.ForAll)1 Iff (org.btrplace.safeplace.spec.prop.Iff)1 Implies (org.btrplace.safeplace.spec.prop.Implies)1 In (org.btrplace.safeplace.spec.prop.In)1 Inc (org.btrplace.safeplace.spec.prop.Inc)1 Leq (org.btrplace.safeplace.spec.prop.Leq)1 Lt (org.btrplace.safeplace.spec.prop.Lt)1 NEq (org.btrplace.safeplace.spec.prop.NEq)1