add model printing operator<<
MODIFY
smt/solver.cpp
smt/solver.cpp
@@ -195,6 +195,10 @@ Model::iterator Model::end() const {
return { nullptr, Z3_model_get_num_consts(ctx(), m) };
}
+ostream& operator<<(ostream &os, const Model &m) {
+ return os << Z3_model_to_string(ctx(), m.m);
+}
+
SolverPop::~SolverPop() {
Z3_solver_pop(ctx(), s.s, 1);

MODIFY
smt/solver.h
smt/solver.h
@@ -50,6 +50,8 @@ public:
// WARNING: the parent Model class has to be alive while iterators are in use.
iterator begin() const;
iterator end() const;
+
+ friend std::ostream& operator<<(std::ostream &os, const Model &m);
};

add model printing operator<<