Class ByPieceCoreProcessor<RW extends MaterializedData & Writable>

java.lang.Object
fr.inria.rules.integraal.core.ByPieceCoreProcessor<RW>
Type Parameters:
RW - the writable materialized fact-base type processed by the core algorithm
All Implemented Interfaces:
CoreProcessor<RW>

public class ByPieceCoreProcessor<RW extends MaterializedData & Writable> extends Object implements CoreProcessor<RW>
Compute the core of a fact base with an algorithm that computes the core by computing the retractions of each piece into the fact base. In the "exhaustive" variant, for each piece, we search all the homomorphisms that retract the piece into the fact base, and we keep the homomorphism that minimizes the number of remaining variables in the piece. In the "by specialization" variant, we specialize the piece when we find a homomorphism h that reduces the number of the variables in the piece (the specialization is done by using h on the piece and then search new homomorphisms that retract more variables of the initial piece). In the "by deletion" variant, when we found such a homomorphism, we remove the retracted variables from the piece and the fact base and search new homomorphisms on the result.
Author:
Guillaume Pérution-Kihli
  • Constructor Details

    • ByPieceCoreProcessor

      public ByPieceCoreProcessor(ByPieceCoreProcessor.Variant variant, FOQueryEvaluator<FOFormula, ? super RW> evaluator)
      Creates a processor with an explicit variant and evaluator.
      Parameters:
      variant - the algorithm variant to use
      evaluator - the homomorphism evaluator to use
    • ByPieceCoreProcessor

      public ByPieceCoreProcessor(ByPieceCoreProcessor.Variant variant)
      Creates a processor with an explicit variant and the default evaluator.
      Parameters:
      variant - the algorithm variant to use
    • ByPieceCoreProcessor

      public ByPieceCoreProcessor(FOQueryEvaluator<FOFormula, ? super RW> evaluator)
      Creates a processor using the deletion variant and a custom evaluator.
      Parameters:
      evaluator - the homomorphism evaluator to use
    • ByPieceCoreProcessor

      public ByPieceCoreProcessor()
      Creates a processor using the deletion variant and the default evaluator.
  • Method Details

    • computeCore

      public void computeCore(RW fb, Set<Variable> frozenVariables)
      Description copied from interface: CoreProcessor
      Compute the core of a fact base by removing all the redundant atoms in it, in considering the frozen variables as constants, these variables must belong to the core.
      Specified by:
      computeCore in interface CoreProcessor<RW extends MaterializedData & Writable>
      Parameters:
      fb - the writable data on which we want to compute the core
      frozenVariables - Variables that will be treated as constants