This paper presents a general criterion for measuring the degree to which any given theory can be considered a good explanation of a particular body of data. A formal definition of what constitutes an acceptable explanation of a body of data is given, and the length of explanation used as a measure for selecting the best of a set of competing theories. Unlike most previous approaches to inductive inference, the length of explanation includes a measure of the complexity or likelihood of a theory as well as a measure of the degree of fit between theory and data. In this way, prior expectations about the environment can be represented, thus providing a hypothesis space in which search for good or optimal theories is made more tractable. Furthermore, it is shown how theories can be represented as structures that reflect the conceptual entities used to describe and reason about the given problem domain.