File tree Expand file tree Collapse file tree 3 files changed +45
-2
lines changed
regression/ebmc/show-formula Expand file tree Collapse file tree 3 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 1+ CORE
2+ show-formula1.smv
3+ --bound 2 --show-formula
4+ ^\(1\) smv::main::var::x@0 = 1$
5+ ^\(2\) smv::main::var::x@1 = 0$
6+ ^\(3\) smv::main::var::x@2 = 0$
7+ ^\(4\) smv::main::var::x@3 = 0$
8+ ^\(5\) ¬\(smv::main::var::x@0 = 1\)$
9+ ^ ∨ ¬\(smv::main::var::x@1 = 1\)$
10+ ^ ∨ ¬\(smv::main::var::x@2 = 1\)$
11+ ^EXIT=0$
12+ ^SIGNAL=0$
13+ --
Original file line number Diff line number Diff line change 1+ MODULE main
2+
3+ VAR x:0..1;
4+
5+ ASSIGN
6+ init(x) := 1;
7+ next(x) := 0;
8+
9+ SPEC AG x=1
Original file line number Diff line number Diff line change @@ -22,16 +22,37 @@ show_formula_solvert::show_formula_solvert()
2222
2323void show_formula_solvert::set_to (const exprt &expr, bool value)
2424{
25+ std::string number_str = ' (' + std::to_string (++conjunct_counter) + ' )' ;
26+
2527 if (console)
2628 out << consolet::faint;
2729
28- out << ' ( ' << (++conjunct_counter) << " ) " ;
30+ out << number_str << ' ' ;
2931
3032 if (console)
3133 out << consolet::reset;
3234
3335 if (value)
34- out << format (expr) << ' \n ' ;
36+ {
37+ // split up disjunctions into multiple lines for better readability
38+ if (expr.id () == ID_or)
39+ {
40+ bool first = true ;
41+ for (auto &op : expr.operands ())
42+ {
43+ if (first)
44+ first = false ;
45+ else
46+ out << std::string (number_str.size () - 1 , ' ' ) << " \u2228 " ;
47+
48+ out << format (op) << ' \n ' ;
49+ }
50+ }
51+ else
52+ {
53+ out << format (expr) << ' \n ' ;
54+ }
55+ }
3556 else
3657 out << format (not_exprt (expr)) << ' \n ' ;
3758}
You can’t perform that action at this time.
0 commit comments