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
 
void 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)
 

Additional Inherited Members

- Protected Attributes inherited from object
contextm_ctx
 

Detailed Description

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

Constructor & Destructor Documentation

§ tactic() [1/3]

tactic ( context c,
char const *  name 
)
inline

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

1865 :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...
object(context &c)
Definition: z3++.h:330
void check_error() const
Definition: z3++.h:333

§ tactic() [2/3]

tactic ( context c,
Z3_tactic  s 
)
inline

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

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

§ tactic() [3/3]

tactic ( tactic const &  s)
inline

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

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

§ ~tactic()

~tactic ( )
inline

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

1868 { Z3_tactic_dec_ref(ctx(), m_tactic); }
context & ctx() const
Definition: z3++.h:332
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 1878 of file z3++.h.

Referenced by Tactic::__call__().

1878  {
1879  check_context(*this, g);
1880  Z3_apply_result r = Z3_tactic_apply(ctx(), m_tactic, g);
1881  check_error();
1882  return apply_result(ctx(), r);
1883  }
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:332
friend void check_context(object const &a, object const &b)
Definition: z3++.h:336
void check_error() const
Definition: z3++.h:333

§ get_param_descrs()

param_descrs get_param_descrs ( )
inline

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

1893 { return param_descrs(ctx(), Z3_tactic_get_param_descrs(ctx(), m_tactic)); }
context & ctx() const
Definition: z3++.h:332
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.

§ help()

std::string help ( ) const
inline

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

1887 { char const * r = Z3_tactic_get_help(ctx(), m_tactic); check_error(); return r; }
context & ctx() const
Definition: z3++.h:332
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.
void check_error() const
Definition: z3++.h:333

§ mk_solver()

solver mk_solver ( ) const
inline

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

1877 { Z3_solver r = Z3_mk_solver_from_tactic(ctx(), m_tactic); check_error(); return solver(ctx(), r); }
context & ctx() const
Definition: z3++.h:332
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...
void check_error() const
Definition: z3++.h:333

§ operator Z3_tactic()

operator Z3_tactic ( ) const
inline

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

1869 { return m_tactic; }

§ operator()()

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

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

1884  {
1885  return apply(g);
1886  }
apply_result apply(goal const &g) const
Definition: z3++.h:1878

§ operator=()

tactic& operator= ( tactic const &  s)
inline

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

1870  {
1871  Z3_tactic_inc_ref(s.ctx(), s.m_tactic);
1872  Z3_tactic_dec_ref(ctx(), m_tactic);
1873  m_ctx = s.m_ctx;
1874  m_tactic = s.m_tactic;
1875  return *this;
1876  }
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:332
void Z3_API Z3_tactic_dec_ref(Z3_context c, Z3_tactic g)
Decrement the reference counter of the given tactic.
context * m_ctx
Definition: z3++.h:328

Friends And Related Function Documentation

§ operator &

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

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

1896  {
1897  check_context(t1, t2);
1898  Z3_tactic r = Z3_tactic_and_then(t1.ctx(), t1, t2);
1899  t1.check_error();
1900  return tactic(t1.ctx(), r);
1901  }
tactic(context &c, char const *name)
Definition: z3++.h:1865
friend void check_context(object const &a, object const &b)
Definition: z3++.h:336
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...

§ operator|

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

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

1903  {
1904  check_context(t1, t2);
1905  Z3_tactic r = Z3_tactic_or_else(t1.ctx(), t1, t2);
1906  t1.check_error();
1907  return tactic(t1.ctx(), r);
1908  }
tactic(context &c, char const *name)
Definition: z3++.h:1865
friend void check_context(object const &a, object const &b)
Definition: z3++.h:336
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...

§ repeat

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

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

1910  {
1911  Z3_tactic r = Z3_tactic_repeat(t.ctx(), t, max);
1912  t.check_error();
1913  return tactic(t.ctx(), r);
1914  }
tactic(context &c, char const *name)
Definition: z3++.h:1865
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 1921 of file z3++.h.

1921  {
1922  Z3_tactic r = Z3_tactic_try_for(t.ctx(), t, ms);
1923  t.check_error();
1924  return tactic(t.ctx(), r);
1925  }
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(context &c, char const *name)
Definition: z3++.h:1865

§ with

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

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

1916  {
1917  Z3_tactic r = Z3_tactic_using_params(t.ctx(), t, p);
1918  t.check_error();
1919  return tactic(t.ctx(), r);
1920  }
tactic(context &c, char const *name)
Definition: z3++.h:1865
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.