A Compositional Semantics for Logic Programs