-
|
There are some things confusing for me, so I want to clarify them.
Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi, 1-1. x = input();
y = 0;
x = x / y; // L1
x = x / y; // L2Suppose we define 1-2. 2-1. Let us assume boolean values are 0 and 1, for simplicity. 2-2.
|
Beta Was this translation helpful? Give feedback.
-
|
Oh, actually each question is not divided by subquestions. Sorry for the confusion... |
Beta Was this translation helpful? Give feedback.
Hi,
1-1.
The output of the abstract semantics of div is defined as top when the divisor can be potentially zero.This design choice is for practical uses of analyzers. For example,
Suppose we define
X / 0is bottom. It is theoretically ok. But the analyzer can catch the bug at L1 only. It is also theoretically ok because L2 will be never executed. However, here we want to report both of them. So, it is top in our design. Of course this is theoretically correct, because Bot <= Top.1-2.
Bot / 0Think about when it would happen. Also similarly, both Top or Bottom would be a reasonable choice. However, TAs will not test your code that…