Quotient of a formal language

In mathematics and computer science, the right quotient (or simply quotient) of a language with respect to language is the language consisting of strings such that is in for some string in , where and are defined on the same alphabet . Formally:[1][2]

where is the Kleene star on , and is the empty set.

In other words, for all strings in that have a suffix in , the suffix is removed.

Similarly, the left quotient of with respect to is the language consisting of strings such that is in for some string in . Formally:

In other words, for all strings in that have a prefix in , the prefix is removed.

Note that the operands of are in reverse order, so that preceeds .

The right and left quotients of with respect to may also be written as and respectively.[1][3]

Example

[edit]

Consider and

If an element of is split into two parts, then the right part will be in if and only if the split occurs somewhere after the final . Assuming this is the case, if the split occurs before the first then and , otherwise and . For instance:

where is the empty string.

Thus, the left part will be either or ), and can be written as:

Basic properties

[edit]

If are languages over the same alphabet then:[3]

Relationship between right and left quotients

[edit]

The right and left quotients of languages and are related through the language reversals and by the equalities:[3]

Proof

[edit]

To prove the first equality, let . Then there exists such that . Therefore, there must exist such that , hence by definition . It follows that , and so .

The second equality is proved in a similar manner.

Other properties

[edit]

Some common closure properties of the quotient operation include:

  • The quotient of a regular language with any other language is regular.
  • The quotient of a context free language with a regular language is context free.
  • The quotient of two context free languages can be any recursively enumerable language.
  • The quotient of two recursively enumerable languages is recursively enumerable.

These closure properties hold for both left and right quotients.

See also

[edit]

References

[edit]
  1. ^ a b Pin, J-É. (1986). Varieties of Formal Languages. Translated by Howie, A. New York: Plenum Press. p. 14. ISBN 0306422948.
  2. ^ Linz, Peter & Rodger, Susan H. (2023). An Introduction to Formal Languages and Automata (Seventh ed.). Burlington, MA: Jones & Bartlett Learning. pp. 112–117. ISBN 978-1284231601. (Fifth ed. at Google Books)
  3. ^ a b c Simovici, Dan A. (2024). Introduction to the Theory of Formal Languages. Singapore: World Scientific. pp. 11–12. doi:10.1142/13862. ISBN 978-9811294013.