File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -8374,6 +8374,21 @@ namespace smt {
8374
8374
}
8375
8375
}
8376
8376
8377
+ bool theory_str::is_var(expr * e) const {
8378
+ ast_manager & m = get_manager();
8379
+ sort * ex_sort = m.get_sort(e);
8380
+ sort * str_sort = u.str.mk_string_sort();
8381
+ // non-string-sort terms cannot be string variables
8382
+ if (ex_sort != str_sort) return false;
8383
+ // string constants cannot be variables
8384
+ if (u.str.is_string(e)) return false;
8385
+ if (u.str.is_concat(e) || u.str.is_at(e) || u.str.is_extract(e) || u.str.is_replace(e) || u.str.is_itos(e))
8386
+ return false;
8387
+ if (m.is_ite(e))
8388
+ return false;
8389
+ return true;
8390
+ }
8391
+
8377
8392
void theory_str::set_up_axioms(expr * ex) {
8378
8393
ast_manager & m = get_manager();
8379
8394
context & ctx = get_context();
@@ -8417,7 +8432,7 @@ namespace smt {
8417
8432
TRACE("str", tout << "found string-integer conversion term: " << mk_pp(ex, get_manager()) << std::endl;);
8418
8433
string_int_conversion_terms.push_back(ap);
8419
8434
m_library_aware_axiom_todo.push_back(n);
8420
- } else if (/*ap->get_num_args() == 0 &&*/ !u.str.is_string(ap )) {
8435
+ } else if (is_var(ex )) {
8421
8436
// if ex is a variable, add it to our list of variables
8422
8437
TRACE("str", tout << "tracking variable " << mk_ismt2_pp(ap, get_manager()) << std::endl;);
8423
8438
variable_set.insert(ex);
Original file line number Diff line number Diff line change @@ -572,6 +572,7 @@ class theory_str : public theory {
572
572
expr * z3str2_get_eqc_value (expr * n , bool & hasEqcValue);
573
573
bool in_same_eqc (expr * n1, expr * n2);
574
574
expr * collect_eq_nodes (expr * n, expr_ref_vector & eqcSet);
575
+ bool is_var (expr * e) const ;
575
576
576
577
bool get_arith_value (expr* e, rational& val) const ;
577
578
bool get_len_value (expr* e, rational& val);
You can’t perform that action at this time.
0 commit comments