mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 04:56:03 +00:00
make get_vars populate all indices with sorts even if variable does not occur in rule. This makes the use of get_vars less prone to callers having to double check for null pointers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
72fe197bda
commit
4957e71408
8 changed files with 16 additions and 21 deletions
|
@ -978,13 +978,14 @@ namespace datalog {
|
|||
}
|
||||
}
|
||||
|
||||
void rule::get_vars(ptr_vector<sort>& sorts) const {
|
||||
void rule::get_vars(ast_manager& m, ptr_vector<sort>& sorts) const {
|
||||
sorts.reset();
|
||||
used_vars used;
|
||||
get_used_vars(used);
|
||||
unsigned sz = used.get_max_found_var_idx_plus_1();
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
sorts.push_back(used.get(i));
|
||||
sort* s = used.get(i);
|
||||
sorts.push_back(s?s:m.mk_bool_sort());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue