Skip to content

Commit

Permalink
numbered trace output now includes number of states
Browse files Browse the repository at this point in the history
This enables writing tests that check the length of the witness trace.
  • Loading branch information
kroening committed Apr 22, 2024
1 parent d3071f4 commit f552b6e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions regression/ebmc/smv/smv_ltlspec3.desc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ smv_ltlspec3.smv
^EXIT=10$
^SIGNAL=0$
^\[main::spec1\] X X main::var::x = TRUE: REFUTED$
^Counterexample with 3 states:$
^main::var::x@0 = FALSE$
^main::var::x@1 = FALSE$
^main::var::x@2 = FALSE$
Expand Down
2 changes: 1 addition & 1 deletion regression/ebmc/traces/numbered1.desc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ waveform1.smv
^EXIT=10$
^SIGNAL=0$
^\[main::spec1\] .* REFUTED$
^Counterexample:$
^Counterexample with 21 states:$
^main::var::y@0 = 0$
^main::var::y@10 = 100$
^main::var::y@20 = 200$
Expand Down
2 changes: 1 addition & 1 deletion regression/verilog/SVA/cover1.desc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CORE
cover1.sv
--bound 10 --numbered-trace
^\[main\.property\.p0\] cover main\.counter == 1: PROVED$
^Trace:$
^Trace with 2 states:$
^main\.counter@0 = 0$
^main\.counter@1 = 1$
^\[main\.property\.p1\] cover main\.counter == 100: REFUTED up to bound 10$
Expand Down
12 changes: 11 additions & 1 deletion src/ebmc/report_results.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,17 @@ void report_results(
}
else if(cmdline.isset("numbered-trace"))
{
message.status() << term() << ":" << messaget::eom;
message.status() << term();
auto failing_opt =
property.witness_trace->get_min_failing_timeframe();
if(failing_opt.has_value())
{
if(*failing_opt == 0)
message.status() << " with 1 state";
else
message.status() << " with " << *failing_opt + 1 << " states";
}
message.status() << ':' << messaget::eom;
show_trans_trace_numbered(
property.witness_trace.value(), message, ns, std::cout);
}
Expand Down

0 comments on commit f552b6e

Please sign in to comment.