Geometrical representation of languages

Let \(L\) be the language of strings of length \(3\) over the alphabet \(\{0, 1, 2, 3\}\), made of pairwise distinct symbols. Each position is represented by a color: , and . The complex representing \(L\) is a torus. This example comes from [2, Figure 9].

[2] Maurice Herlihy and Nir Shavit. The topological structure of asynchronous computability. J. ACM, 46(6):858–923, November 1999.

Let's first show an unfold version of the complex, where the external edges are to be glued together:

After gluing, one obtains a torus: