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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumVariant of the multithreaded by-piece core algorithm. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a processor using the deletion variant, the default evaluator, and a default thread cap.MultiThreadsByPieceCoreProcessor(long limitNbThreads, MultiThreadsByPieceCoreProcessor.Variant variant) Creates a processor with the default evaluator, a thread cap, and a variant.MultiThreadsByPieceCoreProcessor(long limitNbThreads, FOQueryEvaluator<FOFormula, ? super RW> evaluator) Creates a processor using the deletion variant and a custom evaluator.MultiThreadsByPieceCoreProcessor(FOQueryEvaluator<FOFormula, ? super RW> evaluator, long limitNbThreads, MultiThreadsByPieceCoreProcessor.Variant variant) Creates a processor with a custom evaluator, thread cap, and variant. -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputeCore(RW fb, Set<Variable> frozenVariables) 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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CoreProcessor
computeCore
-
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 evaluatorlimitNbThreads- Maximum number of threadsvariant- 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 threadsvariant- 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 threadsevaluator- Query evaluator
-
MultiThreadsByPieceCoreProcessor
public MultiThreadsByPieceCoreProcessor()Creates a processor using the deletion variant, the default evaluator, and a default thread cap.
-
-
Method Details
-
computeCore
Description copied from interface:CoreProcessorCompute 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:
computeCorein interfaceCoreProcessor<RW extends MaterializedData & Writable>- Parameters:
fb- the writable data on which we want to compute the corefrozenVariables- Variables that will be treated as constants
-