Learn R Programming

autodb (version 3.3.1)

remove_extraneous: Remove extraneous components from functional dependencies

Description

Remove extraneous components from functional dependencies

Usage

remove_extraneous(x, reduce_attributes = TRUE)

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.

Arguments

x

a functional_dependency object.

reduce_attributes

a logical, TRUE by default. If TRUE, dependencies are checked for determinant attributes that are made redundant by the other dependencies. This is redundant if dependencies is output from discover, since there will be no such redundant attributes.

Examples

Run this code
# 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)

# 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)

Run the code above in your browser using DataLab