Published online by Cambridge University Press: 03 June 2008
A compatibility relation on letters induces a reflexive andsymmetric relation on words of equal length. We consider these wordrelations with respect to the theory of variable length codes andfree monoids. We define an (R,S)-code and an (R,S)-free monoidfor arbitrary word relations R and S. ModifiedSardinas-Patterson algorithm is presented for testing whether finitesets of words are (R,S)-codes. Coding capabilities of relationalcodes are measured algorithmically by finding minimal and maximalrelations. We generalize the stability criterion of Schützenbergerand Tilson's closure result for (R,S)-free monoids. The(R,S)-free hull of a set of words is introduced and we show how itcan be computed. We prove a defect theorem for (R,S)-free hulls.In addition, a defect theorem of partial words is proved as acorollary.