It seems like Jandom uses real arithmetic rather than integer arithmetic when abstracting integer arithmetic operations. When I run numerical analysis (using BoxDouble domain) on Jimple code of JimpleTest.idiv() from Java examples, I get the following output:
static void idiv()
{
byte b0, b1;
int i2;
/*[ [ -∞ ≤ b0 ≤ +∞ , -∞ ≤ b1 ≤ +∞ , -∞ ≤ i2 ≤ +∞ ]types: byte,byte,int ]*/
b0 = 15;
/*[ [ b0 = 15.0 , -∞ ≤ b1 ≤ +∞ , -∞ ≤ i2 ≤ +∞ ]types: byte,byte,int ]*/
b1 = 2;
/*[ [ b0 = 15.0 , b1 = 2.0 , -∞ ≤ i2 ≤ +∞ ]types: byte,byte,int ]*/
i2 = b0 / b1;
/*[ [ b0 = 15.0 , b1 = 2.0 , i2 = 7.5 ]types: byte,byte,int ]*/
return;
}
/* Output: [ b0 = 15.0 , b1 = 2.0 , i2 = 7.5 ]types: byte,byte,int */
BoxDouble over reals and Parallelotope over rationals have different manifestations of the same issue as well.
It seems like Jandom uses real arithmetic rather than integer arithmetic when abstracting integer arithmetic operations. When I run numerical analysis (using
BoxDoubledomain) on Jimple code ofJimpleTest.idiv()from Java examples, I get the following output:Notice that the analysis concludes that
i2 = 7.5at the end buti2 = 7if you run the program because of integer division.BoxDouble over reals and Parallelotope over rationals have different manifestations of the same issue as well.