Skip to content
Discussion options

You must be logged in to vote

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,

x = input();
y = 0;
x = x / y;   // L1
x = x / y;   // L2

Suppose we define X / 0 is 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 / 0
Think about when it would happen. Also similarly, both Top or Bottom would be a reasonable choice. However, TAs will not test your code that…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by doit-man
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #34 on May 31, 2024 05:24.