mirror of
https://github.com/Z3Prover/z3
synced 2025-07-19 10:52:02 +00:00
add local search parameters and co-processor mode
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
31c68b6e23
commit
fb4f6d654a
7 changed files with 33 additions and 5 deletions
|
@ -139,6 +139,8 @@ namespace sat {
|
|||
}
|
||||
}
|
||||
limit = m_units.size();
|
||||
|
||||
_get_phase(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,6 +233,12 @@ namespace sat {
|
|||
void parallel::get_phase(solver& s) {
|
||||
#pragma omp critical (par_solver)
|
||||
{
|
||||
_get_phase(s);
|
||||
}
|
||||
}
|
||||
|
||||
void parallel::_get_phase(solver& s) {
|
||||
if (!m_phase.empty()) {
|
||||
m_phase.reserve(s.num_vars(), 0);
|
||||
for (unsigned i = 0; i < s.num_vars(); ++i) {
|
||||
if (m_phase[i] < 0) {
|
||||
|
@ -243,7 +251,7 @@ namespace sat {
|
|||
}
|
||||
}
|
||||
|
||||
void parallel::get_phase(local_search& s) {
|
||||
void parallel::set_phase(local_search& s) {
|
||||
#pragma omp critical (par_solver)
|
||||
{
|
||||
m_phase.reserve(s.num_vars(), 0);
|
||||
|
@ -258,6 +266,16 @@ namespace sat {
|
|||
}
|
||||
}
|
||||
|
||||
void parallel::get_phase(local_search& s) {
|
||||
#pragma omp critical (par_solver)
|
||||
{
|
||||
m_phase.reserve(s.num_vars(), 0);
|
||||
for (unsigned i = 0; i < s.num_vars(); ++i) {
|
||||
m_phase[i] += (s.get_phase(i) ? 1 : -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue