In
mathematics
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
and
computer science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, ...
, the right quotient (or simply quotient) of a
language
Language is a structured system of communication that consists of grammar and vocabulary. It is the primary means by which humans convey meaning, both in spoken and signed language, signed forms, and may also be conveyed through writing syste ...
with respect to language
is the language consisting of
strings ''w'' such that ''wx'' is in
for some string ''x'' in
Formally:
In other words, for all the 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 ''w'' such that ''xw'' is in
for some string ''x'' in
. Formally:
In other words, we take all the strings in
that have a prefix in
, and remove this prefix.
Note that the operands of
are in reverse order: the first operand is
and
is second.
Example
Consider
and
Now, if we insert a divider into an element of
, the part on the right is in
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
or
; and
can be written as
Properties
Some common closure properties of the quotient operation include:
* The quotient of a
regular language
In theoretical computer science and formal language theory, a regular language (also called a rational language) is a formal language that can be defined by a regular expression, in the strict sense in theoretical computer science (as opposed to ...
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
In computability theory, a set ''S'' of natural numbers is called computably enumerable (c.e.), recursively enumerable (r.e.), semidecidable, partially decidable, listable, provable or Turing-recognizable if:
*There is an algorithm such that the ...
language.
* The quotient of two recursively enumerable languages is recursively enumerable.
These closure properties hold for both left and right quotients.
See also
*
Brzozowski derivative
In theoretical computer science, in particular in formal language theory, the Brzozowski derivative u^S of a set (mathematics), set S of word (formal languages), strings and a string u is the set of all strings obtainable from a string in S by cu ...
References
{{reflist
Formal languages