Constraint-based updates in a functional data model database
State change is an intrinsic feature of real-world database applications. However, due to their inherent procedurality, updates can be difficult to support in databases based on the more declarative paradigms, such as the functional and logic data models. A common approach to this problem is to build two distinct subsystems, one of which is allowed to make state changes and the other of which is not. We have explored three ways to provide more uniform support for user updates within the context of P/FDM, a Functional Data Model database implemented in Prolog. The first of these is a subsystem for the efficient checking of a class of semantic integrity constraints, expressed in a declarative language, which relieves users of the burden of ensuring that their updates do not violate database integrity. The second is a simple transaction mechanism that allows users to suspend integrity checking during complex updates, but which ensures that validity has been restored before any transaction is allowed to commit. The final extension provides users with a language for the declarative description of object creations, in which updates are described in terms of the constraints that the resulting database state must satisfy, rather than as sequences of individual update operations. The common factor in each case is the use of semantic domain knowledge, expressed in the form of constraints, to allow the DBMS to insulate users from the worst consequences of state changes. The extended version of the P/FDM system now forms a solid platform from which to experiment further with constraint processing techniques in a database context.