Class MultiThreadsByPieceCoreProcessor<RW extends MaterializedData & Writable>

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

public class MultiThreadsByPieceCoreProcessor<RW extends MaterializedData & Writable> extends Object implements CoreProcessor<RW>
Compute the core of a fact base with a multithreading algorithm that computes the core by retracting pieces. In the exhaustive variant, for each piece, we search all the homomorphisms that retract the piece into the atom set, 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 sending 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 atom set and search new homomorphisms on the result.
Author:
Guillaume Pérution-Kihli
  • Constructor Details

    • MultiThreadsByPieceCoreProcessor

      public MultiThreadsByPieceCoreProcessor(FOQueryEvaluator<FOFormula, ? super RW> evaluator, long limitNbThreads, MultiThreadsByPieceCoreProcessor.Variant variant)
      Creates a processor with a custom evaluator, thread cap, and variant.
      Parameters:
      evaluator - Query evaluator
      limitNbThreads - Maximum number of threads
      variant - Variant of the algorithm
    • MultiThreadsByPieceCoreProcessor

      public MultiThreadsByPieceCoreProcessor(long limitNbThreads, MultiThreadsByPieceCoreProcessor.Variant variant)
      Creates a processor with the default evaluator, a thread cap, and a variant.
      Parameters:
      limitNbThreads - Maximum number of threads
      variant - Variant of the algorithm
    • MultiThreadsByPieceCoreProcessor

      public MultiThreadsByPieceCoreProcessor(long limitNbThreads, FOQueryEvaluator<FOFormula, ? super RW> evaluator)
      Creates a processor using the deletion variant and a custom evaluator.
      Parameters:
      limitNbThreads - Maximum number of threads
      evaluator - Query evaluator
    • MultiThreadsByPieceCoreProcessor

      public MultiThreadsByPieceCoreProcessor()
      Creates a processor using the deletion variant, the default evaluator, and a default thread cap.
  • 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