This is not my homework -- I'm just practicing. I can't seem to wrap my mind around this assertion concept. Help would be appreciated! thanks
1 2 3 4 5 6 7 8 9 10
1) Determine the pre-condition for x that guarantees the post-condition about y
{ _______ }
if (x > 0)
y = x;
else
y = -x;
{ y >= 0 && |y| == |x| }
2) This code is the same as has been seen before, but the post-condition is different.
Describe why this post-condition is better for verifying the code than just { y >= 0}.