De Morgan's Law
Does x!=0 simplify to x>0?
No that's not true. Because integers are signed.
How to simplify :
!(x!=0 || y !=0)
?
Consider this rules :
(second De Morgan's laws )
By 1., it implies
!(x!=0 || y !=0) <=> (!(x!=0)) && (!(y != 0))
By 2., it implies
(!(x!=0)) && (!(y != 0)) <=> (x == 0) && (y == 0)
To test you can write the following loop :
for(int x = -5; x < 5; x++){
for(int y = -5; y < 5; y++){
if(!(x!=0 || y !=0))
System.out.println("True : ("+x+","+y+")");
}
}
DeMorgans Law states the following:
!(A & B) = !A | !B (I)
!(A | B) = !A & !B (II)
In your case (II)
applies: !(x!=0 || y!=0)
=> !(x!=0) && !(y!=0)
=> (x==0) && (y==0)
PS: Your question: "Does x!=0 simplify to x>0?" can be answered with "no" unless x can not take negative values (for example if the type of x is unsigned).