  Rule-based reasoning is an essential part of human intelligence prominently
formalized in artificial intelligence research via logic programs. Describing
complex objects as the composition of elementary ones is a common strategy in
computer science and science in general. The author has recently introduced the
sequential composition of logic programs in the context of logic-based
analogical reasoning and learning in logic programming. Motivated by these
applications, in this paper we construct a qualitative and algebraic notion of
syntactic logic program similarity from sequential decompositions of programs.
We then show how similarity can be used to answer queries across different
domains via a one-step reduction. In a broader sense, this paper is a further
step towards an algebraic theory of logic programming.
