3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00
* arrays

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

* arrays

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

* na

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

* arrays

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

* na

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

* fill

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

* update drat and fix euf bugs

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

* na

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

* na

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

* na

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

* const qualifiers

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

* na

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

* reorg ba

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

* reorg

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

* build warnings

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-09-13 19:29:59 -07:00 committed by GitHub
parent d56dd1db7b
commit 796e2fd9eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 2571 additions and 1850 deletions

View file

@ -97,7 +97,7 @@ public:
// command invocation
void set_line_pos(int line, int pos) { m_line = line; m_pos = pos; }
virtual void prepare(cmd_context & ctx) {}
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { UNREACHABLE(); return CPK_UINT; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { UNREACHABLE(); return cmd_arg_kind::CPK_UINT; }
virtual void set_next_arg(cmd_context & ctx, unsigned val) { UNREACHABLE(); }
virtual void set_next_arg(cmd_context & ctx, bool val) { UNREACHABLE(); }
virtual void set_next_arg(cmd_context & ctx, rational const & val) { UNREACHABLE(); }

View file

@ -29,7 +29,7 @@ struct sexpr_composite : public sexpr {
unsigned m_num_chilren;
sexpr * m_children[0];
sexpr_composite(unsigned num_children, sexpr * const * children, unsigned line, unsigned pos):
sexpr(COMPOSITE, line, pos),
sexpr(kind_t::COMPOSITE, line, pos),
m_num_chilren(num_children) {
for (unsigned i = 0; i < num_children; i++) {
m_children[i] = children[i];
@ -45,7 +45,7 @@ struct sexpr_numeral : public sexpr {
m_val(val) {
}
sexpr_numeral(rational const & val, unsigned line, unsigned pos):
sexpr(NUMERAL, line, pos),
sexpr(kind_t::NUMERAL, line, pos),
m_val(val) {
}
};
@ -53,7 +53,7 @@ struct sexpr_numeral : public sexpr {
struct sexpr_bv : public sexpr_numeral {
unsigned m_size;
sexpr_bv(rational const & val, unsigned size, unsigned line, unsigned pos):
sexpr_numeral(BV_NUMERAL, val, line, pos),
sexpr_numeral(kind_t::BV_NUMERAL, val, line, pos),
m_size(size) {
}
};
@ -61,11 +61,11 @@ struct sexpr_bv : public sexpr_numeral {
struct sexpr_string : public sexpr {
std::string m_val;
sexpr_string(std::string const & val, unsigned line, unsigned pos):
sexpr(STRING, line, pos),
sexpr(kind_t::STRING, line, pos),
m_val(val) {
}
sexpr_string(char const * val, unsigned line, unsigned pos):
sexpr(STRING, line, pos),
sexpr(kind_t::STRING, line, pos),
m_val(val) {
}
};
@ -73,7 +73,7 @@ struct sexpr_string : public sexpr {
struct sexpr_symbol : public sexpr {
symbol m_val;
sexpr_symbol(bool keyword, symbol const & val, unsigned line, unsigned pos):
sexpr(keyword ? KEYWORD : SYMBOL, line, pos),
sexpr(keyword ? kind_t::KEYWORD : kind_t::SYMBOL, line, pos),
m_val(val) {
}
};
@ -122,12 +122,12 @@ sexpr * const * sexpr::get_children() const {
void sexpr::display_atom(std::ostream & out) const {
switch (get_kind()) {
case sexpr::COMPOSITE:
case sexpr::kind_t::COMPOSITE:
UNREACHABLE();
case sexpr::NUMERAL:
case sexpr::kind_t::NUMERAL:
out << static_cast<sexpr_numeral const *>(this)->m_val;
break;
case sexpr::BV_NUMERAL: {
case sexpr::kind_t::BV_NUMERAL: {
out << '#';
unsigned bv_size = static_cast<sexpr_bv const *>(this)->m_size;
rational val = static_cast<sexpr_bv const *>(this)->m_val;
@ -172,11 +172,11 @@ void sexpr::display_atom(std::ostream & out) const {
out << buf.c_ptr();
break;
}
case sexpr::STRING:
case sexpr::kind_t::STRING:
out << "\"" << escaped(static_cast<sexpr_string const *>(this)->m_val.c_str()) << "\"";
break;
case sexpr::SYMBOL:
case sexpr::KEYWORD:
case sexpr::kind_t::SYMBOL:
case sexpr::kind_t::KEYWORD:
out << static_cast<sexpr_symbol const *>(this)->m_val;
break;
default:
@ -220,7 +220,7 @@ void sexpr_manager::del(sexpr * n) {
sexpr * n = m_to_delete.back();
m_to_delete.pop_back();
switch (n->get_kind()) {
case sexpr::COMPOSITE: {
case sexpr::kind_t::COMPOSITE: {
unsigned num = n->get_num_children();
for (unsigned i = 0; i < num; i++) {
sexpr * child = n->get_child(i);
@ -233,20 +233,20 @@ void sexpr_manager::del(sexpr * n) {
m_allocator.deallocate(sizeof(sexpr_composite) + num * sizeof(sexpr*), n);
break;
}
case sexpr::NUMERAL:
case sexpr::kind_t::NUMERAL:
static_cast<sexpr_numeral*>(n)->~sexpr_numeral();
m_allocator.deallocate(sizeof(sexpr_numeral), n);
break;
case sexpr::BV_NUMERAL:
case sexpr::kind_t::BV_NUMERAL:
static_cast<sexpr_bv*>(n)->~sexpr_bv();
m_allocator.deallocate(sizeof(sexpr_bv), n);
break;
case sexpr::STRING:
case sexpr::kind_t::STRING:
static_cast<sexpr_string*>(n)->~sexpr_string();
m_allocator.deallocate(sizeof(sexpr_string), n);
break;
case sexpr::SYMBOL:
case sexpr::KEYWORD:
case sexpr::kind_t::SYMBOL:
case sexpr::kind_t::KEYWORD:
static_cast<sexpr_symbol*>(n)->~sexpr_symbol();
m_allocator.deallocate(sizeof(sexpr_symbol), n);
break;

View file

@ -27,7 +27,7 @@ class sexpr_manager;
class sexpr {
public:
enum kind_t {
enum class kind_t {
COMPOSITE, NUMERAL, BV_NUMERAL, STRING, KEYWORD, SYMBOL
};
protected:
@ -44,12 +44,12 @@ public:
unsigned get_line() const { return m_line; }
unsigned get_pos() const { return m_pos; }
kind_t get_kind() const { return m_kind; }
bool is_composite() const { return get_kind() == COMPOSITE; }
bool is_numeral() const { return get_kind() == NUMERAL; }
bool is_bv_numeral() const { return get_kind() == BV_NUMERAL; }
bool is_string() const { return get_kind() == STRING; }
bool is_keyword() const { return get_kind() == KEYWORD; }
bool is_symbol() const { return get_kind() == SYMBOL; }
bool is_composite() const { return get_kind() == kind_t::COMPOSITE; }
bool is_numeral() const { return get_kind() == kind_t::NUMERAL; }
bool is_bv_numeral() const { return get_kind() == kind_t::BV_NUMERAL; }
bool is_string() const { return get_kind() == kind_t::STRING; }
bool is_keyword() const { return get_kind() == kind_t::KEYWORD; }
bool is_symbol() const { return get_kind() == kind_t::SYMBOL; }
rational const & get_numeral() const;
unsigned get_bv_size() const;
symbol get_symbol() const;