Class Forgetting
java.lang.Object
fr.inria.rules.integraal.forgetting.Forgetting
The process of Forgetting is to remove some rules from the rulebase according to specific properties.
The goal is to obtain an equivalent rulebase (in terms of end-inferences) by short-cutting some inferences, removing some predicates from the inferred vocabulary.
This work is done for datalog rules.
- Author:
- Florent Tornil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RuleBaseRewrite the bodies of all rules with using a query-rewriting algorithmstatic Collection<FORule> bodyUnfoldingWith(RuleBase rb, Collection<FORule> toRewrite) Rewrites the rules' bodies in the giventoRewritecollection using the given RuleBase.static RuleBaseCreates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabularystatic RuleBasenaiveDatalogForget(RuleBase rb, Predicate<Predicate> toDrop) Creates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabularystatic RuleBasesemiNaiveDatalogForget(RuleBase rb, Predicate<Predicate> toDrop) Creates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabulary
-
Constructor Details
-
Forgetting
public Forgetting()Creates a forgetting utility instance.
-
-
Method Details
-
bodyUnfolding
-
bodyUnfoldingWith
Rewrites the rules' bodies in the giventoRewritecollection using the given RuleBase.The rules occurring only in
rbwill not be present in the returned rules. Each body rewriting results in a new rule, where the head is a specialization of the original one.Note that this algorithm only halts if the rewriting process halts (ie: the RuleBase is FUS)
- Parameters:
rb- rules used to unfold bodiestoRewrite- rules that have to be body-unfolded- Returns:
- a new stream of
FORulewith all rewritings oftoRewriterules
-
naiveDatalogForget
Creates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabularyThe given RuleBase is not modified
The given RuleBase must be FUS and all rules must be datalog
- Parameters:
rb- RuleBase to apply the forgetting ontoDrop- condition on predicates to remove- Returns:
- a new RuleBase equivalent to the given one with less vocabulary
-
semiNaiveDatalogForget
Creates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabularyThe given RuleBase is not modified
The given RuleBase must be FUS and all rules must be datalog
- Parameters:
rb- RuleBase to apply the forgetting ontoDrop- condition on predicates to remove- Returns:
- a new RuleBase equivalent to the given one with less vocabulary
-
forget
Creates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabularyThe given RuleBase is not modified
The given RuleBase must be FUS
- Parameters:
rb- RuleBase to apply the forgetting ontoDrop- condition on predicates to remove- Returns:
- a new RuleBase equivalent to the given one with less vocabulary
-