This paper presents a mathematical theory underlying a systematic method for constructing Prolog programs called stepwise enhancement. Stepwise enhancement dictates building a program starting with a skeleton program which constitutes the basic control flow for the problem to be solved, and adding extra computations to the skeleton program by using well-understood programming techniques. Each extra computation can be developed independently, and the separate enhancements combined to produce the final program. While intuition and motivation have focused on Prolog, the methods are applicable to logic programming languages more generally. The central concept in our mathematical theory for stepwise enhancement is that of a program map between t...