In fact, BF theory can be used to formulate discrete gauge theory. One can add additional twist terms allowed by group cohomology theory such as Dijkgraaf – Witten topological gauge theory. There are many kinds of modified BF theories as topological field theories, which give rise to link invariants in 3 dimensions, 4 dimensions, and other general dimensions.