Skip to content

Commit 09a7989

Browse files
author
Daniel Kroening
committed
print disjuncts in Gentzen sequent separately
Rationale: This avoids a long "{1}" line and matches the usual definition of the Gentzen sequent.
1 parent cc4347d commit 09a7989

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

regression/cbmc/show-vcc/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
int main()
2+
{
3+
__CPROVER_bool a, b, c, d;
4+
__CPROVER_assume(a);
5+
__CPROVER_assume(b);
6+
__CPROVER_assert(c || d, "some property");
7+
}

regression/cbmc/show-vcc/test.desc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
main.c
3+
--show-vcc
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^some property$
7+
^\{-.*\} a!0@1#1$
8+
^\{-.*\} b!0@1#1$
9+
^\{1\} c!0@1#1$
10+
^\{2\} d!0@1#1$
11+
--

src/goto-symex/show_vcc.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,22 @@ void show_vcc_plain(
8383
out << u8"\u2500";
8484
out << '\n';
8585

86-
std::string string_value =
87-
from_expr(ns, s_it->source.pc->function, s_it->cond_expr);
88-
out << "{" << 1 << "} " << string_value << "\n";
86+
// split property into multiple disjunts, if applicable
87+
exprt::operandst disjuncts;
88+
89+
if(s_it->cond_expr.id() == ID_or)
90+
disjuncts = to_or_expr(s_it->cond_expr).operands();
91+
else
92+
disjuncts.push_back(s_it->cond_expr);
93+
94+
std::size_t count = 1;
95+
for(const auto &disjunct : disjuncts)
96+
{
97+
std::string string_value =
98+
from_expr(ns, s_it->source.pc->function, disjunct);
99+
out << "{" << count << "} " << string_value << "\n";
100+
count++;
101+
}
89102
}
90103
}
91104

0 commit comments

Comments
 (0)