mirror of
https://github.com/Z3Prover/z3
synced 2025-04-27 19:05:51 +00:00
prepare for throttling gcd test and patching based on cost/success ratio
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
4f3fbd3c11
commit
11199619a5
6 changed files with 153 additions and 72 deletions
|
@ -22,15 +22,33 @@ Revision History:
|
|||
|
||||
namespace lp {
|
||||
|
||||
int_gcd_test::int_gcd_test(int_solver& lia): lia(lia), lra(lia.lra) {}
|
||||
int_gcd_test::int_gcd_test(int_solver& lia): lia(lia), lra(lia.lra), m_next_gcd(0), m_delay(0) {}
|
||||
|
||||
bool int_gcd_test::should_apply() {
|
||||
|
||||
if (!lia.settings().m_int_run_gcd_test)
|
||||
return false;
|
||||
#if 1
|
||||
return true;
|
||||
#else
|
||||
if (m_delay == 0) {
|
||||
return true;
|
||||
}
|
||||
--m_delay;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
lia_move int_gcd_test::operator()() {
|
||||
lia.settings().stats().m_gcd_calls++;
|
||||
TRACE("int_solver", tout << "gcd-test " << lia.settings().stats().m_gcd_calls << "\n";);
|
||||
if (gcd_test()) {
|
||||
m_delay = m_next_gcd++;
|
||||
return lia_move::undef;
|
||||
}
|
||||
else {
|
||||
m_next_gcd = 0;
|
||||
m_delay = 0;
|
||||
lia.settings().stats().m_gcd_conflicts++;
|
||||
TRACE("gcd_test", tout << "gcd conflict\n";);
|
||||
return lia_move::conflict;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue