3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 09:05:31 +00:00

add fd solver for finite domain queries

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-10-18 22:34:34 -04:00
parent 948a1e600e
commit d060359f01
16 changed files with 676 additions and 204 deletions

View file

@ -3135,6 +3135,7 @@ namespace sat {
if (is_sat != l_true) {
return is_sat;
}
model mdl = get_model();
for (unsigned i = 0; i < vars.size(); ++i) {
bool_var v = vars[i];
switch (get_model()[v]) {
@ -3143,7 +3144,9 @@ namespace sat {
default: break;
}
}
return get_consequences(asms, lits, conseq);
is_sat = get_consequences(asms, lits, conseq);
set_model(mdl);
return is_sat;
}
lbool solver::get_consequences(literal_vector const& asms, literal_vector const& lits, vector<literal_vector>& conseq) {
@ -3164,13 +3167,11 @@ namespace sat {
while (!unfixed.empty()) {
checkpoint();
literal_set::iterator it = unfixed.begin(), end = unfixed.end();
unsigned chunk_size = 100;
for (; it != end && chunk_size > 0; ++it) {
for (; it != end; ++it) {
literal lit = *it;
if (value(lit) != l_undef) {
continue;
}
--chunk_size;
push();
assign(~lit, justification());
propagate(false);

View file

@ -580,7 +580,7 @@ private:
}
void extract_model() {
TRACE("sat", tout << "retrieve model\n";);
TRACE("sat", tout << "retrieve model " << (m_solver.model_is_current()?"present":"absent") << "\n";);
if (!m_solver.model_is_current()) {
m_model = 0;
return;