Consider the statement "if P(x) then x:=1" which is equivalent to "if x>1 then x:=1"
a) If x=0, then the statement P(0)="0>1" is false, and thus the value of x is equal to 0 after the statement "if P(x) then x:=1".
b) If x=1, then the statement P(1)="1>1" is false, and thus the value of x is equal to 1 after the statement "P(x) then x := 1".
c) If x=2, then the statement P(2)="2>1" is true, and thus the value of x is equal to 1 after the statement "if P(x) then x := 1".
Comments
Leave a comment