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

Public Member Functions

 goal (context &c, bool models=true, bool unsat_cores=false, bool proofs=false)
 
 goal (context &c, Z3_goal s)
 
 goal (goal const &s)
 
 ~goal ()
 
 operator Z3_goal () const
 
goaloperator= (goal const &s)
 
void add (expr const &f)
 
unsigned size () const
 
expr operator[] (int i) const
 
Z3_goal_prec precision () const
 
bool inconsistent () const
 
unsigned depth () const
 
void reset ()
 
unsigned num_exprs () const
 
bool is_decided_sat () const
 
bool is_decided_unsat () const
 
expr as_expr () const
 
- Public Member Functions inherited from object
 object (context &c)
 
 object (object const &s)
 
contextctx () const
 
void check_error () const
 

Friends

std::ostream & operator<< (std::ostream &out, goal const &g)
 

Additional Inherited Members

- Protected Attributes inherited from object
contextm_ctx
 

Detailed Description

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

Constructor & Destructor Documentation

§ goal() [1/3]

goal ( context c,
bool  models = true,
bool  unsat_cores = false,
bool  proofs = false 
)
inline

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

1789 :object(c) { init(Z3_mk_goal(c, models, unsat_cores, proofs)); }
Z3_goal Z3_API Z3_mk_goal(Z3_context c, Z3_bool models, Z3_bool unsat_cores, Z3_bool proofs)
Create a goal (aka problem). A goal is essentially a set of formulas, that can be solved and/or trans...
object(context &c)
Definition: z3++.h:330

§ goal() [2/3]

goal ( context c,
Z3_goal  s 
)
inline

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

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

§ goal() [3/3]

goal ( goal const &  s)
inline

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

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

§ ~goal()

~goal ( )
inline

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

1792 { Z3_goal_dec_ref(ctx(), m_goal); }
context & ctx() const
Definition: z3++.h:332
void Z3_API Z3_goal_dec_ref(Z3_context c, Z3_goal g)
Decrement the reference counter of the given goal.

Member Function Documentation

§ add()

void add ( expr const &  f)
inline

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

Referenced by Fixedpoint::__iadd__(), and Optimize::__iadd__().

1801 { check_context(*this, f); Z3_goal_assert(ctx(), m_goal, f); check_error(); }
context & ctx() const
Definition: z3++.h:332
void Z3_API Z3_goal_assert(Z3_context c, Z3_goal g, Z3_ast a)
Add a new formula a to the given goal.
friend void check_context(object const &a, object const &b)
Definition: z3++.h:336
void check_error() const
Definition: z3++.h:333

§ as_expr()

expr as_expr ( ) const
inline

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

1811  {
1812  unsigned n = size();
1813  if (n == 0)
1814  return ctx().bool_val(true);
1815  else if (n == 1)
1816  return operator[](0);
1817  else {
1818  array<Z3_ast> args(n);
1819  for (unsigned i = 0; i < n; i++)
1820  args[i] = operator[](i);
1821  return expr(ctx(), Z3_mk_and(ctx(), n, args.ptr()));
1822  }
1823  }
unsigned size() const
Definition: z3++.h:1802
expr operator[](int i) const
Definition: z3++.h:1803
context & ctx() const
Definition: z3++.h:332
Z3_ast Z3_API Z3_mk_and(Z3_context c, unsigned num_args, Z3_ast const args[])
Create an AST node representing args[0] and ... and args[num_args-1].
expr bool_val(bool b)
Definition: z3++.h:2197

§ depth()

unsigned depth ( ) const
inline

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

1806 { return Z3_goal_depth(ctx(), m_goal); }
unsigned Z3_API Z3_goal_depth(Z3_context c, Z3_goal g)
Return the depth of the given goal. It tracks how many transformations were applied to it...
context & ctx() const
Definition: z3++.h:332

§ inconsistent()

bool inconsistent ( ) const
inline

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

1805 { return Z3_goal_inconsistent(ctx(), m_goal) != 0; }
context & ctx() const
Definition: z3++.h:332
Z3_bool Z3_API Z3_goal_inconsistent(Z3_context c, Z3_goal g)
Return true if the given goal contains the formula false.

§ is_decided_sat()

bool is_decided_sat ( ) const
inline

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

1809 { return Z3_goal_is_decided_sat(ctx(), m_goal) != 0; }
Z3_bool Z3_API Z3_goal_is_decided_sat(Z3_context c, Z3_goal g)
Return true if the goal is empty, and it is precise or the product of a under approximation.
context & ctx() const
Definition: z3++.h:332

§ is_decided_unsat()

bool is_decided_unsat ( ) const
inline

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

1810 { return Z3_goal_is_decided_unsat(ctx(), m_goal) != 0; }
Z3_bool Z3_API Z3_goal_is_decided_unsat(Z3_context c, Z3_goal g)
Return true if the goal contains false, and it is precise or the product of an over approximation...
context & ctx() const
Definition: z3++.h:332

§ num_exprs()

unsigned num_exprs ( ) const
inline

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

1808 { return Z3_goal_num_exprs(ctx(), m_goal); }
unsigned Z3_API Z3_goal_num_exprs(Z3_context c, Z3_goal g)
Return the number of formulas, subformulas and terms in the given goal.
context & ctx() const
Definition: z3++.h:332

§ operator Z3_goal()

operator Z3_goal ( ) const
inline

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

1793 { return m_goal; }

§ operator=()

goal& operator= ( goal const &  s)
inline

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

1794  {
1795  Z3_goal_inc_ref(s.ctx(), s.m_goal);
1796  Z3_goal_dec_ref(ctx(), m_goal);
1797  m_ctx = s.m_ctx;
1798  m_goal = s.m_goal;
1799  return *this;
1800  }
context & ctx() const
Definition: z3++.h:332
void Z3_API Z3_goal_dec_ref(Z3_context c, Z3_goal g)
Decrement the reference counter of the given goal.
void Z3_API Z3_goal_inc_ref(Z3_context c, Z3_goal g)
Increment the reference counter of the given goal.
context * m_ctx
Definition: z3++.h:328

§ operator[]()

expr operator[] ( int  i) const
inline

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

1803 { assert(0 <= i); Z3_ast r = Z3_goal_formula(ctx(), m_goal, i); check_error(); return expr(ctx(), r); }
Z3_ast Z3_API Z3_goal_formula(Z3_context c, Z3_goal g, unsigned idx)
Return a formula from the given goal.
context & ctx() const
Definition: z3++.h:332
void check_error() const
Definition: z3++.h:333

§ precision()

Z3_goal_prec precision ( ) const
inline

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

1804 { return Z3_goal_precision(ctx(), m_goal); }
Z3_goal_prec Z3_API Z3_goal_precision(Z3_context c, Z3_goal g)
Return the "precision" of the given goal. Goals can be transformed using over and under approximation...
context & ctx() const
Definition: z3++.h:332

§ reset()

void reset ( )
inline

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

1807 { Z3_goal_reset(ctx(), m_goal); }
void Z3_API Z3_goal_reset(Z3_context c, Z3_goal g)
Erase all formulas from the given goal.
context & ctx() const
Definition: z3++.h:332

§ size()

unsigned size ( ) const
inline

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

1802 { return Z3_goal_size(ctx(), m_goal); }
unsigned Z3_API Z3_goal_size(Z3_context c, Z3_goal g)
Return the number of formulas in the given goal.
context & ctx() const
Definition: z3++.h:332

Friends And Related Function Documentation

§ operator<<

std::ostream& operator<< ( std::ostream &  out,
goal const &  g 
)
friend

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

1826 { out << Z3_goal_to_string(g.ctx(), g); return out; }
Z3_string Z3_API Z3_goal_to_string(Z3_context c, Z3_goal g)
Convert a goal into a string.