From Dictatorship To Democracy

Is it possible to codify the process of overthrowing your dictator?