Prove that the program IntLog(x,b) below
is correct with respect to the given specification.
Precondition:
x,b
N, x≥1, b≥2.
Postcondition:
IntLog(x,b) returns the integer logarithm of x base b.
IntLog(x,b)
i:=0
t:=1
while b*t ≤ x do
i := i+1
t := t*b
end while
return i
solution in postscript or PDF (don't look until you've worked on it!)