What is the point of a constant (thus known) inflation rate? I have read somewhere (attributed to Milton Friedman) that a good practice of monetary policy is to maintain a constant inflation rate (of 3% per annum, say). What is the point of that? If everyone knows the constant inflation rate, would they not factor that in when pricing goods and thereby effectively eliminate the inflation?

As a toy example, suppose the Feb maintains the money supply $M(t)=M(0)e^{at}$ at time $t$ for some constant $a$ known to people. Then people will price the goods (including debts) $P(t)=P(0)e^{at}$ at time $t$ where $P:=(p_1,p_2,\cdots,p_n)$ is a vector of prices for $n$ goods. Then the ratio of the prices $P/p(1)=(1,\frac{p_2}{p_1},\cdots,\frac{p_n}{p_1})$ remains the same. What is the point of the targeted inflation? 

I can think of one justification in a particular scenario for setting a target but of the money supply rather than of inflation which is the increment in price. If we know the quantity, so to speak, of the economy is growing at $Q(t)=Q(0)e^{at}$. Then it makes sense to increase the money supply as described above, so that people can still price the goods at $P(t)=P(0)$. But this is no price inflation. Besides, if the money supply is held constant and the quantity grow rate is known, people can just price the goods at $P(t)=P(0)e^{-at}$ and the price ratio still remains unchanged. I do not see the harm in price deflation. 

The possible flaw in this setup is that the "speed" of the diffusion of the physical monetary supply amongst the non-bank entities is no greater than the "speed" of the transaction. We can eliminate this flaw and achieve infinite monetary diffusion speed and simultaneity of inflation by bringing all transactions onto digital platforms. People can set their algorithms to increase the prices at the target rate.

This question is related but different from the question Is zero inflation desirable?. The latter asked about the effect of keeping inflation at zero. My question asks whether targetting an inflation rate not necessarily zero that is to be known to all people is any different from zero inflation and its desirability.
As I understand it, your question is the following:

Assuming that the rate is inflation is known by all in advance, does it matter what rate of inflation we set?

The answer to this question is 'yes'. For one thing, even if inflation is predictable, it transfers resources from holders of cash to the government or monetary authority ('seigniorage'). As a result, people may try to hold less cash, which means they need make more trips to the bank (leading to 'shoe leather costs').

Thus, contrary to the supposed lesson of your 'toy model', perfectly predictable inflation can have real effects.

However, you are right to emphasise that the importance of predictability: unpredicted inflation often has effects that predicted inflation does not. For example, consider the common claim that an increase in inflation is good for borrowers and bad for lenders. If unpredicted, that is certainly true. But if predicted by all in advance, one might expect the increase to simply drive up nominal interest rates, leaving the real interest rate unchanged.