Support for Defeasible Logic and Constraints with Probabilities
- We added support for special constraints that can be violated with certain probablilties. It allows JSR-331 users such as Business Rules vendors to add defeasible logic to their products. Read, for example, how it’s done at OpenRules.
- We introduced a concept “Probability”(enum) with the following standard values:
- A new Constraint’s method public void post(String name, Probability probability) is used to post a constraint assuming that it can be violated. The parameter probability defines a probability that this constraint will not be violated. If it’s ALWAYS this is the same as a regular constraint posting. If it’s NEVER, the posting of this constraint will fail producing a RuntimeException. All other values allow the constraint to be violated with certain penalties. For instance, probability LOW invokes higher penalty to compare with probability HIGH, but a lower penalty to compare with VERY_LOW.
- The new Problem’s method getTotalConstraintViolation() returns a variable that could be minimized to find a solution that may all synchronize all relative constraint violations. Thus, posting related constraints with different probabilities may resolve their conflicts.