potassco / plingo

🍀 A system for probabilistic reasoning in clingo
MIT License
15 stars 2 forks source link

Implement option for conditional query #17

Open nrueh opened 2 years ago

nrueh commented 2 years ago

Optionally queries could be conditional.

The probability of A given B, P(A | B), could be encoded as

&query(A | B) or &query(A,B).

This can be calculated by using P(A | B) = P(A and B) / P(B), thus by first determining all stable models which contain A all all models which contain B and then summing up the corresponding probabilities.