3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-28 19:01:29 +00:00

Merge branch 'develop' into issue1379

This commit is contained in:
Murphy Berzish 2018-03-06 22:14:18 -05:00
commit f43a027447
872 changed files with 12207 additions and 15948 deletions

View file

@ -458,7 +458,7 @@ namespace smt {
buffer << "!tmp";
buffer << m_fresh_id;
m_fresh_id++;
return u.mk_skolem(symbol(buffer.c_str()), 0, 0, s);
return u.mk_skolem(symbol(buffer.c_str()), 0, nullptr, s);
}
@ -617,7 +617,7 @@ namespace smt {
ast_manager & m = get_manager();
expr * args[2] = {n, bound};
app * unrollFunc = get_manager().mk_app(get_id(), _OP_RE_UNROLL, 0, 0, 2, args);
app * unrollFunc = get_manager().mk_app(get_id(), _OP_RE_UNROLL, 0, nullptr, 2, args);
m_trail.push_back(unrollFunc);
expr_ref_vector items(m);
@ -658,7 +658,7 @@ namespace smt {
} else {
if (false) {
// use cache
app * lenTerm = NULL;
app * lenTerm = nullptr;
if (!length_ast_map.find(e, lenTerm)) {
lenTerm = u.str.mk_length(e);
length_ast_map.insert(e, lenTerm);
@ -704,14 +704,14 @@ namespace smt {
return n1;
}
}
return NULL;
return nullptr;
}
expr * theory_str::mk_concat(expr * n1, expr * n2) {
context & ctx = get_context();
ast_manager & m = get_manager();
ENSURE(n1 != NULL);
ENSURE(n2 != NULL);
ENSURE(n1 != nullptr);
ENSURE(n2 != nullptr);
bool n1HasEqcValue = false;
bool n2HasEqcValue = false;
n1 = get_eqc_value(n1, n1HasEqcValue);
@ -769,7 +769,7 @@ namespace smt {
// Z3 treats (ast1) and (ast2) as two different nodes.
//-------------------------------------------------------
expr * concatAst = NULL;
expr * concatAst = nullptr;
if (!concat_astNode_map.find(n1, n2, concatAst)) {
concatAst = u.str.mk_concat(n1, n2);
@ -1427,9 +1427,9 @@ namespace smt {
void theory_str::instantiate_axiom_Substr(enode * e) {
context & ctx = get_context();
ast_manager & m = get_manager();
expr* substrBase = 0;
expr* substrPos = 0;
expr* substrLen = 0;
expr* substrBase = nullptr;
expr* substrPos = nullptr;
expr* substrLen = nullptr;
app * expr = e->get_owner();
if (axiomatized_terms.contains(expr)) {
@ -1453,7 +1453,7 @@ namespace smt {
// pos < strlen(base)
// --> pos + -1*strlen(base) < 0
argumentsValid_terms.push_back(mk_not(m, m_autil.mk_ge(
m_autil.mk_add(substrPos, m_autil.mk_mul(minusOne, substrLen)),
m_autil.mk_add(substrPos, m_autil.mk_mul(minusOne, mk_strlen(substrBase))),
zero)));
// len >= 0
@ -1692,8 +1692,10 @@ namespace smt {
u.str.is_string(range1, range1val);
u.str.is_string(range2, range2val);
return zstring("[") + range1val + zstring("-") + range2val + zstring("]");
} else if (u.re.is_full(a_regex)) {
} else if (u.re.is_full_seq(a_regex)) {
return zstring("(.*)");
} else if (u.re.is_full_char(a_regex)) {
return zstring("str.allchar");
} else {
TRACE("str", tout << "BUG: unrecognized regex term " << mk_pp(regex, get_manager()) << std::endl;);
UNREACHABLE(); return zstring("");
@ -1809,9 +1811,15 @@ namespace smt {
expr_ref finalAxiom(m.mk_iff(ex, rhs), m);
SASSERT(finalAxiom);
assert_axiom(finalAxiom);
} else if (u.re.is_full(regex)) {
} else if (u.re.is_full_seq(regex)) {
// trivially true for any string!
assert_axiom(ex);
} else if (u.re.is_full_char(regex)) {
// any char = any string of length 1
expr_ref rhs(ctx.mk_eq_atom(mk_strlen(str), mk_int(1)), m);
expr_ref finalAxiom(m.mk_iff(ex, rhs), m);
SASSERT(finalAxiom);
assert_axiom(finalAxiom);
} else {
TRACE("str", tout << "ERROR: unknown regex expression " << mk_pp(regex, m) << "!" << std::endl;);
NOT_IMPLEMENTED_YET();
@ -1999,7 +2007,7 @@ namespace smt {
}
}
// give up
return NULL;
return nullptr;
}
// trace code helper
@ -2089,7 +2097,7 @@ namespace smt {
// (Concat n_eqNode arg1) /\ arg1 has eq const
expr * concatResult = eval_concat(eq_str, arg1);
if (concatResult != NULL) {
if (concatResult != nullptr) {
bool arg1HasEqcValue = false;
expr * arg1Value = get_eqc_value(arg1, arg1HasEqcValue);
expr_ref implyL(m);
@ -2160,7 +2168,7 @@ namespace smt {
// (Concat arg0 n_eqNode) /\ arg0 has eq const
expr * concatResult = eval_concat(arg0, eq_str);
if (concatResult != NULL) {
if (concatResult != nullptr) {
bool arg0HasEqcValue = false;
expr * arg0Value = get_eqc_value(arg0, arg0HasEqcValue);
expr_ref implyL(m);
@ -2844,8 +2852,8 @@ namespace smt {
//*************************************************************
if (is_concat_eq_type2(new_nn1, new_nn2)) {
expr * y = NULL;
expr * m = NULL;
expr * y = nullptr;
expr * m = nullptr;
expr * v1_arg0 = to_app(new_nn1)->get_arg(0);
expr * v1_arg1 = to_app(new_nn1)->get_arg(1);
expr * v2_arg0 = to_app(new_nn2)->get_arg(0);
@ -2876,8 +2884,8 @@ namespace smt {
expr * v2_arg0 = to_app(new_nn2)->get_arg(0);
expr * v2_arg1 = to_app(new_nn2)->get_arg(1);
expr * x = NULL;
expr * n = NULL;
expr * x = nullptr;
expr * n = nullptr;
if (u.str.is_string(v1_arg0) && !u.str.is_string(v2_arg0)) {
n = v1_arg1;
@ -2918,8 +2926,8 @@ namespace smt {
expr * v2_arg0 = to_app(new_nn2)->get_arg(0);
expr * v2_arg1 = to_app(new_nn2)->get_arg(1);
expr * y = NULL;
expr * m = NULL;
expr * y = nullptr;
expr * m = nullptr;
if (u.str.is_string(v1_arg0)) {
y = v1_arg1;
@ -3018,9 +3026,9 @@ namespace smt {
<< "split type " << splitType << std::endl;
);
expr * t1 = NULL;
expr * t2 = NULL;
expr * xorFlag = NULL;
expr * t1 = nullptr;
expr * t2 = nullptr;
expr * xorFlag = nullptr;
std::pair<expr*, expr*> key1(concatAst1, concatAst2);
std::pair<expr*, expr*> key2(concatAst2, concatAst1);
@ -3388,10 +3396,10 @@ namespace smt {
return;
}
expr * x = NULL;
expr * y = NULL;
expr * strAst = NULL;
expr * m = NULL;
expr * x = nullptr;
expr * y = nullptr;
expr * strAst = nullptr;
expr * m = nullptr;
expr * v1_arg0 = to_app(concatAst1)->get_arg(0);
expr * v1_arg1 = to_app(concatAst1)->get_arg(1);
@ -3422,8 +3430,8 @@ namespace smt {
// setup
expr * xorFlag = NULL;
expr * temp1 = NULL;
expr * xorFlag = nullptr;
expr * temp1 = nullptr;
std::pair<expr*, expr*> key1(concatAst1, concatAst2);
std::pair<expr*, expr*> key2(concatAst2, concatAst1);
@ -3756,10 +3764,10 @@ namespace smt {
expr * v2_arg0 = to_app(concatAst2)->get_arg(0);
expr * v2_arg1 = to_app(concatAst2)->get_arg(1);
expr * x = NULL;
expr * y = NULL;
expr * strAst = NULL;
expr * n = NULL;
expr * x = nullptr;
expr * y = nullptr;
expr * strAst = nullptr;
expr * n = nullptr;
if (u.str.is_string(v1_arg0) && !u.str.is_string(v2_arg0)) {
strAst = v1_arg0;
@ -4316,10 +4324,10 @@ namespace smt {
expr * v2_arg1 = to_app(concatAst2)->get_arg(1);
expr * str1Ast = NULL;
expr * y = NULL;
expr * m = NULL;
expr * str2Ast = NULL;
expr * str1Ast = nullptr;
expr * y = nullptr;
expr * m = nullptr;
expr * str2Ast = nullptr;
if (u.str.is_string(v1_arg0)) {
str1Ast = v1_arg0;
@ -4360,8 +4368,8 @@ namespace smt {
}
//----------------------------------------------------------------
expr * commonVar = NULL;
expr * xorFlag = NULL;
expr * commonVar = nullptr;
expr * xorFlag = nullptr;
std::pair<expr*, expr*> key1(concatAst1, concatAst2);
std::pair<expr*, expr*> key2(concatAst2, concatAst1);
@ -4672,7 +4680,7 @@ namespace smt {
return dynamic_cast<theory_mi_arith*>(th);
}
else {
return 0;
return nullptr;
}
}
@ -4844,7 +4852,7 @@ namespace smt {
}
expr * theory_str::collect_eq_nodes(expr * n, expr_ref_vector & eqcSet) {
expr * constStrNode = NULL;
expr * constStrNode = nullptr;
expr * ex = n;
do {
@ -4889,7 +4897,7 @@ namespace smt {
expr * strAst = itor1->first;
expr * substrAst = itor1->second;
expr * boolVar = NULL;
expr * boolVar = nullptr;
if (!contain_pair_bool_map.find(strAst, substrAst, boolVar)) {
TRACE("str", tout << "warning: no entry for boolVar in contain_pair_bool_map" << std::endl;);
}
@ -5026,7 +5034,7 @@ namespace smt {
expr * strAst = itor1->first;
expr * substrAst = itor1->second;
expr * boolVar = NULL;
expr * boolVar = nullptr;
if (!contain_pair_bool_map.find(strAst, substrAst, boolVar)) {
TRACE("str", tout << "warning: no entry for boolVar in contain_pair_bool_map" << std::endl;);
}
@ -5443,7 +5451,7 @@ namespace smt {
expr_ref_vector willEqClass(m);
expr * constStrAst_1 = collect_eq_nodes(n1, willEqClass);
expr * constStrAst_2 = collect_eq_nodes(n2, willEqClass);
expr * constStrAst = (constStrAst_1 != NULL) ? constStrAst_1 : constStrAst_2;
expr * constStrAst = (constStrAst_1 != nullptr) ? constStrAst_1 : constStrAst_2;
TRACE("str", tout << "eqc of n1 is {";
for (expr_ref_vector::iterator it = willEqClass.begin(); it != willEqClass.end(); ++it) {
@ -5459,7 +5467,7 @@ namespace smt {
);
// step 1: we may have constant values for Contains checks now
if (constStrAst != NULL) {
if (constStrAst != nullptr) {
expr_ref_vector::iterator itAst = willEqClass.begin();
for (; itAst != willEqClass.end(); itAst++) {
if (*itAst == constStrAst) {
@ -6312,7 +6320,7 @@ namespace smt {
}
TRACE("str", tout << "range NFA: start = " << start << ", end = " << end << std::endl;);
} else if (u.re.is_full(e)) {
} else if (u.re.is_full_seq(e)) {
// effectively the same as .* where . can be any single character
// start --e--> tmp
// tmp --e--> end
@ -6325,6 +6333,13 @@ namespace smt {
make_transition(tmp, ch, tmp);
}
TRACE("str", tout << "re.all NFA: start = " << start << ", end = " << end << std::endl;);
} else if (u.re.is_full_char(e)) {
// effectively . (match any one character)
for (unsigned int i = 0; i < 256; ++i) {
char ch = (char)i;
make_transition(start, ch, end);
}
TRACE("str", tout << "re.allchar NFA: start = " << start << ", end = " << end << std::endl;);
} else {
TRACE("str", tout << "invalid regular expression" << std::endl;);
m_valid = false;
@ -6403,9 +6418,9 @@ namespace smt {
expr * constStr_1 = collect_eq_nodes(nn1, eqNodeSet);
expr * constStr_2 = collect_eq_nodes(nn2, eqNodeSet);
expr * constStr = (constStr_1 != NULL) ? constStr_1 : constStr_2;
expr * constStr = (constStr_1 != nullptr) ? constStr_1 : constStr_2;
if (constStr == NULL) {
if (constStr == nullptr) {
return;
} else {
expr_ref_vector::iterator itor = eqNodeSet.begin();
@ -6613,7 +6628,7 @@ namespace smt {
} else {
// Case 4: Concat(var, var) == const
TRACE("str", tout << "Case 4: Concat(var, var) == const" << std::endl;);
if (eval_concat(arg1, arg2) == NULL) {
if (eval_concat(arg1, arg2) == nullptr) {
rational arg1Len, arg2Len;
bool arg1Len_exists = get_len_value(arg1, arg1Len);
bool arg2Len_exists = get_len_value(arg2, arg2Len);
@ -6858,7 +6873,7 @@ namespace smt {
} else {
// start binary search as normal
expr_ref implLhs(ctx.mk_eq_atom(testvar, str), m);
expr_ref implRhs(binary_search_length_test(v, NULL, ""), m);
expr_ref implRhs(binary_search_length_test(v, nullptr, ""), m);
assert_implication(implLhs, implRhs);
}
} else {
@ -6990,14 +7005,14 @@ namespace smt {
}
expr * valueAssert = gen_free_var_options(fVar, effectiveLenInd, effectiveLenIndiStr, valTester, valTesterValue);
TRACE("str", tout << "asserting more value tests for free variable " << mk_ismt2_pp(fVar, m) << std::endl;);
if (valueAssert != NULL) {
if (valueAssert != nullptr) {
assert_axiom(valueAssert);
}
}
} else {
int lenTesterCount = fvar_lenTester_map[fVar].size();
expr * effectiveLenInd = NULL;
expr * effectiveLenInd = nullptr;
zstring effectiveLenIndiStr = "";
for (int i = 0; i < lenTesterCount; ++i) {
expr * len_indicator_pre = fvar_lenTester_map[fVar][i];
@ -7015,7 +7030,7 @@ namespace smt {
}
expr * valueAssert = gen_free_var_options(fVar, effectiveLenInd, effectiveLenIndiStr, valTester, valTesterValue);
TRACE("str", tout << "asserting more value tests for free variable " << mk_ismt2_pp(fVar, m) << std::endl;);
if (valueAssert != NULL) {
if (valueAssert != nullptr) {
assert_axiom(valueAssert);
}
}
@ -7260,20 +7275,20 @@ namespace smt {
simplify_parent(lhs, nn2_value);
}
expr * nn1EqConst = NULL;
expr * nn1EqConst = nullptr;
std::set<expr*> nn1EqUnrollFuncs;
get_eqc_allUnroll(lhs, nn1EqConst, nn1EqUnrollFuncs);
expr * nn2EqConst = NULL;
expr * nn2EqConst = nullptr;
std::set<expr*> nn2EqUnrollFuncs;
get_eqc_allUnroll(rhs, nn2EqConst, nn2EqUnrollFuncs);
if (nn2EqConst != NULL) {
if (nn2EqConst != nullptr) {
for (std::set<expr*>::iterator itor1 = nn1EqUnrollFuncs.begin(); itor1 != nn1EqUnrollFuncs.end(); itor1++) {
process_unroll_eq_const_str(*itor1, nn2EqConst);
}
}
if (nn1EqConst != NULL) {
if (nn1EqConst != nullptr) {
for (std::set<expr*>::iterator itor2 = nn2EqUnrollFuncs.begin(); itor2 != nn2EqUnrollFuncs.end(); itor2++) {
process_unroll_eq_const_str(*itor2, nn1EqConst);
}
@ -7915,13 +7930,13 @@ namespace smt {
if (aliasUnrollSet.find(unrollItor->first) != aliasUnrollSet.end()) {
continue;
}
expr * aRoot = NULL;
expr * aRoot = nullptr;
enode * e_currEqc = ctx.get_enode(unrollItor->first);
enode * e_curr = e_currEqc;
do {
app * curr = e_currEqc->get_owner();
if (u.re.is_unroll(curr)) {
if (aRoot == NULL) {
if (aRoot == nullptr) {
aRoot = curr;
}
aliasUnrollSet[curr] = aRoot;
@ -7946,11 +7961,11 @@ namespace smt {
if (aliasIndexMap.find(varItor->first) != aliasIndexMap.end()) {
continue;
}
expr * aRoot = NULL;
expr * aRoot = nullptr;
expr * curr = varItor->first;
do {
if (variable_set.find(curr) != variable_set.end()) {
if (aRoot == NULL) {
if (aRoot == nullptr) {
aRoot = curr;
} else {
aliasIndexMap[curr] = aRoot;
@ -8038,11 +8053,11 @@ namespace smt {
if (concats_eq_index_map.find(concatItor->first) != concats_eq_index_map.end()) {
continue;
}
expr * aRoot = NULL;
expr * aRoot = nullptr;
expr * curr = concatItor->first;
do {
if (u.str.is_concat(to_app(curr))) {
if (aRoot == NULL) {
if (aRoot == nullptr) {
aRoot = curr;
} else {
concats_eq_index_map[curr] = aRoot;
@ -8054,7 +8069,7 @@ namespace smt {
concatItor = concatMap.begin();
for(; concatItor != concatMap.end(); ++concatItor) {
expr * deAliasConcat = NULL;
expr * deAliasConcat = nullptr;
if (concats_eq_index_map.find(concatItor->first) != concats_eq_index_map.end()) {
deAliasConcat = concats_eq_index_map[concatItor->first];
} else {
@ -8192,15 +8207,15 @@ namespace smt {
mostLeftNodes.clear();
mostRightNodes.clear();
expr * mLConst = NULL;
expr * mRConst = NULL;
expr * mLConst = nullptr;
expr * mRConst = nullptr;
for (std::map<expr*, int>::iterator itor1 = itor->second.begin(); itor1 != itor->second.end(); itor1++) {
expr * concatNode = itor1->first;
expr * mLNode = getMostLeftNodeInConcat(concatNode);
zstring strval;
if (u.str.is_string(to_app(mLNode), strval)) {
if (mLConst == NULL && strval.empty()) {
if (mLConst == nullptr && strval.empty()) {
mLConst = mLNode;
}
} else {
@ -8209,7 +8224,7 @@ namespace smt {
expr * mRNode = getMostRightNodeInConcat(concatNode);
if (u.str.is_string(to_app(mRNode), strval)) {
if (mRConst == NULL && strval.empty()) {
if (mRConst == nullptr && strval.empty()) {
mRConst = mRNode;
}
} else {
@ -8217,7 +8232,7 @@ namespace smt {
}
}
if (mLConst != NULL) {
if (mLConst != nullptr) {
// -------------------------------------------------------------------------------------
// The left most variable in a concat is constrained by a constant string in eqc concat
// -------------------------------------------------------------------------------------
@ -8271,7 +8286,7 @@ namespace smt {
}
}
if (mRConst != NULL) {
if (mRConst != nullptr) {
for (std::map<expr*, expr*>::iterator itor1 = mostRightNodes.begin();
itor1 != mostRightNodes.end(); itor1++) {
expr * deVar = get_alias_index_ast(aliasIndexMap, itor1->first);
@ -8950,7 +8965,7 @@ namespace smt {
// -----------------------------------------------------------
std::map<expr*, std::set<expr*> > fv_unrolls_map;
std::set<expr*> tmpSet;
expr * constValue = NULL;
expr * constValue = nullptr;
for (std::map<expr*, int>::iterator fvIt2 = freeVar_map.begin(); fvIt2 != freeVar_map.end(); fvIt2++) {
expr * var = fvIt2->first;
tmpSet.clear();
@ -9034,7 +9049,7 @@ namespace smt {
// Assign free variables
std::set<expr*> fSimpUnroll;
constValue = NULL;
constValue = nullptr;
{
TRACE("str", tout << "free var map (#" << freeVar_map.size() << "):" << std::endl;
@ -9072,8 +9087,8 @@ namespace smt {
continue;
}
*/
expr * toAssert = gen_len_val_options_for_free_var(freeVar, NULL, "");
if (toAssert != NULL) {
expr * toAssert = gen_len_val_options_for_free_var(freeVar, nullptr, "");
if (toAssert != nullptr) {
assert_axiom(toAssert);
}
}
@ -9093,7 +9108,7 @@ namespace smt {
gen_assign_unroll_reg(fv_unrolls_map[var]);
} else {
expr * toAssert = gen_assign_unroll_Str2Reg(var, fSimpUnroll);
if (toAssert != NULL) {
if (toAssert != nullptr) {
assert_axiom(toAssert);
}
}
@ -9379,7 +9394,7 @@ namespace smt {
}
if (valTesterValueStr == "more") {
expr * valTester = NULL;
expr * valTester = nullptr;
if (i + 1 < testerTotal) {
valTester = fvar_valueTester_map[freeVar][len][i + 1].second;
refresh_theory_var(valTester);
@ -9392,7 +9407,7 @@ namespace smt {
return gen_val_options(freeVar, len_indicator, valTester, len_valueStr, i + 1);
}
return NULL;
return nullptr;
}
}
@ -9625,14 +9640,14 @@ namespace smt {
int lcm = 1;
int coreValueCount = 0;
expr * oneUnroll = NULL;
expr * oneUnroll = nullptr;
zstring oneCoreStr("");
for (std::set<expr*>::iterator itor = unrolls.begin(); itor != unrolls.end(); itor++) {
expr * str2RegFunc = to_app(*itor)->get_arg(0);
expr * coreVal = to_app(str2RegFunc)->get_arg(0);
zstring coreStr;
u.str.is_string(coreVal, coreStr);
if (oneUnroll == NULL) {
if (oneUnroll == nullptr) {
oneUnroll = *itor;
oneCoreStr = coreStr;
}
@ -10058,7 +10073,7 @@ namespace smt {
TRACE("str", tout << "invoked with previousLenTester info matching top of stack" << std::endl;);
} else {
TRACE("str", tout << "WARNING: unexpected reordering of length testers!" << std::endl;);
UNREACHABLE(); return NULL;
UNREACHABLE(); return nullptr;
}
} else {
u.str.is_string(lastTesterValue, lastTesterConstant);
@ -10074,7 +10089,7 @@ namespace smt {
}
TRACE("str", tout << "last bounds are [" << lastBounds.lowerBound << " | " << lastBounds.midPoint << " | " << lastBounds.upperBound << "]!" << lastBounds.windowSize << std::endl;);
binary_search_info newBounds;
expr * newTester = 0;
expr * newTester = nullptr;
if (lastTesterConstant == "more") {
// special case: if the midpoint, upper bound, and window size are all equal,
// we double the window size and adjust the bounds
@ -10142,7 +10157,7 @@ namespace smt {
return axiom;
}
// length is fixed
expr * valueAssert = gen_free_var_options(freeVar, lastTester, lastTesterConstant, NULL, zstring(""));
expr * valueAssert = gen_free_var_options(freeVar, lastTester, lastTesterConstant, nullptr, zstring(""));
return valueAssert;
}
} else {
@ -10252,7 +10267,7 @@ namespace smt {
} else {
TRACE("str", tout << "found previous in-scope length assertions" << std::endl;);
expr * effectiveLenInd = NULL;
expr * effectiveLenInd = nullptr;
zstring effectiveLenIndiStr("");
int lenTesterCount = (int) fvar_lenTester_map[freeVar].size();
@ -10353,7 +10368,7 @@ namespace smt {
} else {
TRACE("str", tout << "length is fixed; generating models for free var" << std::endl;);
// length is fixed
expr * valueAssert = gen_free_var_options(freeVar, effectiveLenInd, effectiveLenIndiStr, NULL, zstring(""));
expr * valueAssert = gen_free_var_options(freeVar, effectiveLenInd, effectiveLenIndiStr, nullptr, zstring(""));
return valueAssert;
}
} // fVarLenCountMap.find(...)
@ -10407,7 +10422,7 @@ namespace smt {
std::set<expr*> eqVarSet;
get_var_in_eqc(freeVar, eqVarSet);
bool duplicated = false;
expr * dupVar = NULL;
expr * dupVar = nullptr;
for (std::set<expr*>::iterator itorEqv = eqVarSet.begin(); itorEqv != eqVarSet.end(); itorEqv++) {
if (eqcRepSet.find(*itorEqv) != eqcRepSet.end()) {
duplicated = true;
@ -10415,7 +10430,7 @@ namespace smt {
break;
}
}
if (duplicated && dupVar != NULL) {
if (duplicated && dupVar != nullptr) {
TRACE("str", tout << "Duplicated free variable found:" << mk_pp(freeVar, get_manager())
<< " = " << mk_ismt2_pp(dupVar, get_manager()) << " (SKIP)" << std::endl;);
continue;
@ -10463,10 +10478,10 @@ namespace smt {
for(std::set<expr*>::iterator itor1 = leafVarSet.begin();
itor1 != leafVarSet.end(); ++itor1) {
expr * toAssert = gen_len_val_options_for_free_var(*itor1, NULL, "");
expr * toAssert = gen_len_val_options_for_free_var(*itor1, nullptr, "");
// gen_len_val_options_for_free_var() can legally return NULL,
// as methods that it calls may assert their own axioms instead.
if (toAssert != NULL) {
if (toAssert != nullptr) {
assert_axiom(toAssert);
}
}
@ -10475,9 +10490,9 @@ namespace smt {
mItor != aloneVars.end(); ++mItor) {
std::set<expr*>::iterator itor2 = mItor->second.begin();
for(; itor2 != mItor->second.end(); ++itor2) {
expr * toAssert = gen_len_val_options_for_free_var(*itor2, NULL, "");
expr * toAssert = gen_len_val_options_for_free_var(*itor2, nullptr, "");
// same deal with returning a NULL axiom here
if(toAssert != NULL) {
if(toAssert != nullptr) {
assert_axiom(toAssert);
}
}
@ -10489,7 +10504,7 @@ namespace smt {
* and constant string in eqc of node n
*/
void theory_str::get_eqc_allUnroll(expr * n, expr * &constStr, std::set<expr*> & unrollFuncSet) {
constStr = NULL;
constStr = nullptr;
unrollFuncSet.clear();
expr * curr = n;
@ -10507,7 +10522,7 @@ namespace smt {
// Collect simple Unroll functions (whose core is Str2Reg) and constant strings in the EQC of n.
void theory_str::get_eqc_simpleUnroll(expr * n, expr * &constStr, std::set<expr*> & unrollFuncSet) {
constStr = NULL;
constStr = nullptr;
unrollFuncSet.clear();
expr * curr = n;
@ -10554,7 +10569,7 @@ namespace smt {
app * a0_conststr = mk_value_helper(to_app(a0));
app * a1_conststr = mk_value_helper(to_app(a1));
if (a0_conststr != NULL && a1_conststr != NULL) {
if (a0_conststr != nullptr && a1_conststr != nullptr) {
zstring a0_s, a1_s;
u.str.is_string(a0_conststr, a0_s);
u.str.is_string(a1_conststr, a1_s);
@ -10569,7 +10584,7 @@ namespace smt {
if (hasEqc) {
return to_app(n_eqc);
} else {
return NULL;
return nullptr;
}
}
@ -10584,7 +10599,7 @@ namespace smt {
SASSERT(get_context().e_internalized(owner));
app * val = mk_value_helper(owner);
if (val != NULL) {
if (val != nullptr) {
return alloc(expr_wrapper_proc, val);
} else {
TRACE("str", tout << "WARNING: failed to find a concrete value, falling back" << std::endl;);