A Theory of Catastrophe