You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As noticed in #1023, the SAT solver environment is unsat after the optimization. Consider the simplified example:
let env =SAT.empty ()inSAT.declare env x;
SAT.assume env (x <=10);
SAT.maximize env x;
SAT.check_sat (); (* A *)SAT.assume env (x <=10); (* B *)SAT.check_sat ();
After A, the environment of the SAT solver is unsat because it contains both the clause x <= 10 and x > 10 at the decision
level 0. We expect that the last assume raises an exception. As explained in PR #1291, the is_unsat field of the SatML environment is true after A, but no Unsat exception is raised at B!
Now replace the command B by SAT.assume env (x + x <= x + 10). Then B raises Unsat as expected.
The issue comes from the wrapper of SatML.assume in Satml_frontend. As the formula x <= 10 is already in the gamma set, Satml_frontend does not send twice the formula to SatML but it doesn't check the status of the SatML environment too:
[@ocaml.ppwarning "TODO: should be assert failure?"]
|Someff ->
ifSAT.exists_in_lazy_cnf env.satml ff then acc
else
{acc with
activate =FF.Set.add ff acc.activate;
updated =true}
I believe that checking the status of SatML at the beginning of SAT.assume and SAT.check_sat is the correct fix, but I would like to get a second opinion.
Note: CDCL is also affected.
The text was updated successfully, but these errors were encountered:
As explained in the issue OCamlPro#1293,
Satml_frontend does not send to SatML a formula already present in its
lazy cnf. In particular, `assume` and `unsat` of `Satml_frontend` can
answer `unknown` for obviously unsat environment. After this commit, we
always check the status of SatML in `assume` and `unsat`.
If the solver is already unsat, the command `unsat` should return the
unsat core. As SatML does not yet support this feature, I returned an
empty explanation.
As noticed in #1023, the SAT solver environment is unsat after the optimization. Consider the simplified example:
After
A
, the environment of the SAT solver is unsat because it contains both the clausex <= 10
andx > 10
at the decisionlevel 0. We expect that the last
assume
raises an exception. As explained in PR #1291, theis_unsat
field of the SatML environment istrue
afterA
, but noUnsat
exception is raised atB
!Now replace the command
B
bySAT.assume env (x + x <= x + 10)
. ThenB
raisesUnsat
as expected.The issue comes from the wrapper of
SatML.assume
inSatml_frontend
. As the formulax <= 10
is already in thegamma
set,Satml_frontend
does not send twice the formula toSatML
but it doesn't check the status of the SatML environment too:alt-ergo/src/lib/reasoners/satml_frontend.ml
Lines 763 to 773 in 837293e
I believe that checking the status of SatML at the beginning of
SAT.assume
andSAT.check_sat
is the correct fix, but I would like to get a second opinion.Note:
CDCL
is also affected.The text was updated successfully, but these errors were encountered: