mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
rename card->pb
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
2b2d0e155c
commit
ee0abfbfe9
13 changed files with 79 additions and 79 deletions
|
@ -53,7 +53,7 @@ Notes:
|
|||
namespace smt {
|
||||
|
||||
theory_card::theory_card(ast_manager& m):
|
||||
theory(m.mk_family_id("card")),
|
||||
theory(m.mk_family_id("pb")),
|
||||
m_util(m)
|
||||
{}
|
||||
|
||||
|
@ -79,7 +79,7 @@ namespace smt {
|
|||
|
||||
m_stats.m_num_predicates++;
|
||||
|
||||
TRACE("card", tout << "internalize: " << mk_pp(atom, m) << "\n";);
|
||||
TRACE("pb", tout << "internalize: " << mk_pp(atom, m) << "\n";);
|
||||
|
||||
SASSERT(!ctx.b_internalized(atom));
|
||||
bool_var abv = ctx.mk_bool_var(atom);
|
||||
|
@ -370,7 +370,7 @@ namespace smt {
|
|||
int max = c.m_current_max;
|
||||
int k = c.m_k;
|
||||
|
||||
TRACE("card",
|
||||
TRACE("pb",
|
||||
tout << mk_pp(c.m_app, m) << " min: "
|
||||
<< min << " max: " << max << "\n";);
|
||||
|
||||
|
@ -474,7 +474,7 @@ namespace smt {
|
|||
ast_manager& m = get_manager();
|
||||
ptr_vector<card>* cards = 0;
|
||||
card* c = 0;
|
||||
TRACE("card", tout << "assign: " << mk_pp(ctx.bool_var2expr(v), m) << " <- " << is_true << "\n";);
|
||||
TRACE("pb", tout << "assign: " << mk_pp(ctx.bool_var2expr(v), m) << " <- " << is_true << "\n";);
|
||||
|
||||
if (m_watch.find(v, cards)) {
|
||||
for (unsigned i = 0; i < cards->size(); ++i) {
|
||||
|
@ -618,7 +618,7 @@ namespace smt {
|
|||
add_clause(~l, a, c);
|
||||
add_clause(l, ~a, ~b);
|
||||
add_clause(l, a, ~c);
|
||||
TRACE("card", tout << p << " ::= (if ";
|
||||
TRACE("pb", tout << p << " ::= (if ";
|
||||
ctx.display_detailed_literal(tout, a);
|
||||
ctx.display_detailed_literal(tout << " ", b);
|
||||
ctx.display_detailed_literal(tout << " ", c);
|
||||
|
@ -635,7 +635,7 @@ namespace smt {
|
|||
if (b != null_literal) lits.push_back(b);
|
||||
if (c != null_literal) lits.push_back(c);
|
||||
justification* js = 0;
|
||||
TRACE("card",
|
||||
TRACE("pb",
|
||||
ctx.display_literals_verbose(tout, lits.size(), lits.c_ptr()); tout << "\n";);
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX, 0);
|
||||
}
|
||||
|
@ -656,7 +656,7 @@ namespace smt {
|
|||
++log;
|
||||
n *= 2;
|
||||
}
|
||||
TRACE("card", tout << "threshold:" << (num_args*log) << "\n";);
|
||||
TRACE("pb", tout << "threshold:" << (num_args*log) << "\n";);
|
||||
return num_args*log;
|
||||
}
|
||||
|
||||
|
@ -696,12 +696,12 @@ namespace smt {
|
|||
}
|
||||
sn(in, out);
|
||||
atmostk = ~se.internalize(c, out[k].get()); // k'th output is 0.
|
||||
TRACE("card", tout << "~atmost: " << mk_pp(out[k].get(), m) << "\n";);
|
||||
TRACE("pb", tout << "~atmost: " << mk_pp(out[k].get(), m) << "\n";);
|
||||
}
|
||||
literal thl = literal(c.m_bv);
|
||||
se.add_clause(~thl, atmostk);
|
||||
se.add_clause(thl, ~atmostk);
|
||||
TRACE("card", tout << mk_pp(a, m) << "\n";);
|
||||
TRACE("pb", tout << mk_pp(a, m) << "\n";);
|
||||
// auxiliary clauses get removed when popping scopes.
|
||||
// we have to recompile the circuit after back-tracking.
|
||||
ctx.push_trail(value_trail<context, bool>(c.m_compiled));
|
||||
|
@ -760,7 +760,7 @@ namespace smt {
|
|||
++c.m_num_propagations;
|
||||
m_stats.m_num_axioms++;
|
||||
context& ctx = get_context();
|
||||
TRACE("card", tout << "#prop:" << c.m_num_propagations << " - "; ctx.display_literals_verbose(tout, lits.size(), lits.c_ptr()); tout << "\n";);
|
||||
TRACE("pb", tout << "#prop:" << c.m_num_propagations << " - "; ctx.display_literals_verbose(tout, lits.size(), lits.c_ptr()); tout << "\n";);
|
||||
justification* js = 0;
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
|
||||
IF_VERBOSE(2, ctx.display_literals_verbose(verbose_stream(),
|
||||
|
|
|
@ -21,7 +21,7 @@ Notes:
|
|||
--*/
|
||||
|
||||
#include "smt_theory.h"
|
||||
#include "card_decl_plugin.h"
|
||||
#include "pb_decl_plugin.h"
|
||||
#include "smt_clause.h"
|
||||
|
||||
namespace smt {
|
||||
|
@ -69,7 +69,7 @@ namespace smt {
|
|||
unsigned_vector m_watch_trail;
|
||||
unsigned_vector m_watch_lim;
|
||||
literal_vector m_literals;
|
||||
card_util m_util;
|
||||
pb_util m_util;
|
||||
stats m_stats;
|
||||
|
||||
void add_watch(bool_var bv, card* c);
|
||||
|
|
|
@ -208,7 +208,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
theory_pb::theory_pb(ast_manager& m):
|
||||
theory(m.mk_family_id("card")),
|
||||
theory(m.mk_family_id("pb")),
|
||||
m_util(m),
|
||||
m_lemma(null_literal)
|
||||
{}
|
||||
|
@ -263,7 +263,7 @@ namespace smt {
|
|||
// fall-through
|
||||
case l_true:
|
||||
ctx.mk_th_axiom(get_id(), 1, &lit);
|
||||
TRACE("card", tout << mk_pp(atom, m) << " := " << lit << "\n";);
|
||||
TRACE("pb", tout << mk_pp(atom, m) << " := " << lit << "\n";);
|
||||
dealloc(c);
|
||||
return true;
|
||||
case l_undef:
|
||||
|
@ -293,7 +293,7 @@ namespace smt {
|
|||
}
|
||||
unsigned th = 10*args.size()*log;
|
||||
c->m_compilation_threshold = th;
|
||||
TRACE("card", tout << "compilation threshold: " << th << "\n";);
|
||||
TRACE("pb", tout << "compilation threshold: " << th << "\n";);
|
||||
}
|
||||
else {
|
||||
c->m_compilation_threshold = UINT_MAX;
|
||||
|
@ -301,7 +301,7 @@ namespace smt {
|
|||
m_ineqs.insert(abv, c);
|
||||
m_ineqs_trail.push_back(abv);
|
||||
|
||||
TRACE("card", display(tout, *c););
|
||||
TRACE("pb", display(tout, *c););
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
final_check_status theory_pb::final_check_eh() {
|
||||
TRACE("card", display(tout););
|
||||
TRACE("pb", display(tout););
|
||||
DEBUG_CODE(validate_final_check(););
|
||||
return FC_DONE;
|
||||
}
|
||||
|
@ -459,7 +459,7 @@ namespace smt {
|
|||
break;
|
||||
}
|
||||
}
|
||||
TRACE("card", display(tout << "validate: ", c);
|
||||
TRACE("pb", display(tout << "validate: ", c);
|
||||
tout << "sum: " << sum << " " << maxsum << " " << ctx.get_assignment(c.lit()) << "\n";
|
||||
);
|
||||
|
||||
|
@ -472,7 +472,7 @@ namespace smt {
|
|||
void theory_pb::assign_eh(bool_var v, bool is_true) {
|
||||
context& ctx = get_context();
|
||||
ptr_vector<ineq>* ineqs = 0;
|
||||
TRACE("card", tout << "assign: " << literal(v, !is_true) << "\n";);
|
||||
TRACE("pb", tout << "assign: " << literal(v, !is_true) << "\n";);
|
||||
|
||||
if (m_watch.find(v, ineqs)) {
|
||||
for (unsigned i = 0; i < ineqs->size(); ++i) {
|
||||
|
@ -538,7 +538,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
TRACE("card",
|
||||
TRACE("pb",
|
||||
tout << "assign: " << c.lit() << " <- " << is_true << "\n";
|
||||
display(tout, c); );
|
||||
|
||||
|
@ -636,7 +636,7 @@ namespace smt {
|
|||
//
|
||||
// else: the current set of watch remain a potentially feasible assignment.
|
||||
//
|
||||
TRACE("card",
|
||||
TRACE("pb",
|
||||
tout << "assign: " << literal(v) << " <- " << is_true << "\n";
|
||||
display(tout, c); );
|
||||
|
||||
|
@ -748,7 +748,7 @@ namespace smt {
|
|||
add_clause(~l, a, c);
|
||||
add_clause(l, ~a, ~b);
|
||||
add_clause(l, a, ~c);
|
||||
TRACE("card", tout << mk_pp(t, m) << " ::= (if ";
|
||||
TRACE("pb", tout << mk_pp(t, m) << " ::= (if ";
|
||||
ctx.display_detailed_literal(tout, a);
|
||||
ctx.display_detailed_literal(tout << " ", b);
|
||||
ctx.display_detailed_literal(tout << " ", c);
|
||||
|
@ -765,7 +765,7 @@ namespace smt {
|
|||
if (b != null_literal) lits.push_back(b);
|
||||
if (c != null_literal) lits.push_back(c);
|
||||
justification* js = 0;
|
||||
TRACE("card",
|
||||
TRACE("pb",
|
||||
ctx.display_literals_verbose(tout, lits.size(), lits.c_ptr()); tout << "\n";);
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX, 0);
|
||||
}
|
||||
|
@ -815,12 +815,12 @@ namespace smt {
|
|||
}
|
||||
sn(in, out);
|
||||
literal at_least_k = se.internalize(c, out[k-1].get()); // first k outputs are 1.
|
||||
TRACE("card", tout << "at_least: " << mk_pp(out[k-1].get(), m) << "\n";);
|
||||
TRACE("pb", tout << "at_least: " << mk_pp(out[k-1].get(), m) << "\n";);
|
||||
|
||||
literal thl = c.lit();
|
||||
se.add_clause(~thl, at_least_k);
|
||||
se.add_clause(thl, ~at_least_k);
|
||||
TRACE("card", tout << c.lit() << "\n";);
|
||||
TRACE("pb", tout << c.lit() << "\n";);
|
||||
// auxiliary clauses get removed when popping scopes.
|
||||
// we have to recompile the circuit after back-tracking.
|
||||
c.m_compiled = l_false;
|
||||
|
@ -938,7 +938,7 @@ namespace smt {
|
|||
inc_propagations(c);
|
||||
m_stats.m_num_propagations++;
|
||||
context& ctx = get_context();
|
||||
TRACE("card", tout << "#prop:" << c.m_num_propagations << " - ";
|
||||
TRACE("pb", tout << "#prop:" << c.m_num_propagations << " - ";
|
||||
for (unsigned i = 0; i < lits.size(); ++i) {
|
||||
tout << lits[i] << " ";
|
||||
}
|
||||
|
@ -956,7 +956,7 @@ namespace smt {
|
|||
inc_propagations(c);
|
||||
m_stats.m_num_conflicts++;
|
||||
context& ctx = get_context();
|
||||
TRACE("card", tout << "#prop:" << c.m_num_propagations << " - ";
|
||||
TRACE("pb", tout << "#prop:" << c.m_num_propagations << " - ";
|
||||
for (unsigned i = 0; i < lits.size(); ++i) {
|
||||
tout << lits[i] << " ";
|
||||
}
|
||||
|
@ -1110,7 +1110,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
|
||||
TRACE("card", display(tout, m_lemma););
|
||||
TRACE("pb", display(tout, m_lemma););
|
||||
|
||||
IF_VERBOSE(1, display(verbose_stream(), m_lemma););
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ Notes:
|
|||
--*/
|
||||
|
||||
#include "smt_theory.h"
|
||||
#include "card_decl_plugin.h"
|
||||
#include "pb_decl_plugin.h"
|
||||
#include "smt_clause.h"
|
||||
|
||||
namespace smt {
|
||||
|
@ -105,7 +105,7 @@ namespace smt {
|
|||
ptr_vector<ineq> m_assign_ineqs_trail;
|
||||
unsigned_vector m_assign_ineqs_lim;
|
||||
literal_vector m_literals; // temporary vector
|
||||
card_util m_util;
|
||||
pb_util m_util;
|
||||
stats m_stats;
|
||||
ptr_vector<ineq> m_to_compile; // inequalities to compile.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue