25 Nov 2015

Deriving Production Rules for Constraint Maintenance

Traditionally, integrity constraints in database systems are maintained either by rolling back any transaction that produces an inconsistent state or by disallowing or modifying operations that may produce an inconsistent state. An alternative approach is to provide automatic “repair” of inconsistent states using production rules. For each constraint, a production rule is used to detect constraint violation and to initiate database operations that restore consistency.

We describe an SQL-based language for defining integrity constraints and a framewcrk for translating these constraints into constraint-maintaining production rules. Some parts of the translation are automatic while other parts require user intervention. Based on the semantics of our set-oriented production rules language and under certain assumptions, we prove that at the end of each transaction the rules are guaranteed to produce a state satisfying all defined constraints. We apply our approach to a good-sized example.

… an integrity constraints facility permits logical specification of those database states that are considered acceptable, or consistent.

constraints are expressed as predicates over the database state: if the predicate is true in a particular state, then the constraint is violated and the state is inconsistent.