Probabilistic Logic Programming

What is a good resource for Probabilistic Logic Programming in Prolog, SWI-Prolog in particular?

I found ProbLog which looks elegant but seems to be implemented on top of Python instead of one of the Prolog flavors.


I’d suggest to start with a look at the terrific site


You can also check out the book which is associated with the site mentioned by Jan

2 Likes is very nice and easy also.

1 Like

BTW, what is the speed slowdown expected by using cplint with a simple lpad (comparing it with calling a regular non-probabilistic predicate)?

Probabilistic reasoning is in general very expensive so a slowdown with respect to plain prolog is to be expected. What is the program you are trying?

I was simply experimenting with different examples from your book, so I was wondering if you had made a benchmark to measure the slowdown.

I have made no such benchmarks because it would not be very fair: plain prolog and probabilistic prolog compute different things. In fact, I don’t know of anybody that has done this comparison.
However, if you want to get an idea of the difference, you can try the computation of the existence of a path in a grah, see

for the probabilistic version.

If you consider the attached graph, cplint takes more than 1 hour to answer the query prob(path(1,100),P). If you remove the probabilities it takes about 10 ms to answer path(1,100)

(Attachment is missing)

1 Like

Sorry, the attachment didn’t go through, here it is

@friguzzi, I ran into an error trying to use cplint with SWI 8.1.4 on MacOS.
Install went without issues but library(pita) has issues.

?- pack_install(cplint).
Install cplint@4.5.0 from GIT at Y/n? 
Warning: Package depends on the following:
Warning:   "auc", provided by auc@1.0 from
Warning:   "bddem", provided by bddem@4.3.1 from
Warning:   "matrix", provided by matrix@1.9.1 from

What do you wish to do
   (1) * Install proposed dependencies
   (2)   Only install requested package
   (3)   Cancel

Your choice? i auc@1.0      - Library for computing Areas Under the Receiving Operating Charactersitics and Precision Recall curves
i bddem@4.3.1               - A library for manipulating Binary Decision Diagrams
i matrix@1.0                - Operations with matrices
Package:                cplint
Title:                  A suite of programs for reasoning with probabilistic logic programs
Installed version:      4.5.0
Author:                 Fabrizio Riguzzi <>
Download URL: *.zip
Requires:               bddem, auc, matrix
Activate pack "cplint" Y/n? 

?- use_module(library(pita)).
ERROR: /lib/swipl/pack/bddem/prolog/
	/lib/swipl/pack/bddem/prolog/ Initialization goal raised exception:
	dlopen(/lib/swipl/pack/bddem/lib/x86_64-darwin/, 1): Library not loaded: @rpath/libswipl.7.dylib
  Referenced from: /lib/swipl/pack/bddem/lib/x86_64-darwin/
  Reason: image not found

Any advice?
Thank you!

Try with

Yeah, rebuild helped. Thanks!

Dear Ielbert,

In addition to the resource/system pointed to you already, there are a number of
packages with a PLP flavour, depending if you are interested in reasoning,
parameter estimation or general machine learning.

pha- Probabilistic Horn Abduction
phil- Learning Hierarchical Probabilistic Logic Programs parameters with gradient
descent and Expectation Maximization
prism- Run PRISM as a child process
[Unfortunately this is just a harness to run Prism system. Pity it was named
Prism as it would be great to have Prism in SWI-Prolog.]
bims- Bayesian inference of model structure.
pepl- Parameter estimation for SLP with the Failure Adjusted Maximisation
pfd_meta- Probabilistic finite domains meta-interpreter

There is also a workshop on PLP, you might be interested to some of the
papers there:

Nicos Angelopoulos


@nicos, thanks for the pointers! Very relevant to my use-case.