The Bottom-up Query machine (BQM)-the role played by our system in the framework of the KIWIS system (K. Apt et al., 1987)-extends deductive database technology with knowledge structuring capabilities to provide an advanced environment for the development of data and knowledge based applications. The system relies on a knowledge representation language that combines the declarativeness of logic programming with the notions of object, inheritance with exceptions, and message passing. Exceptions are supported by allowing rules with negated heads. The use of exceptions inside the inheritance mechanism makes the language inherently nonmonotonic. The paper contains a comprehensive description of both the language and the implementation principles of the BQM system. It begins by providing a model theoretic semantics of the language based on the notion of least model. A fixpoint semantics, providing a constructive definition of the least model, is given as well. Then, a number of implementation techniques for efficient query evaluation are described. Such techniques significantly extend "traditional" deductive database query evaluation strategies to deal with monotonic reasoning. A description of the architecture of the current prototype of the BQM system is also given.