#include <z3++.h>
Definition at line 2629 of file z3++.h.
◆ model() [1/4]
◆ model() [2/4]
Definition at line 2638 of file z3++.h.
2638:object(c) { init(m); }
◆ model() [3/4]
Definition at line 2639 of file z3++.h.
2639:object(s) { init(s.m_model); }
◆ model() [4/4]
Definition at line 2640 of file z3++.h.
Z3_model Z3_API Z3_model_translate(Z3_context c, Z3_model m, Z3_context dst)
translate model from context c to context dst.
◆ ~model()
Definition at line 2641 of file z3++.h.
void Z3_API Z3_model_dec_ref(Z3_context c, Z3_model m)
Decrement the reference counter of the given model.
◆ add_const_interp()
Definition at line 2700 of file z3++.h.
2700 {
2702 check_error();
2703 }
void Z3_API Z3_add_const_interp(Z3_context c, Z3_model m, Z3_func_decl f, Z3_ast a)
Add a constant interpretation.
◆ add_func_interp()
Definition at line 2694 of file z3++.h.
2694 {
2696 check_error();
2697 return func_interp(ctx(), r);
2698 }
Z3_func_interp Z3_API Z3_add_func_interp(Z3_context c, Z3_model m, Z3_func_decl f, Z3_ast default_value)
Create a fresh func_interp object, add it to a model for a specified function. It has reference count...
◆ eval()
| expr eval |
( |
expr const & | n, |
|
|
bool | model_completion = false ) const |
|
inline |
Definition at line 2651 of file z3++.h.
2651 {
2653 Z3_ast r = 0;
2654 bool status =
Z3_model_eval(ctx(), m_model, n, model_completion, &r);
2655 check_error();
2656 if (status == false && ctx().enable_exceptions())
2657 Z3_THROW(exception(
"failed to evaluate expression"));
2658 return expr(ctx(), r);
2659 }
bool Z3_API Z3_model_eval(Z3_context c, Z3_model m, Z3_ast t, bool model_completion, Z3_ast *v)
Evaluate the AST node t in the given model. Return true if succeeded, and store the result in v.
void check_context(object const &a, object const &b)
◆ get_const_decl()
Definition at line 2663 of file z3++.h.
Z3_func_decl Z3_API Z3_model_get_const_decl(Z3_context c, Z3_model m, unsigned i)
Return the i-th constant in the given model.
Referenced by operator[]().
◆ get_const_interp()
Definition at line 2674 of file z3++.h.
2674 {
2677 check_error();
2678 return expr(ctx(), r);
2679 }
Z3_ast Z3_API Z3_model_get_const_interp(Z3_context c, Z3_model m, Z3_func_decl a)
Return the interpretation (i.e., assignment) of constant a in the model m. Return NULL,...
◆ get_func_decl()
Definition at line 2664 of file z3++.h.
2664{ Z3_func_decl r =
Z3_model_get_func_decl(ctx(), m_model, i); check_error();
return func_decl(ctx(), r); }
Z3_func_decl Z3_API Z3_model_get_func_decl(Z3_context c, Z3_model m, unsigned i)
Return the declaration of the i-th function in the given model.
Referenced by operator[]().
◆ get_func_interp()
Definition at line 2680 of file z3++.h.
2680 {
2683 check_error();
2684 return func_interp(ctx(), r);
2685 }
Z3_func_interp Z3_API Z3_model_get_func_interp(Z3_context c, Z3_model m, Z3_func_decl f)
Return the interpretation of the function f in the model m. Return NULL, if the model does not assign...
◆ has_interp()
Definition at line 2689 of file z3++.h.
2689 {
2692 }
bool Z3_API Z3_model_has_interp(Z3_context c, Z3_model m, Z3_func_decl a)
Test if there exists an interpretation (i.e., assignment) for a in the model m.
◆ num_consts()
| unsigned num_consts |
( |
| ) |
const |
|
inline |
Definition at line 2661 of file z3++.h.
unsigned Z3_API Z3_model_get_num_consts(Z3_context c, Z3_model m)
Return the number of constants assigned by the given model.
Referenced by operator[](), and size().
◆ num_funcs()
| unsigned num_funcs |
( |
| ) |
const |
|
inline |
Definition at line 2662 of file z3++.h.
unsigned Z3_API Z3_model_get_num_funcs(Z3_context c, Z3_model m)
Return the number of function interpretations in the given model.
Referenced by size().
◆ operator Z3_model()
| operator Z3_model |
( |
| ) |
const |
|
inline |
◆ operator=()
Definition at line 2643 of file z3++.h.
2643 {
2646 object::operator=(s);
2647 m_model = s.m_model;
2648 return *this;
2649 }
void Z3_API Z3_model_inc_ref(Z3_context c, Z3_model m)
Increment the reference counter of the given model.
◆ operator[]()
Definition at line 2666 of file z3++.h.
2666 {
2667 assert(0 <= i);
2668 return static_cast<unsigned>(i) < num_consts() ? get_const_decl(i) : get_func_decl(i - num_consts());
2669 }
◆ size()
Definition at line 2665 of file z3++.h.
2665{ return num_consts() + num_funcs(); }
◆ to_string()
| std::string to_string |
( |
| ) |
const |
|
inline |
Definition at line 2707 of file z3++.h.
Z3_string Z3_API Z3_model_to_string(Z3_context c, Z3_model m)
Convert the given model into a string.
Referenced by operator<<.
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | out, |
|
|
model const & | m ) |
|
friend |
Definition at line 2709 of file z3++.h.
2709{ return out << m.to_string(); }