For formal languages over the same alphabet, concatenate each word over an alphabet in with each word over an alphabet in . This operation is associative, has identity and absorbing element the empty language.
Use state elimination for finite automata on a generalized finite automaton, whose directed edges are labelled by regular expressions. Add a fresh initial state with an -edge to the old initial state and a fresh final state with -edges from all old accepting states. Every missing edge has label , the empty language; parallel edges are merged by union. The label denotes the language containing just the empty word.
When eliminating a state , replace the label on each surviving edge by
Here juxtaposition means concatenation of formal languages, and the Kleene star allows zero or more traversals of the loop at . Then delete and its incident edges. Eliminate every original state; the remaining label is a regular expression for exactly the accepted formal language. The update accounts for paths avoiding and paths entering , looping there any number of times, and leaving it.