An Algebraic Representation of Logic-Program Computations