mirror of
https://github.com/Z3Prover/z3
synced 2025-07-04 03:45:41 +00:00
starting the horner heuristic
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
f84a06b4c5
commit
8670e09269
2 changed files with 16 additions and 3 deletions
|
@ -25,7 +25,17 @@ namespace nla {
|
||||||
|
|
||||||
horner::horner(core * c) : common(c) {}
|
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() {
|
void horner::horner_lemmas() {
|
||||||
if (!c().m_settings.run_horner()) {
|
if (!c().m_settings.run_horner()) {
|
||||||
|
@ -37,7 +47,7 @@ void horner::horner_lemmas() {
|
||||||
unsigned r = random();
|
unsigned r = random();
|
||||||
unsigned s = m.row_count();
|
unsigned s = m.row_count();
|
||||||
for (unsigned i = 0; i < s && !done(); i++) {
|
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);
|
SASSERT(false);
|
||||||
|
|
|
@ -29,7 +29,10 @@ class horner : common {
|
||||||
public:
|
public:
|
||||||
horner(core *core);
|
horner(core *core);
|
||||||
void horner_lemmas();
|
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:
|
private:
|
||||||
}; // end of horner
|
}; // end of horner
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue