@@ -40,24 +40,24 @@ class expr2smvt
4040
4141 // In NuSMV 2.6., ! (not) has a high precedence (above ::), whereas
4242 // in the CMU SMV implementation it has the same as other boolean operators.
43- // We use the CMU SMV precedence for !.
43+ // We use the NuSMV precedence for !.
4444 // Like CMU SMV, we give the same precedence to -> and <->, to avoid ambiguity.
4545 // Note that the precedence of mod in the CMU SMV differs from NuSMV's.
4646 // We use NuSMV's.
4747 enum class precedencet
4848 {
4949 MAX = 16 ,
5050 INDEX = 15 , // [ ] , [ : ]
51- CONCAT = 14 , // ::
51+ NOT = 14 , // !
5252 UMINUS = 13 , // - (unary minus)
53- MULT = 12 , // * / mod
54- PLUS = 11 , // + -
55- SHIFT = 10 , // << >>
56- UNION = 9 , // union
57- IN = 8 , // in
58- REL = 7 , // = != < > <= >=
59- TEMPORAL = 6 , // AX, AF, etc.
60- NOT = 5 , // !
53+ CONCAT = 12 , // ::
54+ MULT = 11 , // * / mod
55+ PLUS = 10 , // + -
56+ SHIFT = 9 , // << >>
57+ UNION = 8 , // union
58+ IN = 7 , // in
59+ REL = 6 , // = != < > <= >=
60+ TEMPORAL = 5 , // AX, AF, etc.
6161 AND = 4 , // &
6262 OR = 3 , // | xor xnor
6363 IF = 2 , // (• ? • : •)
@@ -79,6 +79,26 @@ class expr2smvt
7979 -> <->
8080 */
8181
82+ /* From https://nusmv.fbk.eu/userman/v27/nusmv.pdf
83+
84+ The order of parsing precedence for operators from high to low is:
85+ [ ] , [ : ]
86+ !
87+ - (unary minus)
88+ ::
89+ * / mod
90+ + -
91+ << >>
92+ union
93+ in
94+ = != < > <= >=
95+ &
96+ | xor xnor
97+ (• ? • : •)
98+ <->
99+ ->
100+ */
101+
82102 struct resultt
83103 {
84104 resultt (precedencet _p, std::string _s) : p(_p), s(std::move(_s))
0 commit comments