ML-KULeuven / problog

ProbLog is a Probabilistic Logic Programming Language for logic programs with probabilities.
https://dtai.cs.kuleuven.be/problog/
298 stars 34 forks source link

Identifying which clauses are triggered when running the inference engine #59

Closed Sidney2408 closed 3 years ago

Sidney2408 commented 3 years ago

Hi there,

let's say I have defined a clause like this:

""" is_blocked(T,X):- contains(T, X, I), size(T, I, S1), size(T, X, S2), morethan(, S1,S2). """

does Problog have any functionality that allows me to identify if this clause evaluates to true and if it evaluates to false, can the engine flag which predicates in the if clause evaluates to false?

rmanhaeve commented 3 years ago

Hi Sidney

The functionality you describe sound to me like it's just inference. So you'd query the probability of is_blocked(T,X) being true. I don't know if the engine can flag at which point the clause failed, but you could modify the program to provide this information perhaps.

Since this is not really an issue, I'm closing it for now. If you have further questions, feel free to mail me (my e-mail address is visible in my profile).

Kind regards, Robin

krishnangovindraj commented 3 years ago

Running problog --trace filename.pl will give you a trace (of every step, so it can be long).

if you look for lines starting with 'fail' (with some indentation before it), it should tell you which predicates are failing. It might be helpful to start at the last fail in a block of fails and work your way upwards.