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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumVariant of the by-piece core algorithm. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a processor using the deletion variant and the default evaluator.Creates a processor with an explicit variant and the default evaluator.ByPieceCoreProcessor(ByPieceCoreProcessor.Variant variant, FOQueryEvaluator<FOFormula, ? super RW> evaluator) Creates a processor with an explicit variant and evaluator.ByPieceCoreProcessor(FOQueryEvaluator<FOFormula, ? super RW> evaluator) Creates a processor using the deletion variant and a custom evaluator. -
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
-
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 useevaluator- the homomorphism evaluator to use
-
ByPieceCoreProcessor
Creates a processor with an explicit variant and the default evaluator.- Parameters:
variant- the algorithm variant to use
-
ByPieceCoreProcessor
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
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
-