Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
btormc: Fix witness printing.
Browse files Browse the repository at this point in the history
Fixes #89.
  • Loading branch information
mpreiner committed Mar 25, 2020
1 parent 28f266a commit 9a13228
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/btormc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,9 +1122,10 @@ print_witness_at_time (BtorMC *mc, BoolectorNode *node, int32_t time)
}

static void
print_witness (BtorMC *mc, int32_t time)
print_witness (BtorMC *mc, int32_t time, size_t bad_id)
{
assert (time >= 0);
assert (BTOR_PEEK_STACK (mc->reached, bad_id) == time);

size_t i;
BtorMCstate *state;
Expand All @@ -1134,12 +1135,7 @@ print_witness (BtorMC *mc, int32_t time)

full_trace = btor_mc_get_opt (mc, BTOR_MC_OPT_TRACE_GEN_FULL) == 1;

printf ("sat\n");
for (i = 0; i < BTOR_COUNT_STACK (mc->reached); i++)
{
if (BTOR_PEEK_STACK (mc->reached, i) == time) printf ("b%zu ", i);
}
printf ("\n");
printf ("sat\nb%zu\n", bad_id);

for (i = 0; i <= (size_t) time; i++)
{
Expand Down Expand Up @@ -1410,7 +1406,9 @@ check_last_forward_frame (BtorMC *mc)
}

if (btor_mc_get_opt (mc, BTOR_MC_OPT_TRACE_GEN))
print_witness (mc, k);
{
print_witness (mc, k, i);
}
}
else
{
Expand Down

0 comments on commit 9a13228

Please sign in to comment.