Class ProductivityChecker

java.lang.Object
fr.inria.rules.integraal.grd.impl.dependency_checker.ProductivityChecker
All Implemented Interfaces:
DependencyChecker
Direct Known Subclasses:
RestrictedProductivityChecker

public class ProductivityChecker extends Object implements DependencyChecker
Checks that the dependency will produce something

Let r1, r2 two rules (B+, B-, H), potentially with (safe) negation
We say that r1 may trigger r2 iff there exists a unifier u between B+(r2) and H(r1) such that
(i) μ(B+(r1)) ∩ μ(B-(r1)) = ∅
(ii) μ(B+(r1)) ∩ μ(B-(r2)) = ∅
(iii) μ(B+(r2)) ∩ μ(B-(r2)) = ∅
(iv) μ(B+(r2)) ∩ [μ(B-(r1))\μ(H(r1))] = ∅
(v) μ(H(r2)) ∉ [μ(B+(r1)) u μ(H(r1)) u μ(B+(r2))]
(vi) μ(B-(r2)) ∩ μ(H(r1)) = ∅
(vii) μ(B+(r2)) ∉ μ(B+(r1))

Let r1, r2 two rules (B+, B-, H) with (safe) negation
We say that r1 may prevent the triggering of r2 iff there exists a unifier u between Bi-(r2) and H(r1) such that
(i) [μ(B+(r1)) U μ(B+(r2))] ∩ [μ(B-(r1)) U μ(B-(r2))] = ∅

Author:
Florent Tornil
  • Constructor Details

    • ProductivityChecker

      public ProductivityChecker()
      Creates the productivity dependency checker.
  • Method Details

    • instance

      public static ProductivityChecker instance()
      Returns the singleton productivity checker.
      Returns:
      the default instance of this checker
    • isValidPositiveDependency

      public boolean isValidPositiveDependency(FORule r1, FORule r2, QueryUnifier u)
      Description copied from interface: DependencyChecker
      Checks whether the positive dependency induced by the supplied unifier is valid.
      Specified by:
      isValidPositiveDependency in interface DependencyChecker
      Parameters:
      r1 - the source rule
      r2 - the target rule
      u - the unifier between r1 and r2
      Returns:
      true iff the dependency is valid
    • isValidNegativeDependency

      public boolean isValidNegativeDependency(FORule r1, FORule r2, QueryUnifier u)
      Description copied from interface: DependencyChecker
      Checks whether the negative dependency induced by the supplied unifier is valid.
      Specified by:
      isValidNegativeDependency in interface DependencyChecker
      Parameters:
      r1 - the source rule
      r2 - the target rule
      u - the unifier between r1 and r2
      Returns:
      true iff the dependency is valid