Class FunctionalDependencyHelper

java.lang.Object
tools.refinery.interpreter.matchers.planning.helpers.FunctionalDependencyHelper

public class FunctionalDependencyHelper extends Object
Helper utility class for functional dependency analysis. Throughout this class attribute sets are represented as generic sets and functional dependencies as maps from attribute set (generic sets) to attribute set (generic sets)
  • Method Details

    • closureOf

      public static <A> Set<A> closureOf(Collection<A> attributes, Map<Set<A>,Set<A>> dependencies)
      Get the closure of the specified attribute set relative to the specified functional dependencies.
      Parameters:
      attributes - The attributes to get the closure of.
      dependencies - The functional dependencies of which the closure operation is relative to.
      Returns:
      The closure of the specified attribute set relative to the specified functional dependencies.
    • isTrivial

      public static <A> boolean isTrivial(Set<A> left, Set<A> right)
      Returns:
      true if the dependency from the left set to the right set is trivial
      Since:
      1.5
    • projectDependencies

      public static <A> Map<Set<A>,Set<A>> projectDependencies(Map<Set<A>,Set<A>> originalDependencies, Set<A> targetAttributes)
      Returns the dependency set over attributes in
      invalid reference
      targetAttributes
      that are implied by a given source dependency set.

      Note: exponential in the size of the target attribute set.

      Note: minimality of the returned dependency set is currently not guaranteed.

      Parameters:
      originalDependencies - all dependencies that are known to hold on a wider set of attributes
      targetAttributes - the set of attributes we are interested in
      Since:
      1.5
    • includeDependency

      public static <A> void includeDependency(Map<Set<A>,Set<A>> accumulator, Set<A> left, Set<A> right)
      Adds a given dependency to a mutable accumulator.
      Since:
      1.5
    • includeDependencies

      public static <A> void includeDependencies(Map<Set<A>,Set<A>> accumulator, Map<Set<A>,Set<A>> additionalDependencies)
      Adds all given dependencies to a mutable accumulator.
      Since:
      1.5