In this paper we describe a compromise between generative planning and special-purpose software. Hierarchical functional models are used by an intelligent system to represent its own processes for both acting and reasoning. Since these models are custom-built for a specific set of situations, they can provide efficiency comparable to special-purpose software in those situations. Furthermore, the models can be automatically modified. In this way, the specialized power of the models can be leveraged even in situations for which they were not originally intended. When a model cannot address some or all of a problem, an off-the-shelf generative planning system is used to construct a new sequence of actions which can be added to the model. Thus portions of the process which were previously understood are addressed with the efficiency of a specialized reasoning process, and portions of the process which were previously unknown are addressed with the flexibility of generative planning. The REM reasoning shell provides both the language for encoding functional models of processes and the algorithms for executing and adapting these models.