mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 11:55:51 +00:00
Small polysat fixes (#5183)
* Add some display functions * Add new variables to free vars
This commit is contained in:
parent
3730a0373d
commit
8a260d89cd
4 changed files with 48 additions and 0 deletions
|
@ -2,6 +2,7 @@ z3_add_component(polysat
|
|||
SOURCES
|
||||
solver.cpp
|
||||
constraint.cpp
|
||||
justification.cpp
|
||||
COMPONENT_DEPENDENCIES
|
||||
util
|
||||
dd
|
||||
|
|
29
src/math/polysat/justification.cpp
Normal file
29
src/math/polysat/justification.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*++
|
||||
Copyright (c) 2021 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
polysat justification
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2021-03-19
|
||||
|
||||
--*/
|
||||
|
||||
#include "math/polysat/justification.h"
|
||||
|
||||
namespace polysat {
|
||||
|
||||
std::ostream& justification::display(std::ostream& out) const {
|
||||
switch (kind()) {
|
||||
case justification_k::unassigned:
|
||||
return out << "unassigned";
|
||||
case justification_k::decision:
|
||||
return out << "decision (level " << level() << ")";
|
||||
case justification_k::propagation:
|
||||
return out << "propagation (level " << level() << ")";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -100,6 +100,7 @@ namespace polysat {
|
|||
m_vars.push_back(sz2pdd(sz).mk_var(v));
|
||||
m_size.push_back(sz);
|
||||
m_trail.push(t_del_var(*this));
|
||||
m_free_vars.mk_var_eh(v);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
@ -115,6 +116,7 @@ namespace polysat {
|
|||
m_activity.pop_back();
|
||||
m_vars.pop_back();
|
||||
m_size.pop_back();
|
||||
m_free_vars.del_var_eh(v);
|
||||
}
|
||||
|
||||
void solver::add_eq(pdd const& p, unsigned dep) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue