3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-12 10:14:42 +00:00

merge with master

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-03-25 14:57:01 -07:00
commit c513f3ca09
883 changed files with 13979 additions and 16480 deletions

View file

@ -55,20 +55,20 @@ class declare_tactic_cmd : public cmd {
public:
declare_tactic_cmd():
cmd("declare-tactic"),
m_decl(0) {
m_decl(nullptr) {
}
virtual char const * get_usage() const { return "<symbol> <tactic>"; }
virtual char const * get_descr(cmd_context & ctx) const { return "declare a new tactic, use (help-tactic) for the tactic language syntax."; }
virtual unsigned get_arity() const { return 2; }
virtual void prepare(cmd_context & ctx) { m_name = symbol::null; m_decl = 0; }
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
char const * get_usage() const override { return "<symbol> <tactic>"; }
char const * get_descr(cmd_context & ctx) const override { return "declare a new tactic, use (help-tactic) for the tactic language syntax."; }
unsigned get_arity() const override { return 2; }
void prepare(cmd_context & ctx) override { m_name = symbol::null; m_decl = nullptr; }
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
if (m_name == symbol::null) return CPK_SYMBOL;
return CPK_SEXPR;
}
virtual void set_next_arg(cmd_context & ctx, symbol const & s) { m_name = s; }
virtual void set_next_arg(cmd_context & ctx, sexpr * n) { m_decl = n; }
virtual void execute(cmd_context & ctx) {
void set_next_arg(cmd_context & ctx, symbol const & s) override { m_name = s; }
void set_next_arg(cmd_context & ctx, sexpr * n) override { m_decl = n; }
void execute(cmd_context & ctx) override {
tactic_ref t = sexpr2tactic(ctx, m_decl); // make sure the tactic is well formed.
ctx.insert_user_tactic(m_name, m_decl);
}
@ -133,23 +133,23 @@ public:
parametric_cmd(name) {
}
virtual char const * get_usage() const { return "<tactic> (<keyword> <value>)*"; }
char const * get_usage() const override { return "<tactic> (<keyword> <value>)*"; }
virtual void prepare(cmd_context & ctx) {
void prepare(cmd_context & ctx) override {
parametric_cmd::prepare(ctx);
m_tactic = 0;
m_tactic = nullptr;
}
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
if (m_tactic == 0) return CPK_SEXPR;
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override {
if (m_tactic == nullptr) return CPK_SEXPR;
return parametric_cmd::next_arg_kind(ctx);
}
virtual void set_next_arg(cmd_context & ctx, sexpr * arg) {
void set_next_arg(cmd_context & ctx, sexpr * arg) override {
m_tactic = arg;
}
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
insert_timeout(p);
insert_max_memory(p);
p.insert("print_statistics", CPK_BOOL, "(default: false) print statistics.");
@ -172,7 +172,7 @@ public:
check_sat_tactic_result(ast_manager & m) : simple_check_sat_result(m) {
}
virtual void get_labels(svector<symbol> & r) {
void get_labels(svector<symbol> & r) override {
r.append(labels);
}
@ -187,16 +187,16 @@ public:
exec_given_tactic_cmd("check-sat-using") {
}
virtual char const * get_main_descr() const { return "check if the current context is satisfiable using the given tactic, use (help-tactic) for the tactic language syntax."; }
char const * get_main_descr() const override { return "check if the current context is satisfiable using the given tactic, use (help-tactic) for the tactic language syntax."; }
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
exec_given_tactic_cmd::init_pdescrs(ctx, p);
p.insert("print_unsat_core", CPK_BOOL, "(default: false) print unsatisfiable core.");
p.insert("print_proof", CPK_BOOL, "(default: false) print proof.");
p.insert("print_model", CPK_BOOL, "(default: false) print model.");
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if (!m_tactic) {
throw cmd_exception("check-sat-using needs a tactic argument");
}
@ -297,9 +297,9 @@ public:
exec_given_tactic_cmd("apply") {
}
virtual char const * get_main_descr() const { return "apply the given tactic to the current context, and print the resultant set of goals."; }
char const * get_main_descr() const override { return "apply the given tactic to the current context, and print the resultant set of goals."; }
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
void init_pdescrs(cmd_context & ctx, param_descrs & p) override {
p.insert("print", CPK_BOOL, "(default: true) print resultant goals.");
#ifndef _EXTERNAL_RELEASE
p.insert("print_proof", CPK_BOOL, "(default: false) print proof associated with each assertion.");
@ -310,7 +310,7 @@ public:
exec_given_tactic_cmd::init_pdescrs(ctx, p);
}
virtual void execute(cmd_context & ctx) {
void execute(cmd_context & ctx) override {
if (!m_tactic) {
throw cmd_exception("apply needs a tactic argument");
}
@ -596,9 +596,9 @@ static tactic * mk_echo(cmd_context & ctx, sexpr * n) {
if (curr->is_string())
t = mk_echo_tactic(ctx, curr->get_string().c_str(), last);
else
t = mk_probe_value_tactic(ctx, 0, sexpr2probe(ctx, curr), last);
t = mk_probe_value_tactic(ctx, nullptr, sexpr2probe(ctx, curr), last);
tactic * new_res;
if (res.get() == 0)
if (res.get() == nullptr)
new_res = t;
else
new_res = and_then(res.get(), t);
@ -607,7 +607,7 @@ static tactic * mk_echo(cmd_context & ctx, sexpr * n) {
res = new_res;
}
UNREACHABLE();
return 0;
return nullptr;
}
static tactic * mk_fail_if_branching(cmd_context & ctx, sexpr * n) {
@ -664,10 +664,10 @@ static tactic * mk_skip_if_failed(cmd_context & ctx, sexpr * n) {
tactic * sexpr2tactic(cmd_context & ctx, sexpr * n) {
if (n->is_symbol()) {
tactic_cmd * cmd = ctx.find_tactic_cmd(n->get_symbol());
if (cmd != 0)
if (cmd != nullptr)
return cmd->mk(ctx.m());
sexpr * decl = ctx.find_user_tactic(n->get_symbol());
if (decl != 0)
if (decl != nullptr)
return sexpr2tactic(ctx, decl);
throw cmd_exception("invalid tactic, unknown tactic ", n->get_symbol(), n->get_line(), n->get_pos());
}
@ -777,7 +777,7 @@ MK_NARY_PROBE(mk_mul);
probe * sexpr2probe(cmd_context & ctx, sexpr * n) {
if (n->is_symbol()) {
probe_info * pinfo = ctx.find_probe(n->get_symbol());
if (pinfo != 0)
if (pinfo != nullptr)
return pinfo->get();
throw cmd_exception("invalid probe, unknown builtin probe ", n->get_symbol(), n->get_line(), n->get_pos());
}