3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-26 04:56:03 +00:00

add colors

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2021-07-15 00:03:56 +02:00
commit 4c6e2acd45
56 changed files with 419 additions and 195 deletions

View file

@ -559,10 +559,11 @@ unsigned get_node_hash(ast const * n) {
return to_sort(n)->get_name().hash();
else
return combine_hash(to_sort(n)->get_name().hash(), to_sort(n)->get_info()->hash());
case AST_FUNC_DECL:
case AST_FUNC_DECL: {
unsigned h = combine_hash(to_func_decl(n)->get_name().hash(), to_func_decl(n)->get_range()->hash());
return ast_array_hash(to_func_decl(n)->get_domain(), to_func_decl(n)->get_arity(),
to_func_decl(n)->get_info() == nullptr ?
to_func_decl(n)->get_name().hash() : combine_hash(to_func_decl(n)->get_name().hash(), to_func_decl(n)->get_info()->hash()));
combine_hash(h, to_func_decl(n)->get_info() == nullptr ? 0 : to_func_decl(n)->get_info()->hash()));
}
case AST_APP:
return ast_array_hash(to_app(n)->get_args(),
to_app(n)->get_num_args(),

View file

@ -745,7 +745,7 @@ namespace euf {
out << "] ";
}
if (n->value() != l_undef)
out << "[v" << n->bool_var() << " := " << (n->value() == l_true ? "T":"F") << "] ";
out << "[b" << n->bool_var() << " := " << (n->value() == l_true ? "T":"F") << "] ";
if (n->has_th_vars()) {
out << "[t";
for (auto v : enode_th_vars(n))

View file

@ -87,8 +87,8 @@ namespace euf {
bool operator()(enode * n1, enode * n2) const {
SASSERT(n1->num_args() == 2);
SASSERT(n2->num_args() == 2);
SASSERT(n1->get_decl() == n2->get_decl());
if (n1->get_decl() != n2->get_decl())
return false;
enode* c1_1 = get_root(n1, 0);
enode* c1_2 = get_root(n1, 1);
enode* c2_1 = get_root(n2, 0);

View file

@ -63,7 +63,7 @@ struct pull_quant::imp {
for (unsigned i = 0; i < num_children; i++) {
expr * child = children[i];
if (is_quantifier(child)) {
if (is_quantifier(child) && !is_lambda(child)) {
if (!found_quantifier && (is_forall(child) || is_exists(child))) {
found_quantifier = true;
@ -184,11 +184,11 @@ struct pull_quant::imp {
// Remark: patterns are ignored.
// See comment in reduce1_app
result = m.mk_forall(var_sorts.size(),
var_sorts.data(),
var_names.data(),
nested_q->get_expr(),
std::min(q->get_weight(), nested_q->get_weight()),
q->get_qid());
var_sorts.data(),
var_names.data(),
nested_q->get_expr(),
std::min(q->get_weight(), nested_q->get_weight()),
m.is_lambda_def(q) ? symbol("pulled-lambda") : q->get_qid());
}
void pull_quant1(quantifier * q, expr * new_expr, expr_ref & result) {

View file

@ -148,6 +148,7 @@ namespace seq {
expr_ref_vector const* _es = nullptr;
if (!match_itos3(e, n, _es))
return false;
expr_ref_vector const& es = *_es;
if (es.empty()) {
@ -183,6 +184,8 @@ namespace seq {
expr_ref digit = m_ax.sk().mk_digit2int(u);
add_consequence(m_ax.mk_ge(digit, 1));
}
expr_ref y(seq.str.mk_concat(e.rs, e.ls[0]->get_sort()), m);
ctx.add_solution(e.ls[0], y);
return true;
}

View file

@ -1775,6 +1775,10 @@ br_status seq_rewriter::mk_seq_replace(expr* a, expr* b, expr* c, expr_ref& resu
result = str().mk_concat(c, a);
return BR_REWRITE1;
}
if (str().is_empty(a) && str().is_empty(c)) {
result = a;
return BR_DONE;
}
m_lhs.reset();
str().get_concat(a, m_lhs);

View file

@ -185,7 +185,7 @@ public:
expr * get_some_value(sort * s) override;
bool is_char(ast* a) const { return a == m_char; }
bool is_char(sort* a) const { return a == m_char; }
unsigned max_char() const { return get_char_plugin().max_char(); }
unsigned num_bits() const { return get_char_plugin().num_bits(); }
@ -222,7 +222,8 @@ public:
sort* mk_string_sort() const { return seq.string_sort(); }
bool is_char(sort* s) const { return seq.is_char(s); }
bool is_string(sort* s) const { return is_seq(s) && seq.is_char(s->get_parameter(0).get_ast()); }
bool is_char(expr* e) const { return is_char(e->get_sort()); }
bool is_string(sort* s) const { return is_seq(s) && seq.is_char(to_sort(s->get_parameter(0).get_ast())); }
bool is_seq(sort* s) const { return is_sort_of(s, m_fid, SEQ_SORT); }
bool is_re(sort* s) const { return is_sort_of(s, m_fid, RE_SORT); }
bool is_re(sort* s, sort*& seq) const { return is_sort_of(s, m_fid, RE_SORT) && (seq = to_sort(s->get_parameter(0).get_ast()), true); }
@ -230,7 +231,6 @@ public:
bool is_seq(sort* s, sort*& seq) const { return is_seq(s) && (seq = to_sort(s->get_parameter(0).get_ast()), true); }
bool is_re(expr* e) const { return is_re(e->get_sort()); }
bool is_re(expr* e, sort*& seq) const { return is_re(e->get_sort(), seq); }
bool is_char(expr* e) const { return is_char(e->get_sort()); }
bool is_const_char(expr* e, unsigned& c) const;
bool is_const_char(expr* e) const { unsigned c; return is_const_char(e, c); }
bool is_char_le(expr const* e) const;