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)
 
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 2918 of file z3++.h.

Constructor & Destructor Documentation

tactic ( context c,
char const *  name 
)
inline

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

2925 :object(c) { Z3_tactic r = Z3_mk_tactic(c, name); check_error(); init(r); }
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...
Z3_error_code check_error() const
Definition: z3++.h:429
object(context &c)
Definition: z3++.h:427
tactic ( context c,
Z3_tactic  s 
)
inline

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

2926 :object(c) { init(s); }
object(context &c)
Definition: z3++.h:427
tactic ( tactic const &  s)
inline

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

2927 :object(s) { init(s.m_tactic); }
object(context &c)
Definition: z3++.h:427
~tactic ( )
inline

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

2928 { Z3_tactic_dec_ref(ctx(), m_tactic); }
context & ctx() const
Definition: z3++.h:428
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_result apply ( goal const &  g) const
inline

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

Referenced by tactic::operator()().

2938  {
2939  check_context(*this, g);
2940  Z3_apply_result r = Z3_tactic_apply(ctx(), m_tactic, g);
2941  check_error();
2942  return apply_result(ctx(), r);
2943  }
Z3_apply_result Z3_API Z3_tactic_apply(Z3_context c, Z3_tactic t, Z3_goal g)
Apply tactic t to the goal g.
Z3_error_code check_error() const
Definition: z3++.h:429
context & ctx() const
Definition: z3++.h:428
friend void check_context(object const &a, object const &b)
Definition: z3++.h:432
param_descrs get_param_descrs ( )
inline

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

2955 { 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:428
std::string help ( ) const
inline

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

2947 { char const * r = Z3_tactic_get_help(ctx(), m_tactic); check_error(); return r; }
Z3_error_code check_error() const
Definition: z3++.h:429
context & ctx() const
Definition: z3++.h:428
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.
solver mk_solver ( ) const
inline

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

2937 { 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:429
context & ctx() const
Definition: z3++.h:428
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 ( ) const
inline

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

2929 { return m_tactic; }
apply_result operator() ( goal const &  g) const
inline

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

2944  {
2945  return apply(g);
2946  }
apply_result apply(goal const &g) const
Definition: z3++.h:2938
tactic& operator= ( tactic const &  s)
inline

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

2930  {
2931  Z3_tactic_inc_ref(s.ctx(), s.m_tactic);
2932  Z3_tactic_dec_ref(ctx(), m_tactic);
2933  object::operator=(s);
2934  m_tactic = s.m_tactic;
2935  return *this;
2936  }
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:428
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

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

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

2958  {
2959  check_context(t1, t2);
2960  Z3_tactic r = Z3_tactic_and_then(t1.ctx(), t1, t2);
2961  t1.check_error();
2962  return tactic(t1.ctx(), r);
2963  }
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:2925
friend void check_context(object const &a, object const &b)
Definition: z3++.h:432
tactic operator| ( tactic const &  t1,
tactic const &  t2 
)
friend

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

2965  {
2966  check_context(t1, t2);
2967  Z3_tactic r = Z3_tactic_or_else(t1.ctx(), t1, t2);
2968  t1.check_error();
2969  return tactic(t1.ctx(), r);
2970  }
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:2925
friend void check_context(object const &a, object const &b)
Definition: z3++.h:432
tactic par_and_then ( tactic const &  t1,
tactic const &  t2 
)
friend

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

2997  {
2998  check_context(t1, t2);
2999  Z3_tactic r = Z3_tactic_par_and_then(t1.ctx(), t1, t2);
3000  t1.check_error();
3001  return tactic(t1.ctx(), r);
3002  }
tactic(context &c, char const *name)
Definition: z3++.h:2925
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:432
tactic par_or ( unsigned  n,
tactic const *  tactics 
)
friend

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

2988  {
2989  if (n == 0) {
2990  Z3_THROW(exception("a non-zero number of tactics need to be passed to par_or"));
2991  }
2992  array<Z3_tactic> buffer(n);
2993  for (unsigned i = 0; i < n; ++i) buffer[i] = tactics[i];
2994  return tactic(tactics[0].ctx(), Z3_tactic_par_or(tactics[0].ctx(), n, buffer.ptr()));
2995  }
#define Z3_THROW(x)
Definition: z3++.h:100
tactic(context &c, char const *name)
Definition: z3++.h:2925
context & ctx() const
Definition: z3++.h:428
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.
def tactics
Definition: z3py.py:8334
tactic repeat ( tactic const &  t,
unsigned  max = UINT_MAX 
)
friend

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

2972  {
2973  Z3_tactic r = Z3_tactic_repeat(t.ctx(), t, max);
2974  t.check_error();
2975  return tactic(t.ctx(), r);
2976  }
tactic(context &c, char const *name)
Definition: z3++.h:2925
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...
expr max(expr const &a, expr const &b)
Definition: z3++.h:1891
tactic try_for ( tactic const &  t,
unsigned  ms 
)
friend

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

2983  {
2984  Z3_tactic r = Z3_tactic_try_for(t.ctx(), t, ms);
2985  t.check_error();
2986  return tactic(t.ctx(), r);
2987  }
tactic(context &c, char const *name)
Definition: z3++.h:2925
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...
tactic with ( tactic const &  t,
params const &  p 
)
friend

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

2978  {
2979  Z3_tactic r = Z3_tactic_using_params(t.ctx(), t, p);
2980  t.check_error();
2981  return tactic(t.ctx(), r);
2982  }
tactic(context &c, char const *name)
Definition: z3++.h:2925
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.