Search in sources :

Example 1 with Negated

use of com.vaticle.typedb.core.logic.resolvable.Negated in project grakn by graknlabs.

the class ConjunctionResolver method initialiseDownstreamResolvers.

@Override
protected void initialiseDownstreamResolvers() {
    LOG.debug("{}: initialising downstream resolvers", name());
    Set<Concludable> concludables = concludablesTriggeringRules();
    Set<Retrievable> retrievables = Retrievable.extractFrom(conjunction(), concludables);
    resolvables.addAll(concludables);
    resolvables.addAll(retrievables);
    iterate(resolvables).forEachRemaining(resolvable -> {
        try {
            downstreamResolvers.put(resolvable, registry.registerResolvable(resolvable));
        } catch (TypeDBException e) {
            terminate(e);
        }
    });
    for (Negation negation : conjunction().negations()) {
        Negated negated = new Negated(negation);
        try {
            downstreamResolvers.put(negated, registry.negated(negated, conjunction()));
            negateds.add(negated);
        } catch (TypeDBException e) {
            terminate(e);
        }
    }
    if (!isTerminated())
        isInitialised = true;
}
Also used : Concludable(com.vaticle.typedb.core.logic.resolvable.Concludable) Retrievable(com.vaticle.typedb.core.logic.resolvable.Retrievable) Negation(com.vaticle.typedb.core.pattern.Negation) Negated(com.vaticle.typedb.core.logic.resolvable.Negated) TypeDBException(com.vaticle.typedb.core.common.exception.TypeDBException)

Aggregations

TypeDBException (com.vaticle.typedb.core.common.exception.TypeDBException)1 Concludable (com.vaticle.typedb.core.logic.resolvable.Concludable)1 Negated (com.vaticle.typedb.core.logic.resolvable.Negated)1 Retrievable (com.vaticle.typedb.core.logic.resolvable.Retrievable)1 Negation (com.vaticle.typedb.core.pattern.Negation)1