3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-02 21:37:02 +00:00

add default tactic as option to overwrite the behavior of strategic solver factory

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2019-06-17 09:27:10 -07:00
parent 1e770af1cc
commit f3b79087ee
6 changed files with 60 additions and 5 deletions

View file

@ -3110,6 +3110,24 @@ namespace smt2 {
m_var_shifter = nullptr;
}
sexpr_ref parse_sexpr_ref() {
m_num_bindings = 0;
unsigned found_errors = 0;
m_num_open_paren = 0;
try {
scan_core();
parse_sexpr();
if (!sexpr_stack().empty()) {
return sexpr_ref(sexpr_stack().back(), sm());
}
}
catch (z3_exception & ex) {
error(ex.msg());
}
return sexpr_ref(nullptr, sm());
}
bool operator()() {
m_num_bindings = 0;
unsigned found_errors = 0;
@ -3182,3 +3200,10 @@ bool parse_smt2_commands(cmd_context & ctx, std::istream & is, bool interactive,
return p();
}
sexpr_ref parse_sexpr(cmd_context& ctx, std::istream& is, params_ref const& ps, char const* filename) {
smt2::parser p(ctx, is, false, ps, filename);
return p.parse_sexpr_ref();
}

View file

@ -23,4 +23,6 @@ Revision History:
bool parse_smt2_commands(cmd_context & ctx, std::istream & is, bool interactive = false, params_ref const & p = params_ref(), char const * filename = nullptr);
sexpr_ref parse_sexpr(cmd_context& ctx, std::istream& is, params_ref const& ps, char const* filename);
#endif

View file

@ -126,6 +126,11 @@ namespace smt2 {
return SYMBOL_TOKEN;
}
}
if (!m_string.empty()) {
m_string.push_back(0);
m_id = m_string.begin();
return SYMBOL_TOKEN;
}
return EOF_TOKEN;
}