Do you know a tool I could use to compare constraints (not only mathematical)? It’s easier to explain with examples:
A) Simple example
C1: x < 0 && y * y < x
C2: x < 0 && y * y < x - 1
I want to know if C2 is stronger then C1, and it is. That means, (x,y) of C2 are also in C1.
B) Complicated example
C1: x > 0 && y > 0
C2: x > 0
C2 is weaker then C1 because it doesn’t contain constraints on y.
I can try to write something by hand, but I don’t think this is a solution. I know that the problem of solving constraints is undecidable, but I would like to know what work has been done in this direction.
Thanks,
Are you trying to decide if a constraint C1 subsumes C2 (meaning that it is not possible to find a set of values that satisfy C1 and not satisfy C2 -> C2 is true in all scenarios in which C1 is true but maybe not the other way around)?. When C1 subsumes C2 then C2 can be removed since it does not add any semantics to the problem.
If this is the case, I´d recommend you to use a CSP solver for that. It is easier than it seems. For instance, the Eclipse CSP solver (here Eclipse does not referes to the IDE platform, the solver has the same name) can be easily called from your java program through a well-defined API so you could just sent the problem to the solver and see which constraint is weaker