A Theory of Observables for Logic Programs