Interface LineageTracker
- All Known Implementing Classes:
LineageTrackerImpl, NoLineageTracker
public interface LineageTracker
Tracks derivation relationships between generated atoms and the rule applications that produced them.
-
Method Summary
Modifier and TypeMethodDescriptiongetAncestorsOf(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 relevantAtom) 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
-
Method Details
-
getAncestorsOf
Returns every ancestor atom involved in deriving the supplied atom.- Parameters:
atom- the derived atom- Returns:
- the ancestors of atom
-
getPrimeAncestorsOf
Returns the prime ancestors of the supplied atom.- Parameters:
atom- the derived atom- Returns:
- the prime ancestors of atom, that is, only those who do not have ancestors
-
track
boolean track(Set<Atom> bodyFacts, Set<Atom> headFactsPossiblyNew, FORule rule, Substitution substitution) Tracks the fact that the application of rule with substitution from the bodyfacts produced headFactsPossiblyNew- 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
-
getRuleInstancesYielding
-
isPrime
Indicates whether the supplied atom is prime.- Parameters:
relevantAtom- 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
Indicates whether the supplied atom is non-prime.- Parameters:
relevantAtom- 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
-