Class FunctionalDependencyHelper
java.lang.Object
tools.refinery.interpreter.matchers.planning.helpers.FunctionalDependencyHelper
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 Summary
Modifier and TypeMethodDescriptionstatic <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.static <A> voidAdds all given dependencies to a mutable accumulator.static <A> voidAdds a given dependency to a mutable accumulator.static <A> booleanprojectDependencies(Map<Set<A>, Set<A>> originalDependencies, Set<A> targetAttributes) Returns the dependency set over attributes inthat are implied by a given source dependency set.invalid reference
targetAttributes
-
Method Details
-
closureOf
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
- 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 inthat are implied by a given source dependency set.invalid reference
targetAttributesNote: 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 attributestargetAttributes- the set of attributes we are interested in- Since:
- 1.5
-
includeDependency
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
-