mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
start porting grobner basis functionality
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
35efdc9852
commit
36380463d7
2 changed files with 12 additions and 9 deletions
|
@ -1040,6 +1040,7 @@ namespace smt {
|
|||
enum gb_result { GB_PROGRESS, GB_NEW_EQ, GB_FAIL };
|
||||
gb_result compute_grobner(svector<theory_var> const & nl_cluster);
|
||||
bool compute_basis_loop(grobner & gb);
|
||||
void compute_basis(grobner&, bool&);
|
||||
void update_statistics(grobner&);
|
||||
void set_gb_exhausted();
|
||||
bool pass_over_gb_eqs_for_conflict(ptr_vector<grobner::equation>& eqs, grobner&);
|
||||
|
|
|
@ -2317,7 +2317,14 @@ bool theory_arith<Ext>::compute_basis_loop(grobner & gb) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
void theory_arith<Ext>::compute_basis(grobner& gb, bool& warn) {
|
||||
gb.compute_basis_init();
|
||||
if (!compute_basis_loop(gb) && !warn) {
|
||||
set_gb_exhausted();
|
||||
warn = true;
|
||||
}
|
||||
}
|
||||
/**
|
||||
\brief Compute Grobner basis, return true if a conflict or new fixed variables were detected.
|
||||
*/
|
||||
|
@ -2334,16 +2341,11 @@ typename theory_arith<Ext>::gb_result theory_arith<Ext>::compute_grobner(svector
|
|||
|
||||
do {
|
||||
TRACE("non_linear_gb", tout << "before:\n"; gb.display(tout););
|
||||
gb.compute_basis_init();
|
||||
if (!compute_basis_loop(gb) && !warn) {
|
||||
set_gb_exhausted();
|
||||
warn = true;
|
||||
}
|
||||
compute_basis(gb, warn);
|
||||
update_statistics(gb);
|
||||
if (get_context().get_cancel_flag()) {
|
||||
return GB_FAIL;
|
||||
}
|
||||
TRACE("non_linear_gb", tout << "after:\n"; gb.display(tout););
|
||||
if (get_context().get_cancel_flag())
|
||||
return GB_FAIL;
|
||||
if (pass_over_gb_eqs_for_conflict(eqs, gb))
|
||||
return GB_PROGRESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue