This module provides several implementations of the forward chaining mechanism, aka chase:
Several chase variants exist in the litterature that differ on the conditions of applicability of a rule (roughly, more or less redundancies can be avoided). Graal implements the restricted chase (aka standard chase) and the frontier-restricted chase (aka semi-oblivious, and equivalent to skolem chase). Both are available for all previous forward chaining algorithms. The chase behavior can be selected by specifying a RuleApplier to the Chase constructor. A RuleApplier defines the conditions of rule application.
The main implementation called DefaultRuleApplier generates a query from the rule's body, then evaluates it with the SmartHomomorphism . Finally for each found substitution of the query, it calls a ChaseHaltingCondition to generate new data with respect to the kind of chase. The FrontierRestrictedChaseHaltingCondition applies a rule according to a homomorphism from its body to the data if it has not already been applied with another homomorphism that maps the rule's frontier in the same way. The RestrictedChaseHaltingCondition applies a rule to a fact base F according to a homomorphism h if h cannot be extended to a homomorphism from B ∪ H to F where B is the rule body and H its head.
The RestrictedChaseRuleApplier is an optimized implementation of the restricted chase. It generates a ConjunctiveQueryWithNegatedParts of the form B ∧ ¬H where B is the rule body and H the rule head (which must not be found, hence the negation).