mirror of
https://github.com/Z3Prover/z3
synced 2025-04-07 18:05:21 +00:00
use iterators, update build icon for osx
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
c66ec9d3f6
commit
031d7e1b59
|
@ -14,7 +14,7 @@ See the [release notes](RELEASE_NOTES) for notes on various stable releases of Z
|
|||
|
||||
| Windows x86 | Windows x64 | Ubuntu x64 | Ubuntu x86 | Debian x64 | OSX | TravisCI |
|
||||
| ----------- | ----------- | ---------- | ---------- | ---------- | --- | -------- |
|
||||
 |  |  |  |  |  | [](https://travis-ci.org/Z3Prover/z3)
|
||||
 |  |  |  |  |  | [](https://travis-ci.org/Z3Prover/z3)
|
||||
|
||||
[1]: #building-z3-on-windows-using-visual-studio-command-prompt
|
||||
[2]: #building-z3-using-make-and-gccclang
|
||||
|
|
|
@ -2246,10 +2246,7 @@ bool theory_seq::internalize_term(app* term) {
|
|||
return true;
|
||||
}
|
||||
TRACE("seq_verbose", tout << mk_pp(term, m) << "\n";);
|
||||
unsigned num_args = term->get_num_args();
|
||||
expr* arg;
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
arg = term->get_arg(i);
|
||||
for (expr* arg : *term) {
|
||||
mk_var(ensure_enode(arg));
|
||||
}
|
||||
if (m.is_bool(term)) {
|
||||
|
@ -2602,9 +2599,9 @@ void theory_seq::collect_statistics(::statistics & st) const {
|
|||
|
||||
void theory_seq::init_model(expr_ref_vector const& es) {
|
||||
expr_ref new_s(m);
|
||||
for (unsigned i = 0; i < es.size(); ++i) {
|
||||
for (expr* e : es) {
|
||||
dependency* eqs = 0;
|
||||
expr_ref s = canonize(es[i], eqs);
|
||||
expr_ref s = canonize(e, eqs);
|
||||
if (is_var(s)) {
|
||||
new_s = m_factory->get_fresh_value(m.get_sort(s));
|
||||
m_rep.update(s, new_s, eqs);
|
||||
|
@ -2615,13 +2612,11 @@ void theory_seq::init_model(expr_ref_vector const& es) {
|
|||
void theory_seq::init_model(model_generator & mg) {
|
||||
m_factory = alloc(seq_factory, get_manager(), get_family_id(), mg.get_model());
|
||||
mg.register_factory(m_factory);
|
||||
for (unsigned j = 0; j < m_nqs.size(); ++j) {
|
||||
ne const& n = m_nqs[j];
|
||||
for (ne const& n : m_nqs) {
|
||||
m_factory->register_value(n.l());
|
||||
m_factory->register_value(n.r());
|
||||
}
|
||||
for (unsigned j = 0; j < m_nqs.size(); ++j) {
|
||||
ne const& n = m_nqs[j];
|
||||
for (ne const& n : m_nqs) {
|
||||
for (unsigned i = 0; i < n.ls().size(); ++i) {
|
||||
init_model(n.ls(i));
|
||||
init_model(n.rs(i));
|
||||
|
|
|
@ -91,6 +91,31 @@ public:
|
|||
SASSERT(invariant());
|
||||
}
|
||||
|
||||
class iterator {
|
||||
scoped_vector const& m_vec;
|
||||
unsigned m_index;
|
||||
public:
|
||||
iterator(scoped_vector const& v, unsigned idx): m_vec(v), m_index(idx) {}
|
||||
|
||||
bool operator==(iterator const& other) const { return &other.m_vec == &m_vec && other.m_index == m_index; }
|
||||
bool operator!=(iterator const& other) const { return &other.m_vec != &m_vec || other.m_index != m_index; }
|
||||
T const& operator*() { return m_vec[m_index]; }
|
||||
|
||||
iterator & operator++() {
|
||||
++m_index;
|
||||
return *this;
|
||||
}
|
||||
|
||||
iterator operator++(int) {
|
||||
iterator r = *this;
|
||||
++m_index;
|
||||
return r;
|
||||
}
|
||||
};
|
||||
|
||||
iterator begin() { return iterator(*this, 0); }
|
||||
iterator end() { return iterator(*this, m_size); }
|
||||
|
||||
void push_back(T const& t) {
|
||||
set_index(m_size, m_elems.size());
|
||||
m_elems.push_back(t);
|
||||
|
|
Loading…
Reference in a new issue