3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 20:05:51 +00:00

add command-line help descriptions on tactics

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-08-14 19:29:35 -07:00
parent c0a07f9229
commit fae206b738
7 changed files with 65 additions and 13 deletions

View file

@ -94,10 +94,7 @@ void help_tactic(cmd_context & ctx) {
buf << "- (fail-if <probe>) fail if <probe> evaluates to true.\n";
buf << "- (using-params <tactic> <attribute>*) executes the given tactic using the given attributes, where <attribute> ::= <keyword> <value>. ! is a syntax sugar for using-params.\n";
buf << "builtin tactics:\n";
cmd_context::tactic_cmd_iterator it = ctx.begin_tactic_cmds();
cmd_context::tactic_cmd_iterator end = ctx.end_tactic_cmds();
for (; it != end; ++it) {
tactic_cmd * cmd = *it;
for (tactic_cmd* cmd : ctx.tactics()) {
buf << "- " << cmd->get_name() << " " << cmd->get_descr() << "\n";
tactic_ref t = cmd->mk(ctx.m());
param_descrs descrs;
@ -105,10 +102,7 @@ void help_tactic(cmd_context & ctx) {
descrs.display(buf, 4);
}
buf << "builtin probes:\n";
cmd_context::probe_iterator it2 = ctx.begin_probes();
cmd_context::probe_iterator end2 = ctx.end_probes();
for (; it2 != end2; ++it2) {
probe_info * pinfo = *it2;
for (probe_info * pinfo : ctx.probes()) {
buf << "- " << pinfo->get_name() << " " << pinfo->get_descr() << "\n";
}
ctx.regular_stream() << '"' << escaped(buf.str()) << "\"\n";

View file

@ -44,10 +44,29 @@ public:
typedef ptr_vector<tactic_cmd>::const_iterator tactic_cmd_iterator;
tactic_cmd_iterator begin_tactic_cmds() const { return m_tactics.begin(); }
tactic_cmd_iterator end_tactic_cmds() const { return m_tactics.end(); }
class tactics_iterator {
tactic_manager const& m;
public:
tactics_iterator(tactic_manager const& m):m(m) {}
tactic_cmd_iterator begin() const { return m.begin_tactic_cmds(); }
tactic_cmd_iterator end() const { return m.end_tactic_cmds(); }
};
tactics_iterator tactics() const { return tactics_iterator(*this); }
typedef ptr_vector<probe_info>::const_iterator probe_iterator;
probe_iterator begin_probes() const { return m_probes.begin(); }
probe_iterator end_probes() const { return m_probes.end(); }
class probes_iterator {
tactic_manager const& m;
public:
probes_iterator(tactic_manager const& m):m(m) {}
probe_iterator begin() const { return m.begin_probes(); }
probe_iterator end() const { return m.end_probes(); }
};
probes_iterator probes() const { return probes_iterator(*this); }
};