mirror of
https://github.com/Z3Prover/z3
synced 2025-06-23 14:23:40 +00:00
check for non-nullness when handling optional info fields for marking. Fixes issue #719
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
879f792125
commit
0a09d5ff52
2 changed files with 19 additions and 6 deletions
|
@ -1430,14 +1430,22 @@ ast_manager::~ast_manager() {
|
||||||
for (; it_a != end_a; ++it_a) {
|
for (; it_a != end_a; ++it_a) {
|
||||||
ast* n = (*it_a);
|
ast* n = (*it_a);
|
||||||
switch (n->get_kind()) {
|
switch (n->get_kind()) {
|
||||||
case AST_SORT:
|
case AST_SORT: {
|
||||||
mark_array_ref(mark, to_sort(n)->get_info()->get_num_parameters(), to_sort(n)->get_info()->get_parameters());
|
sort_info* info = to_sort(n)->get_info();
|
||||||
|
if (info != 0) {
|
||||||
|
mark_array_ref(mark, info->get_num_parameters(), info->get_parameters());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case AST_FUNC_DECL:
|
}
|
||||||
mark_array_ref(mark, to_func_decl(n)->get_info()->get_num_parameters(), to_func_decl(n)->get_info()->get_parameters());
|
case AST_FUNC_DECL: {
|
||||||
|
func_decl_info* info = to_func_decl(n)->get_info();
|
||||||
|
if (info != 0) {
|
||||||
|
mark_array_ref(mark, info->get_num_parameters(), info->get_parameters());
|
||||||
|
}
|
||||||
mark_array_ref(mark, to_func_decl(n)->get_arity(), to_func_decl(n)->get_domain());
|
mark_array_ref(mark, to_func_decl(n)->get_arity(), to_func_decl(n)->get_domain());
|
||||||
mark.mark(to_func_decl(n)->get_range(), true);
|
mark.mark(to_func_decl(n)->get_range(), true);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case AST_APP:
|
case AST_APP:
|
||||||
mark.mark(to_app(n)->get_decl(), true);
|
mark.mark(to_app(n)->get_decl(), true);
|
||||||
mark_array_ref(mark, to_app(n)->get_num_args(), to_app(n)->get_args());
|
mark_array_ref(mark, to_app(n)->get_num_args(), to_app(n)->get_args());
|
||||||
|
|
|
@ -44,6 +44,9 @@ namespace datalog {
|
||||||
if (m_context.has_facts(r->get_decl(i))) {
|
if (m_context.has_facts(r->get_decl(i))) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (false && r->is_neg_tail(i)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (r->is_neg_tail(i)) {
|
if (r->is_neg_tail(i)) {
|
||||||
if (!engine.get_fact(r->get_decl(i)).is_reachable()) {
|
if (!engine.get_fact(r->get_decl(i)).is_reachable()) {
|
||||||
if (!new_tail) {
|
if (!new_tail) {
|
||||||
|
@ -53,11 +56,13 @@ namespace datalog {
|
||||||
}
|
}
|
||||||
new_tail = true;
|
new_tail = true;
|
||||||
}
|
}
|
||||||
} else if (new_tail) {
|
}
|
||||||
|
else if (new_tail) {
|
||||||
m_new_tail.push_back(r->get_tail(i));
|
m_new_tail.push_back(r->get_tail(i));
|
||||||
m_new_tail_neg.push_back(true);
|
m_new_tail_neg.push_back(true);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
SASSERT(!new_tail);
|
SASSERT(!new_tail);
|
||||||
if (!engine.get_fact(r->get_decl(i)).is_reachable()) {
|
if (!engine.get_fact(r->get_decl(i)).is_reachable()) {
|
||||||
contained = false;
|
contained = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue