Remove extraneous components from functional dependencies
Source:R/synthesise.r
remove_extraneous.RdRemove extraneous components from functional dependencies
Arguments
- x
a
functional_dependencyobject.- reduce_attributes
a logical, TRUE by default. If TRUE,
dependenciesare checked for determinant attributes that are made redundant by the other dependencies. This is redundant ifdependenciesis output fromdiscover, since there will be no such redundant attributes.
Value
a minimal cover of the original dependencies, i.e. a subset where
those remaining are not implied by the others. If remove_attributes
is TRUE, dependencies in the determinant are removed if the other
dependencies show them to be redundant.
Examples
# a -> b and b -> c imply a -> c
x <- functional_dependency(
list(list("a", "b"), list("b", "c"), list("a", "c")),
c("a", "b", "c")
)
remove_extraneous(x)
#> 2 functional dependencies
#> 3 attributes: a, b, c
#> {a} -> b
#> {b} -> c
# a -> b lets us remove b from {a, b} -> c
x <- functional_dependency(
list(list("a", "b"), list(c("a", "b"), "c")),
c("a", "b", "c")
)
remove_extraneous(x)
#> 2 functional dependencies
#> 3 attributes: a, b, c
#> {a} -> b
#> {a} -> c