Skip to content

Commit 99e1c5f

Browse files
Enforce solver state preconditions in l_get() and is_in_conflict()
l_get() now requires the solver to be in the SAT state, and is_in_conflict() requires the UNSAT state. This enforces the state machine contract documented in propt. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
1 parent dce6d80 commit 99e1c5f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/solvers/sat/satcheck_cadical.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Author: Michael Tautschnig
1919

2020
tvt satcheck_cadical_baset::l_get(literalt a) const
2121
{
22+
PRECONDITION(solver_state == propt::statust::SAT);
2223
if(a.is_constant())
2324
return tvt(a.sign());
2425

@@ -195,6 +196,8 @@ satcheck_cadical_baset::~satcheck_cadical_baset()
195196

196197
bool satcheck_cadical_baset::is_in_conflict(literalt a) const
197198
{
199+
PRECONDITION(solver_state == propt::statust::UNSAT);
200+
PRECONDITION(!a.is_constant());
198201
return solver->failed(a.dimacs());
199202
}
200203

0 commit comments

Comments
 (0)