Skip to content

Commit bd3e3a1

Browse files
authored
Merge pull request #1383 from diffblue/smv-bitnot
SMV: bitwise negation operator
2 parents 857e19f + e3dce9f commit bd3e3a1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

regression/smv/word/bitwise1.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
bitwise1.smv
33

4-
^\[.*\] !\(0ud8_123 = 0ud8_132\): PROVED .*$
5-
^\[.*\] !\(0sd8_123 = -0sd8_124\): PROVED .*$
4+
^\[.*\] \(!0ud8_123\) = 0ud8_132: PROVED .*$
5+
^\[.*\] \(!0sd8_123\) = -0sd8_124: PROVED .*$
66
^\[.*\] \(0ud8_123 \& 0ud8_7\) = 0ud8_3: PROVED .*$
77
^\[.*\] \(0ud8_123 \| 0ud8_7\) = 0ud8_127: PROVED .*$
88
^\[.*\] \(0ud8_123 xor 0ud8_7\) = 0ud8_124: PROVED .*$

regression/smv/word/bitwise1.smv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
MODULE main
22

33
-- negation
4-
SPEC !uwconst(123, 8) = uwconst(132, 8)
5-
SPEC !swconst(123, 8) = swconst(-124, 8)
4+
SPEC (!uwconst(123, 8)) = uwconst(132, 8)
5+
SPEC (!swconst(123, 8)) = swconst(-124, 8)
66

77
-- and
88
SPEC (uwconst(123, 8) & uwconst(7, 8)) = uwconst(3, 8)

src/smvlang/expr2smv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,8 @@ expr2smvt::resultt expr2smvt::convert_rec(const exprt &src)
771771
else if(src.id()==ID_notequal)
772772
return convert_binary(to_notequal_expr(src), "!=", precedencet::REL);
773773

774-
else if(src.id()==ID_not)
775-
return convert_unary(to_not_expr(src), "!", precedencet::NOT);
774+
else if(src.id() == ID_not || src.id() == ID_bitnot)
775+
return convert_unary(to_unary_expr(src), "!", precedencet::NOT);
776776

777777
else if(src.id() == ID_and || src.id() == ID_bitand)
778778
return convert_binary_associative(src, "&", precedencet::AND);

0 commit comments

Comments
 (0)