3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-05 06:46:11 +00:00

lp: avoid per-call join allocation in explain_fixed_column (#9984)

This commit is contained in:
Lev Nachmanson 2026-06-28 08:12:52 -07:00 committed by GitHub
parent f07acb459f
commit 56bb49f8dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 2 deletions

View file

@ -234,6 +234,22 @@ public:
m_todo.reset();
}
// Linearize the union of two dependencies without allocating a join node.
void linearize(dependency * d1, dependency * d2, vector<value, false> & vs) const {
SASSERT(m_todo.empty());
if (d1) {
d1->mark();
m_todo.push_back(d1);
}
if (d2 && !d2->is_marked()) {
d2->mark();
m_todo.push_back(d2);
}
if (!m_todo.empty())
linearize_todo(m_todo, vs);
m_todo.reset();
}
void linearize(ptr_vector<dependency>& deps, vector<value, false> & vs) const {
if (deps.empty())
return;
@ -333,6 +349,10 @@ public:
return m_dep_manager.linearize(d, vs);
}
void linearize(dependency * d1, dependency * d2, vector<value, false> & vs) const {
return m_dep_manager.linearize(d1, d2, vs);
}
static vector<value, false> const& s_linearize(dependency* d, vector<value, false>& vs) {
dep_manager::s_linearize(d, vs);
return vs;