Open JonathanFoo0523 opened 2 months ago
Do not perform the following mutations:
a != 0
-> a > 0
0 != a
-> 0 < a
a op 0
-> a < 0
(subsumed by false
)0 op a
-> 0 > a
(subsumed by false
)a op 0
-> a >= 0
(subsumed by true
)0 op a
-> a <= 0
(subsumed by true
)Am I missing anything else @JonathanFoo0523 @JamesLee-Jones?
Do not perform the following mutations:
a != 0
->a > 0
0 != a
->0 < a
a op 0
->a < 0
(subsumed byfalse
)0 op a
->0 > a
(subsumed byfalse
)a op 0
->a >= 0
(subsumed bytrue
)0 op a
->a <= 0
(subsumed bytrue
)Am I missing anything else @JonathanFoo0523 @JamesLee-Jones?
Also:
a == 0
-> a <= 0
(equivalent)
0 == a
-> 0 >= a
(equivalent)
Currently, for unsigned integer
a
, Dredd allow the mutation:to
Both expressions are equivalent. Since Dredd has the type information when traversing the AST, it should be possible to disallow such mutation.