Class LineageTrackerImpl
java.lang.Object
fr.inria.rules.integraal.forward_chaining.chase.lineage.LineageTrackerImpl
- All Implemented Interfaces:
LineageTracker
Default in-memory implementation of
LineageTracker.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the rule instances yielding the ancestors of the supplied atom.getAncestorsOf(Atom atom) Returns every ancestor atom involved in deriving the supplied atom.getPrimeAncestorsOf(Atom atom) Returns the prime ancestors of the supplied atom.Returns the tracked rule instances that derive the supplied atom.booleanisNonPrime(Atom atom) Indicates whether the supplied atom is non-prime.booleanIndicates whether the supplied atom is prime.booleanTracks the fact that the application of rule with substitution from the bodyfacts produced headFactsPossiblyNew
-
Constructor Details
-
LineageTrackerImpl
public LineageTrackerImpl()Creates the in-memory lineage tracker.
-
-
Method Details
-
getRuleInstancesYielding
Description copied from interface:LineageTrackerReturns the tracked rule instances that derive the supplied atom.- Specified by:
getRuleInstancesYieldingin interfaceLineageTracker- Parameters:
a- atom- Returns:
- the rule instances yielding a
-
isPrime
Description copied from interface:LineageTrackerIndicates whether the supplied atom is prime.- Specified by:
isPrimein interfaceLineageTracker- Parameters:
atom- the atom to inspect- Returns:
- true iff the atom has been used to instantiate a rule body before appearing in a rule head instantiation
-
isNonPrime
Description copied from interface:LineageTrackerIndicates whether the supplied atom is non-prime.- Specified by:
isNonPrimein interfaceLineageTracker- Parameters:
atom- the atom to inspect- Returns:
- true iff
(1) the atom appeared in a rule head instantiation and
(2) it has not being used to instantiate a rule body prior to its first appearance in a rule head instantiation
-
getAncestorRuleInstancesYielding
Returns the rule instances yielding the ancestors of the supplied atom.- Parameters:
a- the atom whose ancestor rule instances are requested- Returns:
- the lineage fragment restricted to the atom ancestors
-
getAncestorsOf
Description copied from interface:LineageTrackerReturns every ancestor atom involved in deriving the supplied atom.- Specified by:
getAncestorsOfin interfaceLineageTracker- Parameters:
atom- the derived atom- Returns:
- the ancestors of atom
-
getPrimeAncestorsOf
Description copied from interface:LineageTrackerReturns the prime ancestors of the supplied atom.- Specified by:
getPrimeAncestorsOfin interfaceLineageTracker- Parameters:
atom- the derived atom- Returns:
- the prime ancestors of atom, that is, only those who do not have ancestors
-
track
public boolean track(Set<Atom> bodyFacts, Set<Atom> headFactsPossiblyNew, FORule rule, Substitution substitution) Description copied from interface:LineageTrackerTracks the fact that the application of rule with substitution from the bodyfacts produced headFactsPossiblyNew- Specified by:
trackin interfaceLineageTracker- Parameters:
bodyFacts- the body facts used for the rule applicationheadFactsPossiblyNew- the produced head factsrule- the applied rulesubstitution- the substitution used for the application- Returns:
truewhen the lineage information changed
-