File tree Expand file tree Collapse file tree 3 files changed +21
-6
lines changed
Expand file tree Collapse file tree 3 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ range_type4.smv
33--bound 10
44^EXIT=0$
55^SIGNAL=0$
6- ^\[spec1\] AG \(! x = 6\): PROVED up to bound 10$
6+ ^\[spec1\] AG !\( x = 6\): PROVED up to bound 10$
77--
88^warning: ignoring
Original file line number Diff line number Diff line change 11CORE
22bitwise1.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$
Original file line number Diff line number Diff line change @@ -227,13 +227,28 @@ expr2smvt::resultt expr2smvt::convert_unary(
227227 const std::string &symbol,
228228 precedencet precedence)
229229{
230- auto op_rec = convert_rec (src.op ());
230+ auto &op = src.op ();
231+
232+ auto op_rec = convert_rec (op);
233+
234+ // We special-case negation (!), since the precedence
235+ // of this operator changed between CMU SMV and NuSMV.
236+
237+ // clang-format off
238+ bool parentheses =
239+ op.operands ().size () == 1 ? false
240+ : src.id () == ID_not ? true
241+ : precedence >= op_rec.p ;
242+ // clang-format on
231243
232244 std::string dest = symbol;
233- if (precedence > op_rec.p )
245+
246+ if (parentheses)
234247 dest += ' (' ;
248+
235249 dest += op_rec.s ;
236- if (precedence > op_rec.p )
250+
251+ if (parentheses)
237252 dest += ' )' ;
238253
239254 return {precedence, std::move (dest)};
You can’t perform that action at this time.
0 commit comments