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);
}
Aggregations