Введение
Лемма, определяющая свойство регулярных языков
In the theory of formal languages, the pumping lemma for regular languages is a lemma that describes an essential property of all regular languages. Informally, it says that all sufficiently long strings in a regular language may be pumped—that is, have a middle section of the string repeated an arbitrary number of times—to produce a new string that is also part of the language. Specifically, the pumping lemma says that for any regular language there exists a constant such that any string in with length at least can be split into three substrings , and (, with being non empty), such that the strings constructed by repeating zero or more times are still in This process of repetition is known as "pumping". Moreover, the pumping lemma guarantees that the length of will be at most , imposing a limit on the ways in which may be split. Languages with a finite number of strings vacuously satisfy the pumping lemma by having equal to the maximum string length in plus one. By doing so, zero strings in have length greater than
The pumping lemma is useful for disproving the regularity of a specific language in question. It was first proven by Michael Rabin and Dana Scott in 1959, and rediscovered shortly after by Yehoshua Bar Hillel, Micha A. Perles, and Eli Shamir in 1961, as a simplification of their pumping lemma for context free languages.
В теории формальных языков насосная лемма для регулярных языков – это лемма, описывающая существенное свойство всех регулярных языков. Неформально, она утверждает, что все достаточно длинные строки в регулярном языке могут быть "прокачаны" – то есть, центральная часть строки может быть повторена произвольное количество раз, чтобы получить новую строку, также принадлежащую этому языку. В частности, насосная лемма гласит, что для любого регулярного языка существует константа *p*, такая, что любая строка *w* в этом языке, имеющая длину не менее *p*, может быть разделена на три подстроки *x*, *y* и *z* (где *y* не является пустой), таким образом, что строки, полученные путем повторения *y* ноль или более раз, также принадлежат этому языку. Этот процесс повторения известен как "прокачка". Более того, насосная лемма гарантирует, что длина *y* будет не больше *p*, что накладывает ограничение на способы разделения строки *w*. Языки, содержащие конечное число строк, тривиально удовлетворяют насосной лемме, если *p* равно максимальной длине строки в этом языке плюс один. Таким образом, в таком языке не существует строк длиной больше *p*.
In the theory of formal languages, the pumping lemma for regular languages is a lemma that describes an essential property of all regular languages. Informally, it says that all sufficiently long strings in a regular language may be pumped—that is, have a middle section of the string repeated an arbitrary number of times—to produce a new string that is also part of the language. Specifically, the pumping lemma says that for any regular language there exists a constant such that any string in with length at least can be split into three substrings , and (, with being non empty), such that the strings constructed by repeating zero or more times are still in This process of repetition is known as "pumping". Moreover, the pumping lemma guarantees that the length of will be at most , imposing a limit on the ways in which may be split. Languages with a finite number of strings vacuously satisfy the pumping lemma by having equal to the maximum string length in plus one. By doing so, zero strings in have length greater than
The pumping lemma is useful for disproving the regularity of a specific language in question. It was first proven by Michael Rabin and Dana Scott in 1959, and rediscovered shortly after by Yehoshua Bar Hillel, Micha A. Perles, and Eli Shamir in 1961, as a simplification of their pumping lemma for context free languages.
Насосная лемма полезна для доказательства нерегулярности конкретного языка. Она была впервые доказана Майклом Рабином и Даной Скотт в 1959 году, а вскоре после этого независимо открыта Ехошуа Бар-Хиллелем, Мишей А. Перлзом и Эли Шамиром в 1961 году как упрощение их насосной леммы для контекстно-свободных языков.
In the theory of formal languages, the pumping lemma for regular languages is a lemma that describes an essential property of all regular languages. Informally, it says that all sufficiently long strings in a regular language may be pumped—that is, have a middle section of the string repeated an arbitrary number of times—to produce a new string that is also part of the language. Specifically, the pumping lemma says that for any regular language there exists a constant such that any string in with length at least can be split into three substrings , and (, with being non empty), such that the strings constructed by repeating zero or more times are still in This process of repetition is known as "pumping". Moreover, the pumping lemma guarantees that the length of will be at most , imposing a limit on the ways in which may be split. Languages with a finite number of strings vacuously satisfy the pumping lemma by having equal to the maximum string length in plus one. By doing so, zero strings in have length greater than
The pumping lemma is useful for disproving the regularity of a specific language in question. It was first proven by Michael Rabin and Dana Scott in 1959, and rediscovered shortly after by Yehoshua Bar Hillel, Micha A. Perles, and Eli Shamir in 1961, as a simplification of their pumping lemma for context free languages.
Официальное заявление
Пусть L – регулярный язык. Тогда существует целое число p, зависящее только от L, такое что каждая строка w из L длиной не менее p (p называется "длиной перекачки") может быть записана в виде w = xyz (т.е. w может быть разделена на три подстроки), удовлетворяя следующим условиям:
is the substring that can be pumped (removed or repeated any number of times, and the resulting string is always in ). (1) means the loop to be pumped must be of length at least one, that is, not an empty string; (2) means the loop must occur within the first characters. must be smaller than (conclusion of (1) and (2)), but apart from that, there is no restriction on and
In simple words, for any regular language , any sufficiently long string (in ) can be split into 3 parts. i. e. , such that all the strings for are also in
Below is a formal expression of the Pumping Lemma.
y – подстрока, которую можно перекачивать (удалять или повторять любое количество раз, и результирующая строка всегда принадлежит L). (1) означает, что перекачиваемый цикл y должен иметь длину не менее одного, то есть не быть пустой строкой; (2) означает, что цикл y должен находиться в пределах первых p символов строки w. |xy| ≤ p (следствие (1) и (2)), но помимо этого нет никаких ограничений на |x| и |z|.
is the substring that can be pumped (removed or repeated any number of times, and the resulting string is always in ). (1) means the loop to be pumped must be of length at least one, that is, not an empty string; (2) means the loop must occur within the first characters. must be smaller than (conclusion of (1) and (2)), but apart from that, there is no restriction on and
In simple words, for any regular language , any sufficiently long string (in ) can be split into 3 parts. i. e. , such that all the strings for are also in
Below is a formal expression of the Pumping Lemma.
Простыми словами, для любого регулярного языка L, любая достаточно длинная строка w из L может быть разделена на 3 части, то есть w = xyz, такие что все строки xyz<sup>i</sup> для i ≥ 0 также принадлежат L.
is the substring that can be pumped (removed or repeated any number of times, and the resulting string is always in ). (1) means the loop to be pumped must be of length at least one, that is, not an empty string; (2) means the loop must occur within the first characters. must be smaller than (conclusion of (1) and (2)), but apart from that, there is no restriction on and
In simple words, for any regular language , any sufficiently long string (in ) can be split into 3 parts. i. e. , such that all the strings for are also in
Below is a formal expression of the Pumping Lemma.
Ниже приведена формальная формулировка леммы о перекачке.
is the substring that can be pumped (removed or repeated any number of times, and the resulting string is always in ). (1) means the loop to be pumped must be of length at least one, that is, not an empty string; (2) means the loop must occur within the first characters. must be smaller than (conclusion of (1) and (2)), but apart from that, there is no restriction on and
In simple words, for any regular language , any sufficiently long string (in ) can be split into 3 parts. i. e. , such that all the strings for are also in
Below is a formal expression of the Pumping Lemma.
Доказательство леммы насоса
Для каждого регулярного языка существует конечный автомат (FSA), который принимает этот язык. Количество состояний в таком FSA подсчитывается, и это число используется как длина перекачки. Для строки длиной не менее , пусть – начальное состояние, а – последовательность следующих посещенных состояний при обработке строки. Поскольку FSA имеет только состояний, в этой последовательности из посещенных состояний должно быть хотя бы одно повторяющееся состояние. Обозначим такое состояние как . Переходы, которые переводят автомат от первого вхождения состояния ко второму вхождению состояния , соответствуют некоторой строке. Эта строка называется в лемме, и поскольку автомат примет строку без части, или с повторением строки любое количество раз, условия леммы выполняются. Например, на следующем рисунке показан FSA. FSA принимает строку: abcd. Поскольку длина этой строки не меньше числа состояний, которое равно четырем (следовательно, общее количество состояний, через которые проходит автомат при сканировании abcd, равно 5), принцип Дирихле указывает на то, что среди начального состояния и следующих четырех посещенных состояний должно быть хотя бы одно повторяющееся состояние. В этом примере повторяющимся состоянием является только . Поскольку подстрока bc переводит автомат через переходы, начинающиеся в состоянии и заканчивающиеся в состоянии , эту часть можно повторить, и FSA все равно примет строку . Альтернативно, часть bc можно удалить, и FSA все равно примет строку ad. С точки зрения леммы перекачки, строка abcd разбивается на часть a, часть bc и часть d.
Как побочное замечание, задача проверки того, может ли заданная строка быть принята заданным недетерминированным конечным автоматом без повторного посещения какого-либо состояния, является NP-трудной.