Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for QF_SNIA #144

Merged
merged 5 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/smt/smt_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace smt {
setup_QF_FP();
else if (m_logic == "QF_FPBV" || m_logic == "QF_BVFP")
setup_QF_FPBV();
else if (m_logic == "QF_S" || m_logic == "QF_SLIA")
else if (m_logic == "QF_S" || m_logic == "QF_SLIA" || m_logic == "QF_SNIA")
setup_QF_S();
else if (m_logic == "QF_DT")
setup_QF_DT();
Expand Down Expand Up @@ -177,7 +177,7 @@ namespace smt {
setup_QF_BVRE();
else if (m_logic == "QF_AUFLIA")
setup_QF_AUFLIA(st);
else if (m_logic == "QF_S" || m_logic == "QF_SLIA")
else if (m_logic == "QF_S" || m_logic == "QF_SLIA" || m_logic == "QF_SNIA")
setup_QF_S();
else if (m_logic == "AUFLIA")
setup_AUFLIA(st);
Expand Down Expand Up @@ -570,6 +570,7 @@ namespace smt {
setup_char();
}
else if (m_params.m_string_solver == "noodler") {
setup_arith();
setup_str_noodler();
}
else if (m_params.m_string_solver == "auto") {
Expand All @@ -583,7 +584,7 @@ namespace smt {
// don't register any solver.
}
else {
throw default_exception("invalid parameter for smt.string_solver, valid options are 'z3str3', 'seq', 'auto'");
throw default_exception("invalid parameter for smt.string_solver, valid options are 'z3str3', 'seq', 'auto', 'noodler'");
}
}

Expand Down Expand Up @@ -750,6 +751,9 @@ namespace smt {
else if (m_params.m_string_solver == "empty") {
setup_seq();
}
else if (m_params.m_string_solver == "noodler") {
setup_str_noodler();
}
else if (m_params.m_string_solver == "none") {
// don't register any solver.
}
Expand All @@ -762,7 +766,7 @@ namespace smt {
}
}
else {
throw default_exception("invalid parameter for smt.string_solver, valid options are 'z3str3', 'seq', 'auto'");
throw default_exception("invalid parameter for smt.string_solver, valid options are 'z3str3', 'seq', 'auto', 'noodler'");
}
}

Expand All @@ -781,7 +785,6 @@ namespace smt {
}

void setup::setup_str_noodler() {
setup_arith();
m_context.register_plugin(alloc(noodler::theory_str_noodler, m_context, m_manager, m_params));
}

Expand Down
17 changes: 10 additions & 7 deletions src/solver/check_logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,16 @@ struct check_logic::imp {
m_bvs = true;
m_quantifiers = true;
}
else if (logic == "QF_S" || logic == "QF_SLIA") {
m_uf = true;
m_bvs = true;
m_ints = true;
m_arrays = true;
m_reals = true;
m_quantifiers = true; // some QF_SLIA benchmarks are miss-classified
else if (logic == "QF_S" || logic == "QF_SLIA" || logic == "QF_SNIA") {
// m_uf = true;
// m_bvs = true;
m_ints = true; // turn on even for QF_S, as noodler might use some arith heuristic
// m_arrays = true;
// m_reals = true;
// m_quantifiers = true; // some QF_SLIA benchmarks are miss-classified
if (logic == "QF_SNIA") {
m_nonlinear = true;
}
}
else if (logic == "QF_FD") {
m_bvs = true;
Expand Down
5 changes: 3 additions & 2 deletions src/solver/smt_logics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ bool smt_logics::logic_has_arith(symbol const & s) {
s == "QF_BVFP" ||
s == "QF_S" ||
s == "QF_SLIA" ||
s == "QF_SNIA" ||
logic_is_all(s) ||
s == "QF_FD" ||
s == "HORN" ||
Expand Down Expand Up @@ -136,11 +137,11 @@ bool smt_logics::logic_has_array(symbol const & s) {
}

bool smt_logics::logic_has_seq(symbol const & s) {
return s == "QF_BVRE" || s == "QF_S" || s == "QF_SLIA" || logic_is_all(s);
return s == "QF_BVRE" || s == "QF_S" || s == "QF_SLIA" || s == "QF_SNIA" || logic_is_all(s);
}

bool smt_logics::logic_has_str(symbol const & s) {
return s == "QF_S" || s == "QF_SLIA" || logic_is_all(s);
return s == "QF_S" || s == "QF_SLIA" || s == "QF_SNIA" || logic_is_all(s);
}

bool smt_logics::logic_has_fpa(symbol const & s) {
Expand Down