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 Details

    • getAncestorsOf

      Collection<Atom> getAncestorsOf(Atom atom)
      Returns every ancestor atom involved in deriving the supplied atom.
      Parameters:
      atom - the derived atom
      Returns:
      the ancestors of atom
    • getPrimeAncestorsOf

      Collection<Atom> getPrimeAncestorsOf(Atom atom)
      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 application
      headFactsPossiblyNew - the produced head facts
      rule - the applied rule
      substitution - the substitution used for the application
      Returns:
      true when the lineage information changed
    • getRuleInstancesYielding

      Map<Rule, Map<Substitution, Set<Atom>>> getRuleInstancesYielding(Atom a)
      Returns the tracked rule instances that derive the supplied atom.
      Parameters:
      a - atom
      Returns:
      the rule instances yielding a
    • isPrime

      boolean isPrime(Atom relevantAtom)
      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

      boolean isNonPrime(Atom relevantAtom)
      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