Class Forgetting

java.lang.Object
fr.inria.rules.integraal.forgetting.Forgetting

public class Forgetting extends Object
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 Details

    • Forgetting

      public Forgetting()
      Creates a forgetting utility instance.
  • Method Details

    • bodyUnfolding

      public static RuleBase bodyUnfolding(RuleBase rb)
      Rewrite the bodies of all rules with using a query-rewriting algorithm
      Parameters:
      rb - a rule base
      Returns:
      a semantically equivalent superset of the original rule base
    • bodyUnfoldingWith

      public static Collection<FORule> bodyUnfoldingWith(RuleBase rb, Collection<FORule> toRewrite)
      Rewrites the rules' bodies in the given toRewrite collection using the given RuleBase.

      The rules occurring only in rb will 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 bodies
      toRewrite - rules that have to be body-unfolded
      Returns:
      a new stream of FORule with all rewritings of toRewrite rules
    • naiveDatalogForget

      public static RuleBase naiveDatalogForget(RuleBase rb, Predicate<Predicate> toDrop)
      Creates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabulary

      The given RuleBase is not modified

      The given RuleBase must be FUS and all rules must be datalog

      Parameters:
      rb - RuleBase to apply the forgetting on
      toDrop - condition on predicates to remove
      Returns:
      a new RuleBase equivalent to the given one with less vocabulary
    • semiNaiveDatalogForget

      public static RuleBase semiNaiveDatalogForget(RuleBase rb, Predicate<Predicate> toDrop)
      Creates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabulary

      The given RuleBase is not modified

      The given RuleBase must be FUS and all rules must be datalog

      Parameters:
      rb - RuleBase to apply the forgetting on
      toDrop - condition on predicates to remove
      Returns:
      a new RuleBase equivalent to the given one with less vocabulary
    • forget

      public static RuleBase forget(RuleBase rb, Predicate<Predicate> toDrop)
      Creates a new RuleBase equivalent to the given one where some predicates have been removed from the vocabulary

      The given RuleBase is not modified

      The given RuleBase must be FUS

      Parameters:
      rb - RuleBase to apply the forgetting on
      toDrop - condition on predicates to remove
      Returns:
      a new RuleBase equivalent to the given one with less vocabulary