ML-KULeuven / problog

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

Are constraints now supported in Problog? #110

Closed deepalikholkar closed 5 months ago

deepalikholkar commented 8 months ago

Saw the class Constraint defined in the Problog 2.2 documentation. Has support for this been added..

rmanhaeve commented 8 months ago

These can be used for adding propositional constraints programmatically, but it is not a feature that should be used directly. Depending on what type of constraint you want, you could use evidence to encode it.

deepalikholkar commented 8 months ago

Thank you for your response! Actually we wanted to encode constraints not on ground facts but as conditions that should not evaluate to true such as headless rules in ASP. We have now encoded them as Problog rules and throw an error when the rule evaluates to true.

deepalikholkar commented 8 months ago

We have been experimenting with DeepProblog for the past few months and it's truly awesome work - the concept and mechanism of using rules to compute and feed back gradients into the neural net

rmanhaeve commented 8 months ago

Hi.

If your rules can be encoded as ProbLog rules you can try the following:

constraint :- ....
constraint :- ....

evidence(constraint, false).

Does this help?

deepalikholkar commented 5 months ago

Hi.

If your rules can be encoded as ProbLog rules you can try the following:

constraint :- ....
constraint :- ....

evidence(constraint, false).

Does this help?

Thanks very much for your response. This should help! Will try it out