Class ReasoningAPI
java.lang.Object
fr.inria.rules.integraal.api.internal.ReasoningAPI
Deprecated, for removal: This API element is subject to removal in a future version.
Defines the high-level API for accessing Integraal's reasoning algorithms.
The purpose of this API is to create various software programs that enable programmers to easily use these algorithms.
The proposed high-level functionalities enable query evaluation, performing saturation, rewriting rules, querying a knowledge base... with different options.
The purpose of this API is to create various software programs that enable programmers to easily use these algorithms.
The proposed high-level functionalities enable query evaluation, performing saturation, rewriting rules, querying a knowledge base... with different options.
- Author:
- Pierre Bisquert, Michel Leclère, Sarah Michel, Federico Ulliana
-
Method Summary
Modifier and TypeMethodDescriptionstatic FactBasecoreChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Runs the core chase on a fact base and a rule base.static RuleBaseDeprecated, for removal: This API element is subject to removal in a future version.Decomposes a rule base.static FactBasedefaultChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Runs the default chase on a fact base and a rule base.static FactBasedelegatedDatalogChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Runs the delegated datalog chase on a fact base and a rule base.static Iterator<Substitution> evaluate(FactBase fb, Query query, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates a query over a fact base.static Iterator<Substitution> evaluate(FactBase fb, Query query, Substitution preHom, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates a query over a fact base with a pre-homomorphism.static Iterator<Substitution> evaluateRew(FactBase fb, Query query, RuleBase rb, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilationType, ExternalHaltingCondition... conds) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates a query after rewriting it with a rule base.static Iterator<Substitution> evaluateSat(FactBase fb, Query query, RuleBase rb, IAlgorithmParameters algoParam) Deprecated, for removal: This API element is subject to removal in a future version.Evaluates a query after saturating the fact base with a rule base.static RuleBaseextractCompilableRules(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Deprecated, for removal: This API element is subject to removal in a future version.Extracts the compilable rules from a rule base.static RuleBaseextractNonCompilableRules(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Deprecated, for removal: This API element is subject to removal in a future version.Extracts the non-compilable rules from a rule base.static FactBaseinMemoryDatalogChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Runs the in-memory datalog chase on a fact base and a rule base.static BooleanisDecidable(RuleBase ruleBase) Deprecated, for removal: This API element is subject to removal in a future version.Checks whether a rule base is decidable.static BooleanDeprecated, for removal: This API element is subject to removal in a future version.Checks whether a rule base is FES.static BooleanDeprecated, for removal: This API element is subject to removal in a future version.Checks whether a rule base is FUS.static BooleanDeprecated, for removal: This API element is subject to removal in a future version.Checks whether two rule bases form a hybrid rule base.static BooleanisHybridable(RuleBase ruleBase) Deprecated, for removal: This API element is subject to removal in a future version.Checks whether a rule base is hybridable.static FactBaselinearRulesChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Runs the linear-rules chase on a fact base and a rule base.static Collection<Substitution> nextAnswers(Iterator<Substitution> subIt, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Retrieves the next answers from an iterator of substitutions.static UnionFOQueryrewrite(RuleBase rb, Query query, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilationType) Deprecated, for removal: This API element is subject to removal in a future version.Rewrites a query with respect to a rule base and a compilation strategy.static FactBasesaturate(FactBase fb, RuleBase rb, IAlgorithmParameters algoParam) Deprecated, for removal: This API element is subject to removal in a future version.Saturates a fact base with a rule base using the given algorithm parameters.static FactBasesemiObliviousChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Runs the semi-oblivious chase on a fact base and a rule base.static FactBasestandardChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) Deprecated, for removal: This API element is subject to removal in a future version.Runs the standard chase on a fact base and a rule base.static Collection<Query> unfold(RuleBase ruleBase, Collection<Query> queries, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Deprecated, for removal: This API element is subject to removal in a future version.Unfolds queries with respect to a rule base.
-
Method Details
-
evaluate
@SafeVarargs public static Iterator<Substitution> evaluate(FactBase fb, Query query, IGParameter<InteGraalKeywords, ?>... params) throws IllegalArgumentException, IGParameterException, EvaluationException Deprecated, for removal: This API element is subject to removal in a future version.Evaluates a query over a fact base.- Parameters:
fb- the fact base to query.query- the query to evaluate.params- the evaluation parameters.- Returns:
- an iterator over matching substitutions.
- Throws:
IllegalArgumentException- if an argument is invalid.IGParameterException- if a parameter is invalid.EvaluationException- if evaluation fails.
-
evaluate
@SafeVarargs public static Iterator<Substitution> evaluate(FactBase fb, Query query, Substitution preHom, IGParameter<InteGraalKeywords, ?>... params) throws IllegalArgumentException, IGParameterException, EvaluationException Deprecated, for removal: This API element is subject to removal in a future version.Evaluates a query over a fact base with a pre-homomorphism.- Parameters:
fb- the fact base to query.query- the query to evaluate.preHom- the pre-homomorphism to apply.params- the evaluation parameters.- Returns:
- an iterator over matching substitutions.
- Throws:
IllegalArgumentException- if an argument is invalid.IGParameterException- if a parameter is invalid.EvaluationException- if evaluation fails.
-
nextAnswers
@SafeVarargs public static Collection<Substitution> nextAnswers(Iterator<Substitution> subIt, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException Deprecated, for removal: This API element is subject to removal in a future version.Retrieves the next answers from an iterator of substitutions.- Parameters:
subIt- the substitutions iterator.params- the retrieval parameters.- Returns:
- the next substitutions.
- Throws:
IGParameterException- if a parameter is invalid.
-
saturate
Deprecated, for removal: This API element is subject to removal in a future version.Saturates a fact base with a rule base using the given algorithm parameters.- Parameters:
fb- the fact base to saturate.rb- the rule base to apply.algoParam- the algorithm parameters.- Returns:
- the saturated fact base.
-
defaultChase
@SafeVarargs public static FactBase defaultChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException Deprecated, for removal: This API element is subject to removal in a future version.Runs the default chase on a fact base and a rule base.- Parameters:
fb- the fact base to saturate.rb- the rule base to apply.params- the chase parameters.- Returns:
- the saturated fact base.
- Throws:
IGParameterException- if a parameter is invalid.
-
semiObliviousChase
@SafeVarargs public static FactBase semiObliviousChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException Deprecated, for removal: This API element is subject to removal in a future version.Runs the semi-oblivious chase on a fact base and a rule base.- Parameters:
fb- the fact base to saturate.rb- the rule base to apply.params- the chase parameters.- Returns:
- the saturated fact base.
- Throws:
IGParameterException- if a parameter is invalid.
-
standardChase
@SafeVarargs public static FactBase standardChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException Deprecated, for removal: This API element is subject to removal in a future version.Runs the standard chase on a fact base and a rule base.- Parameters:
fb- the fact base to saturate.rb- the rule base to apply.params- the chase parameters.- Returns:
- the saturated fact base.
- Throws:
IGParameterException- if a parameter is invalid.
-
coreChase
@SafeVarargs public static FactBase coreChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException Deprecated, for removal: This API element is subject to removal in a future version.Runs the core chase on a fact base and a rule base.- Parameters:
fb- the fact base to saturate.rb- the rule base to apply.params- the chase parameters.- Returns:
- the saturated fact base.
- Throws:
IGParameterException- if a parameter is invalid.
-
linearRulesChase
@SafeVarargs public static FactBase linearRulesChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException Deprecated, for removal: This API element is subject to removal in a future version.Runs the linear-rules chase on a fact base and a rule base.- Parameters:
fb- the fact base to saturate.rb- the rule base to apply.params- the chase parameters.- Returns:
- the saturated fact base.
- Throws:
IGParameterException- if a parameter is invalid.
-
inMemoryDatalogChase
@SafeVarargs public static FactBase inMemoryDatalogChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException Deprecated, for removal: This API element is subject to removal in a future version.Runs the in-memory datalog chase on a fact base and a rule base.- Parameters:
fb- the fact base to saturate.rb- the rule base to apply.params- the chase parameters.- Returns:
- the saturated fact base.
- Throws:
IGParameterException- if a parameter is invalid.
-
delegatedDatalogChase
@SafeVarargs public static FactBase delegatedDatalogChase(FactBase fb, RuleBase rb, IGParameter<InteGraalKeywords, ?>... params) throws IGParameterException Deprecated, for removal: This API element is subject to removal in a future version.Runs the delegated datalog chase on a fact base and a rule base.- Parameters:
fb- the fact base to saturate.rb- the rule base to apply.params- the chase parameters.- Returns:
- the saturated fact base.
- Throws:
IGParameterException- if a parameter is invalid.
-
rewrite
public static UnionFOQuery rewrite(RuleBase rb, Query query, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilationType) throws IllegalArgumentException Deprecated, for removal: This API element is subject to removal in a future version.Rewrites a query with respect to a rule base and a compilation strategy.- Parameters:
rb- the rule base used for rewriting.query- the query to rewrite.ruleCompilationType- the compilation strategy.- Returns:
- the rewritten query.
- Throws:
IllegalArgumentException- if an argument is invalid.
-
evaluateSat
public static Iterator<Substitution> evaluateSat(FactBase fb, Query query, RuleBase rb, IAlgorithmParameters algoParam) throws IllegalArgumentException, IGParameterException, EvaluationException Deprecated, for removal: This API element is subject to removal in a future version.Evaluates a query after saturating the fact base with a rule base.- Parameters:
fb- the fact base to query.query- the query to evaluate.rb- the rule base used for saturation.algoParam- the saturation algorithm parameters.- Returns:
- an iterator over matching substitutions.
- Throws:
IllegalArgumentException- if an argument is invalid.IGParameterException- if a parameter is invalid.EvaluationException- if evaluation fails.
-
evaluateRew
public static Iterator<Substitution> evaluateRew(FactBase fb, Query query, RuleBase rb, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilationType, ExternalHaltingCondition... conds) throws IllegalArgumentException, IGParameterException, EvaluationException Deprecated, for removal: This API element is subject to removal in a future version.Evaluates a query after rewriting it with a rule base.- Parameters:
fb- the fact base to query.query- the query to evaluate.rb- the rule base used for rewriting.ruleCompilationType- the compilation strategy.conds- the external halting conditions.- Returns:
- an iterator over matching substitutions.
- Throws:
IllegalArgumentException- if an argument is invalid.IGParameterException- if a parameter is invalid.EvaluationException- if evaluation fails.
-
extractCompilableRules
public static RuleBase extractCompilableRules(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Deprecated, for removal: This API element is subject to removal in a future version.Extracts the compilable rules from a rule base.- Parameters:
ruleBase- the source rule base.ruleCompilation- the compilation strategy.conds- the external halting conditions.- Returns:
- the compilable rules.
-
extractNonCompilableRules
public static RuleBase extractNonCompilableRules(RuleBase ruleBase, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Deprecated, for removal: This API element is subject to removal in a future version.Extracts the non-compilable rules from a rule base.- Parameters:
ruleBase- the source rule base.ruleCompilation- the compilation strategy.conds- the external halting conditions.- Returns:
- the non-compilable rules.
-
unfold
public static Collection<Query> unfold(RuleBase ruleBase, Collection<Query> queries, InteGraalKeywords.Algorithms.Parameters.Compilation ruleCompilation, ExternalHaltingCondition... conds) Deprecated, for removal: This API element is subject to removal in a future version.Unfolds queries with respect to a rule base.- Parameters:
ruleBase- the rule base used for unfolding.queries- the queries to unfold.ruleCompilation- the compilation strategy.conds- the external halting conditions.- Returns:
- the unfolded queries.
-
decompose
-
isFes
-
isFus
-
isDecidable
-
isHybridable
-
isHybrid
Deprecated, for removal: This API element is subject to removal in a future version.Checks whether two rule bases form a hybrid rule base.- Parameters:
ruleBaseToSaturate- the rule base intended for saturation.ruleBaseToRewrite- the rule base intended for rewriting.- Returns:
trueif the rule bases form a hybrid rule base, otherwisefalse.
-
ModelAPI.get()instead. This class will be removed in a future release.