dreal / dreal4

Automated Reasoning in Nonlinear Theories of Reals
https://dreal.github.io
Apache License 2.0
150 stars 31 forks source link

Formula should not be satisfiable #305

Closed juliusbrehme closed 1 year ago

juliusbrehme commented 1 year ago

Hello everyone,

Consider the following Code:

Box *box = new Box();
Variable x1{"x1", Variable::Type::INTEGER};
Variable x2{"x2", Variable::Type::INTEGER};

Formula f{(x1 != x2) && (x1 < 1) && (x2 < 1) && (0 <= x1) && (0 <= x2)};

bool result = CheckSatisfiability(f, 0.001, box);

The result should be false, because the formula f is not satisfiable, but the result is true. If I print the result from the box, I get the following:

x1 : [0, 0]
x2 : [0, 0]

But this should not be an appropriate result.

Maybe the Issue #304 has something to do with the result as well.

Thank you in advance.

soonhokong commented 1 year ago
Formula f{(x1 != x2) && (x1 < 1) && (x2 < 1) && (0 <= x1) && (0 <= x2)};

Let me rewrite this formula using a list of conjuncts:

The first conjunct x1 != x2 can be rewritten into (x1 > x2) or (x1 < x2) so we have:

I'd like to show you that the found model (x1, x2) = (0.0, 0.0) is a solution to the delta-weakening of the original problem. FYI, here is the delta-weakening of the original problem where delta is 0.001.

When x1, x2 = 0.0, 0.0, we have:

You can check that all of these conjuncts are true. So this is a delta-sat solution.

soonhokong commented 1 year ago

Reference:

Delta-Decidability over the Reals [arXiv] Sicun Gao, Jeremy Avigad, and Edmund Clarke LICS (Logic in Computer Science) 2012