Exact Symbolic Inference in Probabilistic Programs via Sum-Product Representations