3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 10:25:18 +00:00

another unit test for Nuno

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-10-03 16:58:46 -07:00
parent 2bf0b5f33f
commit f3d2535b46
3 changed files with 32 additions and 2 deletions

View file

@ -94,7 +94,6 @@ namespace Microsoft.Z3
/// <summary>
/// Retrieves an assignment to atomic propositions for a satisfiable context.
/// </summary>
/// <seealso cref="Pop"/>
public static BoolExpr GetAssignment(Context ctx)
{
IntPtr x = Native.Z3_get_context_assignment(ctx.nCtx);

View file

@ -356,9 +356,9 @@ public:
while (index < asms.size() && is_sat == l_true) {
while (asms.size() > 20*(index - last_index) && index < asms.size()) {
index = next_index(asms, index);
//std::cout << "weight: " << get_weight(asms[index-1].get()) << "\n";
//break;
}
IF_VERBOSE(3, verbose_stream() << "weight: " << get_weight(asms[0].get()) << " " << get_weight(asms[index-1].get()) << "\n";);
last_index = index;
is_sat = s().check_sat(index, asms.c_ptr());
}

View file

@ -146,6 +146,8 @@ public:
test_filter_neg4(false);
test_filter_neg4(true);
test_filter_neg6(false);
test_filter_neg6(true);
test_filter_neg();
test_filter_neg2();
@ -658,6 +660,35 @@ public:
neg->deallocate();
}
void test_filter_neg5(bool disable_fast) {
relation_signature sig1, sig2;
sig1.push_back(bv.mk_sort(2));
sig1.push_back(bv.mk_sort(2));
sig2.push_back(bv.mk_sort(2));
sig2.push_back(bv.mk_sort(2));
sig2.push_back(bv.mk_sort(2));
unsigned_vector cols1, cols2, cols3;
cols1.push_back(0);
cols1.push_back(1);
cols2.push_back(0);
cols2.push_back(2);
cols3.push_back(0);
cols3.push_back(1);
cols3.push_back(2);
udoc_relation* tgt = mk_full(sig1);
udoc_relation* neg = mk_full(sig2);
rel_mut filter_id = p.mk_filter_identical_fn(*tgt, cols3.size(), cols3.c_ptr());
(*filter_id)(*tgt);
if (disable_fast) p.disable_fast_pass();
apply_filter_neg(*tgt, *neg, cols1, cols2);
tgt->deallocate();
neg->deallocate();
}
// TBD: unit test to expose similar bug as projection had.
// you can't just remove columns when there are side-constraints in neg.
void set_random(udoc_relation& r, unsigned num_vals) {
unsigned num_bits = r.get_dm().num_tbits();
udoc_relation* full = mk_full(r.get_signature());