Search in sources :

Example 1 with RuleState

use of ai.grakn.graql.internal.reasoner.state.RuleState in project grakn by graknlabs.

the class InferenceRule method subGoal.

/**
 * @param parentAtom atom to which this rule is applied
 * @param ruleUnifier unifier with parent state
 * @param parent parent state
 * @param visitedSubGoals set of visited sub goals
 * @param cache query cache
 * @return resolution subGoal formed from this rule
 */
public ResolutionState subGoal(Atom parentAtom, Unifier ruleUnifier, QueryStateBase parent, Set<ReasonerAtomicQuery> visitedSubGoals, QueryCache<ReasonerAtomicQuery> cache) {
    Unifier ruleUnifierInverse = ruleUnifier.inverse();
    // delta' = theta . thetaP . delta
    Answer partialSubPrime = parentAtom.getParentQuery().getSubstitution().unify(ruleUnifierInverse);
    return new RuleState(this.propagateConstraints(parentAtom, ruleUnifierInverse), partialSubPrime, ruleUnifier, parent, visitedSubGoals, cache);
}
Also used : Answer(ai.grakn.graql.admin.Answer) RuleState(ai.grakn.graql.internal.reasoner.state.RuleState) MultiUnifier(ai.grakn.graql.admin.MultiUnifier) Unifier(ai.grakn.graql.admin.Unifier)

Aggregations

Answer (ai.grakn.graql.admin.Answer)1 MultiUnifier (ai.grakn.graql.admin.MultiUnifier)1 Unifier (ai.grakn.graql.admin.Unifier)1 RuleState (ai.grakn.graql.internal.reasoner.state.RuleState)1