3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 13:28:47 +00:00

starting the horner heuristic

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-06-27 15:07:43 -07:00
parent f84a06b4c5
commit 8670e09269
2 changed files with 16 additions and 3 deletions

View file

@ -25,7 +25,17 @@ namespace nla {
horner::horner(core * c) : common(c) {}
void horner::lemma_on_row(const lp::row_strip<rational>&) {}
template <typename T>
bool horner::row_is_interesting(const T&) const {
return true;
}
template <typename T>
void horner::lemma_on_row(const T& row) {
if (!row_is_interesting(row))
return;
SASSERT(false);
}
void horner::horner_lemmas() {
if (!c().m_settings.run_horner()) {
@ -37,7 +47,7 @@ void horner::horner_lemmas() {
unsigned r = random();
unsigned s = m.row_count();
for (unsigned i = 0; i < s && !done(); i++) {
lemma_on_row(m.m_rows[(i%s)]);
lemma_on_row(m.m_rows[((i + r) %s)]);
}
SASSERT(false);

View file

@ -29,7 +29,10 @@ class horner : common {
public:
horner(core *core);
void horner_lemmas();
void lemma_on_row(const lp::row_strip<rational>&);
template <typename T> // T has an iterator of (coeff(), var())
void lemma_on_row(const T&);
template <typename T>
bool row_is_interesting(const T&) const;
private:
}; // end of horner
}