3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-25 01:55:32 +00:00

updates to seq and bug fixes (#4056)

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix #4037

* nicer output for skolem functions

* more overhaul of seq, some bug fixes

* na

* added offset_eq file

* na

* fix #4044

* fix #4040

* fix #4045

* updated ignore

* new rewrites for indexof based on #4036

* add shortcuts

* updated ne solver for seq, fix #4025

* use pair vectors for equalities that are reduced by seq_rewriter

* use erase_and_swap

* remove unit-walk

* na

* add check for #3200

* nits

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* name a type

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* remove fp check

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* remove unsound axiom instantiation for non-contains

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix rewrites

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix #4053

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix #4052

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-04-22 13:18:55 -07:00 committed by GitHub
parent 53c14bd554
commit 95a78b2450
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1516 additions and 1654 deletions

View file

@ -140,6 +140,7 @@ namespace simplex {
bool well_formed_row(unsigned row_id) const;
bool well_formed_column(unsigned column_id) const;
void del_row_entry(_row& r, unsigned pos);
void reset_rows();
public:

View file

@ -40,8 +40,8 @@ namespace simplex {
template<typename Ext>
void sparse_matrix<Ext>::_row::reset(manager& m) {
for (unsigned i = 0; i < m_entries.size(); ++i) {
m.reset(m_entries[i].m_coeff);
for (auto & e : m_entries) {
m.reset(e.m_coeff);
}
m_entries.reset();
m_size = 0;
@ -135,25 +135,25 @@ namespace simplex {
*/
template<typename Ext>
inline void sparse_matrix<Ext>::_row::save_var_pos(svector<int> & result_map, unsigned_vector& idxs) const {
typename vector<_row_entry>::const_iterator it = m_entries.begin();
typename vector<_row_entry>::const_iterator end = m_entries.end();
unsigned idx = 0;
for (; it != end; ++it, ++idx) {
if (!it->is_dead()) {
result_map[it->m_var] = idx;
idxs.push_back(it->m_var);
for (auto const& e : m_entries) {
if (!e.is_dead()) {
result_map[e.m_var] = idx;
idxs.push_back(e.m_var);
}
++idx;
}
}
template<typename Ext>
int sparse_matrix<Ext>::_row::get_idx_of(var_t v) const {
typename vector<_row_entry>::const_iterator it = m_entries.begin();
typename vector<_row_entry>::const_iterator end = m_entries.end();
for (unsigned idx = 0; it != end; ++it, ++idx) {
if (!it->is_dead() && it->m_var == v)
unsigned idx = 0;
for (auto const& e : m_entries) {
if (!e.is_dead() && e.m_var == v)
return idx;
++idx;
}
return -1;
}
@ -205,32 +205,12 @@ namespace simplex {
}
}
#if 0
/**
\brief Special version of compress, that is used when the column contain
only one entry located at position singleton_pos.
*/
template<typename Ext>
void sparse_matrix<Ext>::column::compress_singleton(vector<_row> & rows, unsigned singleton_pos) {
SASSERT(m_size == 1);
if (singleton_pos != 0) {
col_entry & s = m_entries[singleton_pos];
m_entries[0] = s;
row & r = rows[s.m_row_id];
r[s.m_row_idx].m_col_idx = 0;
}
m_first_free_idx = -1;
m_entries.shrink(1);
}
#endif
template<typename Ext>
const typename sparse_matrix<Ext>::col_entry *
sparse_matrix<Ext>::column::get_first_col_entry() const {
typename svector<col_entry>::const_iterator it = m_entries.begin();
typename svector<col_entry>::const_iterator end = m_entries.end();
for (; it != end; ++it) {
if (!it->is_dead()) {
return it;
for (auto const& e : m_entries) {
if (!e.is_dead()) {
return &e;
}
}
return nullptr;
@ -272,16 +252,21 @@ namespace simplex {
template<typename Ext>
sparse_matrix<Ext>::~sparse_matrix() {
for (unsigned i = 0; i < m_rows.size(); ++i) {
_row& r = m_rows[i];
for (unsigned j = 0; j < r.m_entries.size(); ++j) {
m.reset(r.m_entries[j].m_coeff);
reset_rows();
}
template<typename Ext>
void sparse_matrix<Ext>::reset_rows() {
for (auto& r : m_rows) {
for (auto& e : r.m_entries) {
m.reset(e.m_coeff);
}
}
}
template<typename Ext>
void sparse_matrix<Ext>::reset() {
reset_rows();
m_rows.reset();
m_dead_rows.reset();
m_columns.reset();