3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 09:55:19 +00:00
minor tweaks to gomory and reset n3 within loop (but the entire function is dead code).
This commit is contained in:
Nikolaj Bjorner 2023-11-19 09:59:44 -08:00
parent 924c296704
commit 35bc522dae
3 changed files with 12 additions and 4 deletions

View file

@ -91,7 +91,13 @@ namespace Microsoft.Z3
/// </summary> /// </summary>
~Constructor() ~Constructor()
{ {
Native.Z3_del_constructor(Context.nCtx, NativeObject); if (Context.nCtx != IntPtr.Zero) {
lock (Context)
{
if (Context.nCtx != IntPtr.Zero)
Native.Z3_del_constructor(Context.nCtx, NativeObject);
}
}
} }
#region Internal #region Internal

View file

@ -338,14 +338,14 @@ public:
for (auto const& [c, v] : pol) for (auto const& [c, v] : pol)
m_lcm_den = lcm(m_lcm_den, denominator(c)); m_lcm_den = lcm(m_lcm_den, denominator(c));
lp_assert(m_lcm_den.is_pos()); lp_assert(m_lcm_den.is_pos());
bool int_row = true; bool int_row = all_of(pol, [&](auto const& kv) { return is_int(kv.second); });
TRACE("gomory_cut_detail", tout << "pol.size() > 1 den: " << m_lcm_den << std::endl;); TRACE("gomory_cut_detail", tout << "pol.size() > 1 den: " << m_lcm_den << std::endl;);
if (!m_lcm_den.is_one()) { if (!m_lcm_den.is_one()) {
// normalize coefficients of integer parameters to be integers. // normalize coefficients of integer parameters to be integers.
for (auto & [c,v]: pol) { for (auto & [c,v]: pol) {
c *= m_lcm_den; c *= m_lcm_den;
SASSERT(!is_int(v) || c.is_int()); SASSERT(!is_int(v) || c.is_int());
int_row &= is_int(v);
} }
m_k *= m_lcm_den; m_k *= m_lcm_den;
} }

View file

@ -5658,7 +5658,9 @@ namespace polynomial {
if (!is_zero(Gh3) && d1%2 == 0) if (!is_zero(Gh3) && d1%2 == 0)
Gh3 = neg(Gh3); Gh3 = neg(Gh3);
} }
else
n3 = 0;
// Compute hi // Compute hi
if (i > 1) { if (i > 1) {
g1 = lc(G1, x); g1 = lc(G1, x);