A Probabilistic Prolog and its Applications by