Z3
Public Member Functions | Friends
tactic Class Reference
+ Inheritance diagram for tactic:

Public Member Functions

 tactic (context &c, char const *name)
 
 tactic (context &c, Z3_tactic s)
 
 tactic (tactic const &s)
 
 ~tactic ()
 
 operator Z3_tactic () const
 
tacticoperator= (tactic const &s)
 
solver mk_solver () const
 
apply_result apply (goal const &g) const
 
apply_result operator() (goal const &g) const
 
std::string help () const
 
param_descrs get_param_descrs ()
 
- Public Member Functions inherited from object
 object (context &c)
 
 object (object const &s)
 
contextctx () const
 
Z3_error_code check_error () const
 

Friends

tactic operator & (tactic const &t1, tactic const &t2)
 
tactic operator| (tactic const &t1, tactic const &t2)
 
tactic repeat (tactic const &t, unsigned max)
 
tactic with (tactic const &t, params const &p)
 
tactic try_for (tactic const &t, unsigned ms)
 
tactic par_or (unsigned n, tactic const *tactics)
 
tactic par_and_then (tactic const &t1, tactic const &t2)
 

Additional Inherited Members

- Protected Attributes inherited from object
contextm_ctx
 

Detailed Description

Definition at line 2130 of file z3++.h.

Constructor & Destructor Documentation

§ tactic() [1/3]

tactic ( context c,
char const *  name 
)
inline

Definition at line 2137 of file z3++.h.

2137 :object(c) { Z3_tactic r = Z3_mk_tactic(c, name); check_error(); init(r); }
Z3_error_code check_error() const
Definition: z3++.h:374
Z3_tactic Z3_API Z3_mk_tactic(Z3_context c, Z3_string name)
Return a tactic associated with the given name. The complete list of tactics may be obtained using th...
object(context &c)
Definition: z3++.h:371

§ tactic() [2/3]

tactic ( context c,
Z3_tactic  s 
)
inline

Definition at line 2138 of file z3++.h.

2138 :object(c) { init(s); }
object(context &c)
Definition: z3++.h:371

§ tactic() [3/3]

tactic ( tactic const &  s)
inline

Definition at line 2139 of file z3++.h.

2139 :object(s) { init(s.m_tactic); }
object(context &c)
Definition: z3++.h:371

§ ~tactic()

~tactic ( )
inline

Definition at line 2140 of file z3++.h.

2140 { Z3_tactic_dec_ref(ctx(), m_tactic); }
context & ctx() const
Definition: z3++.h:373
void Z3_API Z3_tactic_dec_ref(Z3_context c, Z3_tactic g)
Decrement the reference counter of the given tactic.

Member Function Documentation

§ apply()

apply_result apply ( goal const &  g) const
inline

Definition at line 2150 of file z3++.h.

2150  {
2151  check_context(*this, g);
2152  Z3_apply_result r = Z3_tactic_apply(ctx(), m_tactic, g);
2153  check_error();
2154  return apply_result(ctx(), r);
2155  }
Z3_error_code check_error() const
Definition: z3++.h:374
Z3_apply_result Z3_API Z3_tactic_apply(Z3_context c, Z3_tactic t, Z3_goal g)
Apply tactic t to the goal g.
context & ctx() const
Definition: z3++.h:373
friend void check_context(object const &a, object const &b)
Definition: z3++.h:377

§ get_param_descrs()

param_descrs get_param_descrs ( )
inline

Definition at line 2167 of file z3++.h.

2167 { return param_descrs(ctx(), Z3_tactic_get_param_descrs(ctx(), m_tactic)); }
Z3_param_descrs Z3_API Z3_tactic_get_param_descrs(Z3_context c, Z3_tactic t)
Return the parameter description set for the given tactic object.
context & ctx() const
Definition: z3++.h:373

§ help()

std::string help ( ) const
inline

Definition at line 2159 of file z3++.h.

2159 { char const * r = Z3_tactic_get_help(ctx(), m_tactic); check_error(); return r; }
Z3_error_code check_error() const
Definition: z3++.h:374
context & ctx() const
Definition: z3++.h:373
Z3_string Z3_API Z3_tactic_get_help(Z3_context c, Z3_tactic t)
Return a string containing a description of parameters accepted by the given tactic.

§ mk_solver()

solver mk_solver ( ) const
inline

Definition at line 2149 of file z3++.h.

2149 { Z3_solver r = Z3_mk_solver_from_tactic(ctx(), m_tactic); check_error(); return solver(ctx(), r); }
Z3_error_code check_error() const
Definition: z3++.h:374
context & ctx() const
Definition: z3++.h:373
Z3_solver Z3_API Z3_mk_solver_from_tactic(Z3_context c, Z3_tactic t)
Create a new solver that is implemented using the given tactic. The solver supports the commands Z3_s...

§ operator Z3_tactic()

operator Z3_tactic ( ) const
inline

Definition at line 2141 of file z3++.h.

2141 { return m_tactic; }

§ operator()()

apply_result operator() ( goal const &  g) const
inline

Definition at line 2156 of file z3++.h.

2156  {
2157  return apply(g);
2158  }
apply_result apply(goal const &g) const
Definition: z3++.h:2150

§ operator=()

tactic& operator= ( tactic const &  s)
inline

Definition at line 2142 of file z3++.h.

2142  {
2143  Z3_tactic_inc_ref(s.ctx(), s.m_tactic);
2144  Z3_tactic_dec_ref(ctx(), m_tactic);
2145  m_ctx = s.m_ctx;
2146  m_tactic = s.m_tactic;
2147  return *this;
2148  }
void Z3_API Z3_tactic_inc_ref(Z3_context c, Z3_tactic t)
Increment the reference counter of the given tactic.
context & ctx() const
Definition: z3++.h:373
context * m_ctx
Definition: z3++.h:369
void Z3_API Z3_tactic_dec_ref(Z3_context c, Z3_tactic g)
Decrement the reference counter of the given tactic.

Friends And Related Function Documentation

§ operator &

tactic operator& ( tactic const &  t1,
tactic const &  t2 
)
friend

Definition at line 2170 of file z3++.h.

2170  {
2171  check_context(t1, t2);
2172  Z3_tactic r = Z3_tactic_and_then(t1.ctx(), t1, t2);
2173  t1.check_error();
2174  return tactic(t1.ctx(), r);
2175  }
Z3_tactic Z3_API Z3_tactic_and_then(Z3_context c, Z3_tactic t1, Z3_tactic t2)
Return a tactic that applies t1 to a given goal and t2 to every subgoal produced by t1...
tactic(context &c, char const *name)
Definition: z3++.h:2137
friend void check_context(object const &a, object const &b)
Definition: z3++.h:377

§ operator|

tactic operator| ( tactic const &  t1,
tactic const &  t2 
)
friend

Definition at line 2177 of file z3++.h.

2177  {
2178  check_context(t1, t2);
2179  Z3_tactic r = Z3_tactic_or_else(t1.ctx(), t1, t2);
2180  t1.check_error();
2181  return tactic(t1.ctx(), r);
2182  }
Z3_tactic Z3_API Z3_tactic_or_else(Z3_context c, Z3_tactic t1, Z3_tactic t2)
Return a tactic that first applies t1 to a given goal, if it fails then returns the result of t2 appl...
tactic(context &c, char const *name)
Definition: z3++.h:2137
friend void check_context(object const &a, object const &b)
Definition: z3++.h:377

§ par_and_then

tactic par_and_then ( tactic const &  t1,
tactic const &  t2 
)
friend

Definition at line 2209 of file z3++.h.

2209  {
2210  check_context(t1, t2);
2211  Z3_tactic r = Z3_tactic_par_and_then(t1.ctx(), t1, t2);
2212  t1.check_error();
2213  return tactic(t1.ctx(), r);
2214  }
tactic(context &c, char const *name)
Definition: z3++.h:2137
Z3_tactic Z3_API Z3_tactic_par_and_then(Z3_context c, Z3_tactic t1, Z3_tactic t2)
Return a tactic that applies t1 to a given goal and then t2 to every subgoal produced by t1...
friend void check_context(object const &a, object const &b)
Definition: z3++.h:377

§ par_or

tactic par_or ( unsigned  n,
tactic const *  tactics 
)
friend

Definition at line 2200 of file z3++.h.

2200  {
2201  if (n == 0) {
2202  Z3_THROW(exception("a non-zero number of tactics need to be passed to par_or"));
2203  }
2204  array<Z3_tactic> buffer(n);
2205  for (unsigned i = 0; i < n; ++i) buffer[i] = tactics[i];
2206  return tactic(tactics[0].ctx(), Z3_tactic_par_or(tactics[0].ctx(), n, buffer.ptr()));
2207  }
#define Z3_THROW(x)
Definition: z3++.h:93
def tactics(ctx=None)
Definition: z3py.py:7498
context & ctx() const
Definition: z3++.h:373
tactic(context &c, char const *name)
Definition: z3++.h:2137
Z3_tactic Z3_API Z3_tactic_par_or(Z3_context c, unsigned num, Z3_tactic const ts[])
Return a tactic that applies the given tactics in parallel.

§ repeat

tactic repeat ( tactic const &  t,
unsigned  max = UINT_MAX 
)
friend

Definition at line 2184 of file z3++.h.

2184  {
2185  Z3_tactic r = Z3_tactic_repeat(t.ctx(), t, max);
2186  t.check_error();
2187  return tactic(t.ctx(), r);
2188  }
tactic(context &c, char const *name)
Definition: z3++.h:2137
Z3_tactic Z3_API Z3_tactic_repeat(Z3_context c, Z3_tactic t, unsigned max)
Return a tactic that keeps applying t until the goal is not modified anymore or the maximum number of...

§ try_for

tactic try_for ( tactic const &  t,
unsigned  ms 
)
friend

Definition at line 2195 of file z3++.h.

2195  {
2196  Z3_tactic r = Z3_tactic_try_for(t.ctx(), t, ms);
2197  t.check_error();
2198  return tactic(t.ctx(), r);
2199  }
tactic(context &c, char const *name)
Definition: z3++.h:2137
Z3_tactic Z3_API Z3_tactic_try_for(Z3_context c, Z3_tactic t, unsigned ms)
Return a tactic that applies t to a given goal for ms milliseconds. If t does not terminate in ms mil...

§ with

tactic with ( tactic const &  t,
params const &  p 
)
friend

Definition at line 2190 of file z3++.h.

2190  {
2191  Z3_tactic r = Z3_tactic_using_params(t.ctx(), t, p);
2192  t.check_error();
2193  return tactic(t.ctx(), r);
2194  }
tactic(context &c, char const *name)
Definition: z3++.h:2137
Z3_tactic Z3_API Z3_tactic_using_params(Z3_context c, Z3_tactic t, Z3_params p)
Return a tactic that applies t using the given set of parameters.