Efficient algorithms for prolog based probabilistic logic programming door