  An action principle is described which unifies general relativity and
topological field theory. An additional degree of freedom is introduced and
depending on the value it takes the theory has solutions that reduce it to 1)
general relativity in Palatini form, 2) general relativity in the Ashtekar
form, 3) $F\wedge F$ theory for SO(5) and 4) $BF$ theory for SO(5). This theory
then makes it possible to describe explicitly the dynamics of phase transition
between a topological phase and a gravitational phase where the theory has
local degrees of freedom. We also find that a boundary between adymnamical and
topological phase resembles an horizon.
