Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CODE WITH CIRCULARITY #115

Closed
Mezzenilium opened this issue May 4, 2024 · 2 comments
Closed

CODE WITH CIRCULARITY #115

Mezzenilium opened this issue May 4, 2024 · 2 comments

Comments

@Mezzenilium
Copy link

I find it hard to understand how Problog2 manages to calculate this code where there is circularity between the predicates rain and snow.

0.4::rain.
0.1::snow.

0.2::rain :- snow.
0.1::snow :- rain.

precipitation :- rain.
precipitation :- snow.

melt :- rain, snow.

query(precipitation).
query(melt).
query(rain).
query(snow).

@rmanhaeve
Copy link
Contributor

rmanhaeve commented May 6, 2024

Hi

ProbLog has cycle breaking to unroll cyclically defined rules. Here, it is first good to see that only the cyclical rules by themselves do not actually cause rain or snow to be true. If you comment out the first two lines, all query probabilities become 0.

The program you've given is equivalent to

0.4::rain_fact.
0.1::snow_fact.

rain :- rain_fact.
0.2::rain :- snow_fact.

snow :- snow_fact.
0.1::snow :- rain_fact.

precipitation :- rain.
precipitation :- snow.

melt :- rain, snow.

query(precipitation).
query(melt).
query(rain).
query(snow).

Which is acyclical.

@Mezzenilium
Copy link
Author

Mezzenilium commented May 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants