Skip to content

Commit 360436c

Browse files
authored
Merge pull request #1163 from diffblue/smv-not-parentheses
SMV: do not use parentheses around nullary operands of `!`
2 parents eb39b1a + c3eb12b commit 360436c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

regression/ebmc/smv-word-level/smv1.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ smv1.smv
1010
^INIT range_type = 1$
1111
^INIT signed_bit_vector = 0sd20_1$
1212
^INIT unsigned_bit_vector = 0ud20_1$
13-
^TRANS next\(bool_type\) = \(!\(bool_type\)\)$
13+
^TRANS next\(bool_type\) = \(!bool_type\)$
1414
^TRANS next\(range_type\) = 2$
1515
^TRANS next\(signed_bit_vector\) = 0sd20_2$
1616
^TRANS next\(unsigned_bit_vector\) = 0ud20_2$

src/smvlang/expr2smv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ expr2smvt::resultt expr2smvt::convert_unary(
419419
// clang-format off
420420
bool parentheses =
421421
op.operands().size() == 1 ? false
422-
: src.id() == ID_not ? true
422+
: src.id() == ID_not && !op.operands().empty() ? true
423423
: precedence >= op_rec.p;
424424
// clang-format on
425425

0 commit comments

Comments
 (0)