Interface GraphOfFORuleDependencies

All Known Implementing Classes:
GRDImpl

public interface GraphOfFORuleDependencies
A graph of rule dependencies represent the possibility that an application of a rule triggers the linked rules in the graph.
Author:
Florent Tornil
  • Method Details

    • getRules

      Collection<FORule> getRules()
      Return all the rules in the GRD
      Returns:
      all the rules in the GRD
    • getTriggeredRules

      Set<FORule> getTriggeredRules(FORule src)
      Returns all rules that can be triggered by the specified one.
      Parameters:
      src - a Rule.
      Returns:
      all rules that can be triggered by the specified one.
    • getAncestorRules

      Set<FORule> getAncestorRules(FORule target)
      Returns all rules that can trigger the specified one.
      Parameters:
      target - a Rule.
      Returns:
      all rules that can trigger the specified one.
    • getCompressedAncestorRules

      Set<FORule> getCompressedAncestorRules(FORule target)
      Returns the compressed ancestor rules of the specified rule.
      Parameters:
      target - the rule whose compressed ancestors are requested
      Returns:
      the compressed ancestor rules of the specified rule
    • getPreventedRules

      Set<FORule> getPreventedRules(FORule src)
      Returns all rules that can be prevented by the specified one.
      Parameters:
      src - a Rule.
      Returns:
      all rules that can be prevented by the specified one.
    • isStratifiable

      boolean isStratifiable()
      Check if this GRD is stratifiable
      Returns:
      true iff the ruleset represented by this GRD is stratifiable
    • getBySccStratification

      List<RuleBase> getBySccStratification()
      The computed order of the stratification must guaranty a correct rule application but no additional assumption is done at this level on the computed stratum
      Returns:
      the stratification as an ordered list of rulebases
    • getMinimalStratification

      Optional<List<RuleBase>> getMinimalStratification()
      The computed order of the stratification must guaranty a correct rule application. This method should try to minimize the number of stratum while keeping a correct order but no guaranty is given on the minimality of the result. An empty optional should be returned if the rules are not stratifiable
      Returns:
      the stratification as an ordered list of rulebases
    • getSingleEvaluationStratification

      Optional<List<RuleBase>> getSingleEvaluationStratification()
      Computes a stratification of the rules for single evaluation. This method ensures that each rule is evaluated exactly once and attempts to minimize the number of strata. This is only possible for an acyclic graph; if the graph contains a cycle, an empty Optional is returned.
      Returns:
      an Optional containing the stratification as an ordered list of rule bases if the graph is acyclic, otherwise an empty Optional.
    • getAncestorRules

      Collection<? extends FORule> getAncestorRules(FORule rule, Set<FORule> rulesToIgnore)
      Retrieves the ancestor rules by ignoring some rules
      Parameters:
      rule - the rule whose ancestors are requested
      rulesToIgnore - these rules will be ignored in the recursive search of ancestors
      Returns:
      the ancestor rules found while ignoring the supplied rules