Class LineageTrackerImpl

java.lang.Object
fr.inria.rules.integraal.forward_chaining.chase.lineage.LineageTrackerImpl
All Implemented Interfaces:
LineageTracker

public class LineageTrackerImpl extends Object implements LineageTracker
Default in-memory implementation of LineageTracker.
  • Constructor Details

    • LineageTrackerImpl

      public LineageTrackerImpl()
      Creates the in-memory lineage tracker.
  • Method Details

    • getRuleInstancesYielding

      public Map<Rule, Map<Substitution, Set<Atom>>> getRuleInstancesYielding(Atom a)
      Description copied from interface: LineageTracker
      Returns the tracked rule instances that derive the supplied atom.
      Specified by:
      getRuleInstancesYielding in interface LineageTracker
      Parameters:
      a - atom
      Returns:
      the rule instances yielding a
    • isPrime

      public boolean isPrime(Atom atom)
      Description copied from interface: LineageTracker
      Indicates whether the supplied atom is prime.
      Specified by:
      isPrime in interface LineageTracker
      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

      public boolean isNonPrime(Atom atom)
      Description copied from interface: LineageTracker
      Indicates whether the supplied atom is non-prime.
      Specified by:
      isNonPrime in interface LineageTracker
      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

      public Map<Atom, Map<Rule, Map<Substitution, Set<Atom>>>> getAncestorRuleInstancesYielding(Atom a)
      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

      public Collection<Atom> getAncestorsOf(Atom atom)
      Description copied from interface: LineageTracker
      Returns every ancestor atom involved in deriving the supplied atom.
      Specified by:
      getAncestorsOf in interface LineageTracker
      Parameters:
      atom - the derived atom
      Returns:
      the ancestors of atom
    • getPrimeAncestorsOf

      public Collection<Atom> getPrimeAncestorsOf(Atom atom)
      Description copied from interface: LineageTracker
      Returns the prime ancestors of the supplied atom.
      Specified by:
      getPrimeAncestorsOf in interface LineageTracker
      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: LineageTracker
      Tracks the fact that the application of rule with substitution from the bodyfacts produced headFactsPossiblyNew
      Specified by:
      track in interface LineageTracker
      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