Quotient of a formal language

From HandWiki

In mathematics and computer science, the right quotient (or simply quotient) of a language L1 with respect to language L2 is the language consisting of strings w such that wx is in L1 for some string x in L2.[1] Formally: L1/L2={wΣ*xL2: wxL1}

In other words, we take all the strings in L1 that have a suffix in L2, and remove this suffix.

Similarly, the left quotient of L1 with respect to L2 is the language consisting of strings w such that xw is in L1 for some string x in L2. Formally: L2L1={wΣ*xL2: xwL1}

In other words, we take all the strings in L1 that have a prefix in L2, and remove this prefix.

Note that the operands of are in reverse order: the first operand is L2 and L1 is second.

Example

Consider L1={anbncnn0} and L2={bicji,j0}.

Now, if we insert a divider into an element of L1, the part on the right is in L2 only if the divider is placed adjacent to a b (in which case i ≤ n and j = n) or adjacent to a c (in which case i = 0 and j ≤ n). The part on the left, therefore, will be either anbni or anbncnj; and L1/L2 can be written as { apbqcr  p=qr  or  (pq and r=0) }.

Properties

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

References

  1. Linz, Peter (2011). An Introduction to Formal Languages and Automata. Jones & Bartlett Publishers. pp. 104–108. ISBN 9781449615529. https://books.google.com/books?id=hsxDiWvVdBcC&dq=right+quotient+automata&pg=PA104. Retrieved 7 July 2014.