Hello evryone! In the text below is a program that I can't make.Please help me!
Synthesize a program, wich calculates the number of bits
in n(number wich is in binary code).The template of the program is:
{Q:(1<=n)}
S(initially);
{inv P:(1<=m)and(m*2^j-1<=n<m*2^j+1)}
{bound t:m-1}
do B -> S od
{R:2^j-1<=n<2^j+1}
Transform the program in Pascal or ASML.
If you only know the algorithum of calculating bits in an integer I'll be thankful!