Class ChaseBuilder<RW extends MaterializedData & Writable>
java.lang.Object
fr.inria.rules.integraal.forward_chaining.chase.ChaseBuilder<RW>
- Type Parameters:
RW- the writable materialized data type handled by the chase
Builds and configures chase algorithms.
- Author:
- Florent Tornil
Builder to create a parameterized chase algorithm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddGlobalEndTreatments(EndTreatment<RW>... ets) Adds the given Global end treatementAdds the given Global end treatementfinal ChaseBuilder<RW> addGlobalPretreatments(PreTreatment<RW>... pts) Adds the given Global pretreatmentAdds the given Global pretreatmentfinal ChaseBuilder<RW> addHaltingConditions(HaltingCondition<RW>... hcs) Adds the given halting conditionsAdds the given halting conditionsAdds the standard halting conditionsfinal ChaseBuilder<RW> addStepEndTreatments(EndTreatment<RW>... ets) Adds the given Step end treatementAdds the given Step end treatementfinal ChaseBuilder<RW> addStepPretreatments(PreTreatment<RW>... pts) Adds the given Step pretreatmentAdds the given Step pretreatmentbuild()The minimal configuration requires :
* a QueryableWritableData to saturate
* a RuleBase to get Rules from
* a TermFactory to create new terms
Default behavior is :
* a GRDScheduler for rules
* a TriggerRuleApplier with :
* * a SemiNaiveTriggerComputer with a default GenericFOQueryEvaluator
* * a SemiObliviousChecker
* * a Applier with :
* * * a FreshRenamer
* * * a DirectApplication
* HaltingConditions :
* * CreatedFactsAtPreviousStep
* * HasRulesToApplychase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... chaseParams) Chase initialized with the given parametersstatic <RW extends MaterializedData & Writable>
ChaseBuilder<RW> defaultBuilder(ChasableData<RW> chasableData, RuleBase rb) Builder initialized with the default chase and mandatory parametersstatic ChaseBuilder<FactBase> defaultBuilder(FactBase fb, RuleBase rb) Builder initialized with the default chase and mandatory parametersstatic <RW extends MaterializedData & Writable>
Chase<RW> defaultChase(ChasableData<RW> chasableData, RuleBase rb) Chase initialized with the default parameters and the given mandatory parametersdefaultChase(FactBase fb, RuleBase rb) Chase initialized with the default parameters and the given mandatory parametersSets the BodyToQueryTransformersetChasableData(ChasableData<RW> chasableData) Sets the QueryableWritableDataSets the TriggerRenamerSets the FOQueryEvaluatorSets the FactsHandlersetParams(IGParameter<InteGraalKeywords, ?>... chaseParams) Sets (and check) the parameter configuration
The chase parameter list is considered in the given order.setRuleApplier(RuleApplier<RW> ra) Sets the RuleAppliersetRuleBase(RuleBase rb) Sets the RuleBaseSets the RuleSchedulerSets the TermFactorySets the TriggerApplierSets the TriggerCheckerSets the TriggerComputerUse a transformation that keep all variables as answer variables when evaluating a rule's bodyUse an always true criteria for the triggersUse a skolem of the body as name for the existentialsUse a breadth-first application of the triggersUses the scheduler that groups rule applications by predicate.Use an equivalent criteria for the triggersUse a fresh name for the existentialsUse a skolem of the body, limited to the frontier of the piece as name for the existentialsUse a skolem of the body, limited to the frontier as name for the existentialsUse a transformation that keep only the variables of the frontier as answer variables when evaluating a rule's bodyUse the generic query evaluatorUse a rule scheduler based on the GRDUse a multi-threaded rule applier for parallel application of rules.Use a naive method to compute triggersUse a naive rule schedulerUse a oblivious criteria for the triggersUse a parallel application of the triggersUse a restricted criteria for the triggersUse a restricted method to compute triggersUse the semi naive method to compute triggersUse a semi oblivious criteria for the triggersUse the smart query evaluatorUse a combined semi oblivious and restricted criteria for the triggersUse a method of delegating to the source the application of the datalog rulesUse a method of delegating to the source the application of the datalog rulesReturns a StratifiedChaseBuilder for creating a StratifiedChase, with this ChaseBuilder in parameter.Use a breadth first trigger applierUse the two-steps method to compute triggers
-
Constructor Details
-
ChaseBuilder
public ChaseBuilder()Creates a builder with the default chase configuration.
-
-
Method Details
-
defaultBuilder
Builder initialized with the default chase and mandatory parameters- Parameters:
fb- the factbase to saturaterb- the rule to apply- Returns:
- the builder initialized with the given parameters
-
defaultBuilder
public static <RW extends MaterializedData & Writable> ChaseBuilder<RW> defaultBuilder(ChasableData<RW> chasableData, RuleBase rb) Builder initialized with the default chase and mandatory parameters- Type Parameters:
RW- the writable materialized data type handled by the builder- Parameters:
chasableData- the chasable data to saturaterb- the rule to apply- Returns:
- the builder initialized with the given parameters
-
defaultChase
-
defaultChase
public static <RW extends MaterializedData & Writable> Chase<RW> defaultChase(ChasableData<RW> chasableData, RuleBase rb) Chase initialized with the default parameters and the given mandatory parameters- Type Parameters:
RW- the writable materialized data type handled by the chase- Parameters:
chasableData- the chasable data to saturaterb- the rule to apply- Returns:
- the default chase initialized with the given parameters
-
chase
public static Chase<FactBase> chase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... chaseParams) throws IGParameterException Chase initialized with the given parameters- Parameters:
fb- the factbase to saturaterb- the rule to applychaseParams- the chase parameter- Returns:
- the chase initialized with the given parameters
- Throws:
IGParameterException- if one of the supplied parameters is invalid
-
build
The minimal configuration requires :
* a QueryableWritableData to saturate
* a RuleBase to get Rules from
* a TermFactory to create new terms
Default behavior is :
* a GRDScheduler for rules
* a TriggerRuleApplier with :
* * a SemiNaiveTriggerComputer with a default GenericFOQueryEvaluator
* * a SemiObliviousChecker
* * a Applier with :
* * * a FreshRenamer
* * * a DirectApplication
* HaltingConditions :
* * CreatedFactsAtPreviousStep
* * HasRulesToApply- Returns:
- the created chase or an empty optional if the configuration is incorrect
-
useTriggerRuleApplier
-
useGenericFOQueryEvaluator
-
useSmartFOQueryEvaluator
-
useNaiveRuleScheduler
-
useGRDRuleScheduler
-
useAllTransformer
Use a transformation that keep all variables as answer variables when evaluating a rule's body- Returns:
- this
-
useFrontierTransformer
Use a transformation that keep only the variables of the frontier as answer variables when evaluating a rule's body- Returns:
- this
-
useNaiveComputer
-
useRestrictedComputer
Use a restricted method to compute triggers- Returns:
- this
-
useSemiNaiveComputer
Use the semi naive method to compute triggers- Returns:
- this
-
useTwoStepComputer
Use the two-steps method to compute triggers- Returns:
- this
-
useSourceDelegatedDatalogApplication
Use a method of delegating to the source the application of the datalog rules- Returns:
- this
-
useAlwaysTrueChecker
Use an always true criteria for the triggers- Returns:
- this
-
useObliviousChecker
Use a oblivious criteria for the triggers- Returns:
- this
-
useSemiObliviousChecker
Use a semi oblivious criteria for the triggers- Returns:
- this
-
useRestrictedChecker
Use a restricted criteria for the triggers- Returns:
- this
-
useEquivalentChecker
Use an equivalent criteria for the triggers- Returns:
- this
-
useFreshNaming
-
useBodySkolem
Use a skolem of the body as name for the existentials- Returns:
- this
-
useFrontierSkolem
Use a skolem of the body, limited to the frontier as name for the existentials- Returns:
- this
-
useFrontierByPieceSkolem
Use a skolem of the body, limited to the frontier of the piece as name for the existentials- Returns:
- this
-
setChasableData
Sets the QueryableWritableData- Parameters:
chasableData- the chasable data- Returns:
- this
-
setRuleBase
Sets the RuleBase- Parameters:
rb- the RuleBase- Returns:
- this
-
setTermFactory
Sets the TermFactory- Parameters:
tf- the TermFactory- Returns:
- this
-
setRuleScheduler
Sets the RuleScheduler- Parameters:
rsc- the RuleScheduler- Returns:
- this
-
setFOQueryEvaluator
Sets the FOQueryEvaluator- Parameters:
eval- the FOQueryEvaluator- Returns:
- this
-
setRuleApplier
Sets the RuleApplier- Parameters:
ra- the RuleApplier- Returns:
- this
-
setBodyToQueryTransformer
Sets the BodyToQueryTransformer- Parameters:
transf- the BodyToQueryTransformer- Returns:
- this
-
setTriggerComputer
Sets the TriggerComputer- Parameters:
tc- the TriggerComputer- Returns:
- this
-
setTriggerChecker
Sets the TriggerChecker- Parameters:
tch- the TriggerChecker- Returns:
- this
-
setTriggerApplier
Sets the TriggerApplier- Parameters:
ta- the TriggerApplier- Returns:
- this
-
setExistentialsRenamer
Sets the TriggerRenamer- Parameters:
tr- the TriggerRenamer- Returns:
- this
-
setNewFactsHandler
Sets the FactsHandler- Parameters:
fh- the FactsHandler- Returns:
- this
-
addStandardHaltingConditions
Adds the standard halting conditions- Returns:
- this
-
addHaltingConditions
Adds the given halting conditions- Parameters:
hcs- halting conditions- Returns:
- this
-
addHaltingConditions
Adds the given halting conditions- Parameters:
hcs- halting conditions- Returns:
- this
-
addGlobalPretreatments
Adds the given Global pretreatment- Parameters:
pts- Global pretreatment- Returns:
- this
-
addGlobalPretreatments
Adds the given Global pretreatment- Parameters:
pts- Global pretreatment- Returns:
- this
-
addStepPretreatments
Adds the given Step pretreatment- Parameters:
pts- Step pretreatment- Returns:
- this
-
addStepPretreatments
Adds the given Step pretreatment- Parameters:
pts- Step pretreatment- Returns:
- this
-
addGlobalEndTreatments
Adds the given Global end treatement- Parameters:
ets- Step Global end treatement- Returns:
- this
-
addGlobalEndTreatments
Adds the given Global end treatement- Parameters:
ets- Step Global end treatement- Returns:
- this
-
addStepEndTreatments
Adds the given Step end treatement- Parameters:
ets- Step end treatement- Returns:
- this
-
addStepEndTreatments
Adds the given Step end treatement- Parameters:
ets- Step end treatement- Returns:
- this
-
useStratifiedChase
Returns a StratifiedChaseBuilder for creating a StratifiedChase, with this ChaseBuilder in parameter. Transfers the QueryableWritableData and RuleBase if they are already set.- Returns:
- a new StratifiedChaseBuilder instance.
-
useByPredicateRuleScheduler
Uses the scheduler that groups rule applications by predicate.- Returns:
- this builder
-
useBreadthFirstApplier
Use a breadth-first application of the triggers- Returns:
- this
-
useParallelApplier
Use a parallel application of the triggers- Returns:
- this
-
useMultiThreadRuleApplier
Use a multi-threaded rule applier for parallel application of rules. This may not work with stores that do not support concurrent matching or queries- Returns:
- this
-
useSourceDelegatedDatalogApplier
Use a method of delegating to the source the application of the datalog rules- Returns:
- this
-
useSORestrictedChecker
Use a combined semi oblivious and restricted criteria for the triggers- Returns:
- this
-
setParams
public ChaseBuilder<RW> setParams(IGParameter<InteGraalKeywords, ?>... chaseParams) throws IGParameterException Sets (and check) the parameter configuration
The chase parameter list is considered in the given order. Two kinds of parameters are considered : - exclusive ones (only one value is considered): when such a parameter occurs several times in the list, only the last value is retained - cumulative ones (several values are possible) that are CHASEHALTER and INTERSTEPTREATMENT: when such a parameter occurs several times in the list, all its values are accumulated- Parameters:
chaseParams- the chase parameters- Returns:
- this
- Throws:
IGParameterException- if one of parameters is invalid for the chase
-