Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions regression/ebmc/show-formula/show-formula1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CORE
show-formula1.smv
--bound 2 --show-formula
^\(1\) smv::main::var::x@0 = 1$
^\(2\) smv::main::var::x@1 = 0$
^\(3\) smv::main::var::x@2 = 0$
^\(4\) smv::main::var::x@3 = 0$
^\(5\) ¬\(smv::main::var::x@0 = 1\)$
^ ∨ ¬\(smv::main::var::x@1 = 1\)$
^ ∨ ¬\(smv::main::var::x@2 = 1\)$
^EXIT=0$
^SIGNAL=0$
--
9 changes: 9 additions & 0 deletions regression/ebmc/show-formula/show-formula1.smv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MODULE main

VAR x:0..1;

ASSIGN
init(x) := 1;
next(x) := 0;

SPEC AG x=1
25 changes: 23 additions & 2 deletions src/ebmc/show_formula_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,37 @@ show_formula_solvert::show_formula_solvert()

void show_formula_solvert::set_to(const exprt &expr, bool value)
{
std::string number_str = '(' + std::to_string(++conjunct_counter) + ')';

if(console)
out << consolet::faint;

out << '(' << (++conjunct_counter) << ") ";
out << number_str << ' ';

if(console)
out << consolet::reset;

if(value)
out << format(expr) << '\n';
{
// split up disjunctions into multiple lines for better readability
if(expr.id() == ID_or)
{
bool first = true;
for(auto &op : expr.operands())
{
if(first)
first = false;
else
out << std::string(number_str.size() - 1, ' ') << "\u2228 ";

out << format(op) << '\n';
}
}
else
{
out << format(expr) << '\n';
}
}
else
out << format(not_exprt(expr)) << '\n';
}
Expand Down
Loading