A Formalization of Generalization-Based Analogy in General Logic Programs