Class StratifiedChaseBuilder<RW extends MaterializedData & Writable>
java.lang.Object
fr.inria.rules.integraal.forward_chaining.chase.metachase.stratified.StratifiedChaseBuilder<RW>
- Type Parameters:
RW- the writable materialized data type processed by the chase
Builder for creating a StratifiedChase.
Allows setting various configurations and choosing different stratification methods.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.StratifiedChaseBuilder(ChaseBuilder<RW> chaseBuilder) Constructor with a ChaseBuilder instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal StratifiedChaseBuilder<RW> addEndOfStepTreatments(EndTreatment<RW>... treatments) Adds end of step treatments.final StratifiedChaseBuilder<RW> addGlobalEndTreatments(EndTreatment<RW>... treatments) Adds global end treatments.final StratifiedChaseBuilder<RW> addGlobalPretreatments(PreTreatment<RW>... treatments) Adds global pretreatments.final StratifiedChaseBuilder<RW> addHaltingConditions(HaltingCondition<RW>... conditions) Adds halting conditions.final StratifiedChaseBuilder<RW> addStepPretreatments(PreTreatment<RW>... treatments) Adds step pretreatments.build()Builds the StratifiedChase instance.debug()Enables debug mode.static <RW extends MaterializedData & Writable>
StratifiedChaseBuilder<RW> defaultBuilder(ChasableData<RW> fb, RuleBase rb) Returns a default StratifiedChaseBuilder initialized with the given FactBase and RuleBase.setChasableData(ChasableData<RW> chasableData) Sets the FactBase.setChaseBuilder(ChaseBuilder<RW> chaseBuilder) Sets the ChaseBuilder instance.setFinalPredicates(List<Predicate> predicates) Sets the list of final predicates to keep in the fact base.setRuleBase(RuleBase rb) Sets the RuleBase.Sets the strata (list of RuleBase).Uses the pseudo-minimal stratification method.Uses the single evaluation stratification method.Uses the default stratification method (by strongly connected components).
-
Constructor Details
-
StratifiedChaseBuilder
public StratifiedChaseBuilder()Default constructor. -
StratifiedChaseBuilder
Constructor with a ChaseBuilder instance.- Parameters:
chaseBuilder- the ChaseBuilder instance to use.
-
-
Method Details
-
defaultBuilder
public static <RW extends MaterializedData & Writable> StratifiedChaseBuilder<RW> defaultBuilder(ChasableData<RW> fb, RuleBase rb) Returns a default StratifiedChaseBuilder initialized with the given FactBase and RuleBase.- Type Parameters:
RW- the writable materialized data type processed by the chase- Parameters:
fb- the FactBase.rb- the RuleBase.- Returns:
- the default StratifiedChaseBuilder initialized with the given parameters.
-
setChaseBuilder
Sets the ChaseBuilder instance.- Parameters:
chaseBuilder- the ChaseBuilder instance to use.- Returns:
- this StratifiedChaseBuilder instance.
-
setChasableData
Sets the FactBase.- Parameters:
chasableData- the chasable data.- Returns:
- this StratifiedChaseBuilder instance.
-
setRuleBase
Sets the RuleBase.- Parameters:
rb- the RuleBase.- Returns:
- this StratifiedChaseBuilder instance.
-
setStrata
Sets the strata (list of RuleBase). If this method is used, no stratification method will be applied.- Parameters:
strata- the list of RuleBase.- Returns:
- this StratifiedChaseBuilder instance.
-
usePseudoMinimalStratification
Uses the pseudo-minimal stratification method. Ensures each rule is evaluated at least once, minimizing the number of strata.- Returns:
- this StratifiedChaseBuilder instance.
-
useStratification
Uses the default stratification method (by strongly connected components). Ensures correct rule application by grouping strongly connected components.- Returns:
- this StratifiedChaseBuilder instance.
-
useSingleEvaluationStratification
Uses the single evaluation stratification method. Ensures each rule is evaluated exactly once, assuming the graph is acyclic.- Returns:
- this StratifiedChaseBuilder instance.
-
addHaltingConditions
@SafeVarargs public final StratifiedChaseBuilder<RW> addHaltingConditions(HaltingCondition<RW>... conditions) Adds halting conditions.- Parameters:
conditions- the halting conditions to add.- Returns:
- this StratifiedChaseBuilder instance.
-
addGlobalPretreatments
@SafeVarargs public final StratifiedChaseBuilder<RW> addGlobalPretreatments(PreTreatment<RW>... treatments) Adds global pretreatments.- Parameters:
treatments- the global pretreatments to add.- Returns:
- this StratifiedChaseBuilder instance.
-
addStepPretreatments
@SafeVarargs public final StratifiedChaseBuilder<RW> addStepPretreatments(PreTreatment<RW>... treatments) Adds step pretreatments.- Parameters:
treatments- the step pretreatments to add.- Returns:
- this StratifiedChaseBuilder instance.
-
addGlobalEndTreatments
@SafeVarargs public final StratifiedChaseBuilder<RW> addGlobalEndTreatments(EndTreatment<RW>... treatments) Adds global end treatments.- Parameters:
treatments- the global end treatments to add.- Returns:
- this StratifiedChaseBuilder instance.
-
addEndOfStepTreatments
@SafeVarargs public final StratifiedChaseBuilder<RW> addEndOfStepTreatments(EndTreatment<RW>... treatments) Adds end of step treatments.- Parameters:
treatments- the end of step treatments to add.- Returns:
- this StratifiedChaseBuilder instance.
-
setFinalPredicates
Sets the list of final predicates to keep in the fact base.- Parameters:
predicates- the list of predicates to keep.- Returns:
- this StratifiedChaseBuilder instance.
-
debug
Enables debug mode.- Returns:
- this StratifiedChaseBuilder instance.
-
build
-