A general learning theory and its application to schema abstraction