Similar Items: Deriving Probability Density Functions from Probabilistic Functional Programs