ML-KULeuven / problog

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

Apparent problem with subquery/3 #102

Open theresasturn opened 1 year ago

theresasturn commented 1 year ago

Hi

I'm trying to write a problog program in which I can repeatedly reset evidence/2 facts so that I can compute probabilities under differing sets of evidence. In addition, I'd like to use subquery/3 so that I can obtain the probability of a query from within the Prolog level.

I've distilled my program into a small example. If you run it, you'll see that the result for l1 via subquery is different than via query; i.e., it writes out:

l1(0.004232) iterate1: 1 l1: 0

It would appear that within subquery, evidence is not considered true or false? subquery_issue.txt

VincentDerk commented 1 year ago

The list of evidence in subquery should be as follows:

iterate1:-
    subquery(l1,Prob,
         [\+known(nothing), known(in_city)]),
    writeln(l1(Prob)).
theresasturn commented 1 year ago

Thanks. subquery/3 is potentially a very useful predicate, but I didn't see much documentation about it. (I know how much time documentation can take up.)

On Fri, 19 May 2023 at 04:17, Vincent @.***> wrote:

The list of evidence in subquery should be as follows:

iterate1:- subquery(l1,Prob, [+known(nothing), known(in_city)]), writeln(l1(Prob)).

— Reply to this email directly, view it on GitHub https://github.com/ML-KULeuven/problog/issues/102#issuecomment-1554214729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKZNEYKDTWPXZVQNCDTDD4TXG4UBXANCNFSM6AAAAAAYG6OZPA . You are receiving this because you authored the thread.Message ID: @.***>