An Algebraic Approach to Static Analysis of Active Database RulesMaterialized view selection in a multidimensional database