3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 12:08:18 +00:00
This commit is contained in:
Nikolaj Bjorner 2022-01-15 18:01:31 -08:00
parent 1b5f7cd9e5
commit bc9c6ad93d
3 changed files with 12 additions and 4 deletions

View file

@ -18,6 +18,7 @@ Author:
#include "sat/smt/pb_solver.h" #include "sat/smt/pb_solver.h"
#include "ast/pb_decl_plugin.h" #include "ast/pb_decl_plugin.h"
#include "sat/smt/euf_solver.h"
namespace pb { namespace pb {
@ -27,8 +28,12 @@ namespace pb {
literal solver::internalize(expr* e, bool sign, bool root, bool redundant) { literal solver::internalize(expr* e, bool sign, bool root, bool redundant) {
flet<bool> _redundant(m_is_redundant, redundant); flet<bool> _redundant(m_is_redundant, redundant);
if (m_pb.is_pb(e)) if (m_pb.is_pb(e)) {
return internalize_pb(e, sign, root); sat::literal lit = internalize_pb(e, sign, root);
if (m_ctx && !root && lit != sat::null_literal)
m_ctx->attach_lit(lit, e);
return lit;
}
UNREACHABLE(); UNREACHABLE();
return sat::null_literal; return sat::null_literal;
} }

View file

@ -1338,7 +1338,9 @@ namespace pb {
} }
solver::solver(euf::solver& ctx, euf::theory_id id) : solver::solver(euf::solver& ctx, euf::theory_id id) :
solver(ctx.get_manager(), ctx.get_si(), id) {} solver(ctx.get_manager(), ctx.get_si(), id) {
m_ctx = &ctx;
}
solver::solver(ast_manager& m, sat::sat_internalizer& si, euf::theory_id id) solver::solver(ast_manager& m, sat::sat_internalizer& si, euf::theory_id id)
: euf::th_solver(m, symbol("ba"), id), : euf::th_solver(m, symbol("ba"), id),

View file

@ -80,7 +80,8 @@ namespace pb {
sat::sat_internalizer& si; sat::sat_internalizer& si;
pb_util m_pb; pb_util m_pb;
sat::lookahead* m_lookahead{ nullptr }; sat::lookahead* m_lookahead = nullptr;
euf::solver* m_ctx = nullptr;
stats m_stats; stats m_stats;
small_object_allocator m_allocator; small_object_allocator m_allocator;