mirror of
https://github.com/Z3Prover/z3
synced 2026-05-21 01:19:34 +00:00
Some more bug fixes
This commit is contained in:
parent
38d725dc5a
commit
a36254f104
5 changed files with 22 additions and 19 deletions
|
|
@ -35,6 +35,7 @@ NSB review:
|
|||
#include "ast/rewriter/th_rewriter.h"
|
||||
#include "ast/rewriter/seq_skolem.h"
|
||||
#include "ast/rewriter/var_subst.h"
|
||||
#include "smt/smt_enode.h"
|
||||
#include "util/statistics.h"
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
|
|
@ -247,6 +248,18 @@ namespace seq {
|
|||
return false;
|
||||
}
|
||||
|
||||
void nielsen_node::add_str_eq(str_eq const& eq) {
|
||||
SASSERT(eq.m_lhs != nullptr);
|
||||
SASSERT(eq.m_rhs != nullptr);
|
||||
m_str_eq.push_back(eq);
|
||||
}
|
||||
|
||||
void nielsen_node::add_str_mem(str_mem const& mem) {
|
||||
SASSERT(mem.m_str != nullptr);
|
||||
SASSERT(mem.m_regex != nullptr);
|
||||
m_str_mem.push_back(mem);
|
||||
}
|
||||
|
||||
void nielsen_node::add_constraint(constraint const &c) {
|
||||
auto& m = graph().get_manager();
|
||||
if (m.is_and(c.fml)) {
|
||||
|
|
@ -1137,7 +1150,7 @@ namespace seq {
|
|||
dep_tracker dep = mem.m_dep;
|
||||
if (m_graph.check_regex_widening(*this, mem.m_str, mem.m_regex, dep)) {
|
||||
set_general_conflict();
|
||||
set_conflict(backtrack_reason::regex, dep);
|
||||
set_conflict(backtrack_reason::regex_widening, dep);
|
||||
return simplify_result::conflict;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -560,17 +560,8 @@ namespace seq {
|
|||
vector<str_mem> const& str_mems() const { return m_str_mem; }
|
||||
vector<str_mem>& str_mems() { return m_str_mem; }
|
||||
|
||||
void add_str_eq(str_eq const& eq) {
|
||||
SASSERT(eq.m_lhs != nullptr);
|
||||
SASSERT(eq.m_rhs != nullptr);
|
||||
m_str_eq.push_back(eq);
|
||||
}
|
||||
void add_str_mem(str_mem const& mem) {
|
||||
SASSERT(mem.m_str != nullptr);
|
||||
SASSERT(mem.m_regex != nullptr);
|
||||
m_str_mem.push_back(mem);
|
||||
}
|
||||
|
||||
void add_str_eq(str_eq const& eq);
|
||||
void add_str_mem(str_mem const& mem);
|
||||
void add_constraint(constraint const &ic);
|
||||
|
||||
vector<constraint> const& constraints() const { return m_constraints; }
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ namespace seq {
|
|||
std::string res;
|
||||
if (ap->get_num_args() == 0)
|
||||
return "∅";
|
||||
res = regex_expr_html(ap->get_arg(1), m, seq);
|
||||
res = regex_expr_html(ap->get_arg(0), m, seq);
|
||||
for (unsigned i = 1; i < ap->get_num_args(); ++i) {
|
||||
res += " | ";
|
||||
res += regex_expr_html(ap->get_arg(i), m, seq);
|
||||
|
|
|
|||
|
|
@ -577,7 +577,6 @@ namespace seq {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return l_true;
|
||||
}
|
||||
|
||||
|
|
@ -667,8 +666,7 @@ namespace seq {
|
|||
euf::snode* result = nullptr;
|
||||
|
||||
for (auto const& mem : node.str_mems()) {
|
||||
if (!mem.m_str || !mem.m_regex)
|
||||
continue;
|
||||
SASSERT(mem.m_str && mem.m_regex);
|
||||
// Primitive constraint: str is a single variable
|
||||
if (!mem.is_primitive())
|
||||
continue;
|
||||
|
|
@ -679,6 +677,7 @@ namespace seq {
|
|||
|
||||
if (!result) {
|
||||
result = mem.m_regex;
|
||||
dep = dep_mgr.mk_join(dep, mem.m_dep);
|
||||
}
|
||||
else {
|
||||
expr* r1 = result->get_expr();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue