For faster navigation, this Iframe is preloading the Wikiwand page for 正規言語.

正規言語

正規言語(せいきげんご)または正則言語(せいそくげんご)は、以下に示す性質(いずれも等価)を満たす形式言語である。

定義

[編集]

文字セット Σ 上の正規言語の集合は以下のように再帰的に定義される。

  • 空の言語 0 は正規言語である。
  • 空文字列言語 { ε } は正規言語である。
  • a ∈ Σ である各 a について、それだけを含む単集合言語 { a } は正規言語である。
  • AB が正規言語であるとき、AB(和集合)も AB(結合)も A*(クリーネ閉包)も正規言語である[1]
  • それ以外の Σ 上の言語は正規言語ではない。

有限の文字列から構成される言語は全て正規言語である。その他の典型的な例としては、文字セット {a, b} を使った文字列のうち、偶数個の a を含む文字列の集まりは正規言語であるし、任意個数の a の後に任意個数の b が続く文字列で構成される言語も正規言語である。

閉包属性

[編集]

正規言語に対して、和集合、積集合、差集合といった演算を施した結果も正規言語である。正規言語の補集合(文字セットから生成される全文字列を全体集合とする)も正規言語である。正規言語の文字列を全て逆転させたものも正規言語である。正規言語の連結(ふたつの言語に含まれる文字列をあらゆる組み合わせで連結した文字列の集合)をしたものも正規言語である。「シャッフル」をふたつの正規言語に施した結果も正規言語である。正規言語と任意の言語の商集合も正規言語である。個々の操作の具体的意味については形式言語#定義を参照されたい。

ある言語が正規言語であるかどうかの判断基準

[編集]

チョムスキー階層での正規言語の位置によれば、正規言語は文脈自由言語真部分集合である。すなわち、正規言語は文脈自由言語に含まれる一方、その逆は真ではない。

例えば、同じ個数の ab を含む文字列から成る言語は文脈自由言語ではあるが、正規言語ではない。このような言語が正規言語ではないことを証明するには、マイヒル-ネローデの定理反復補題 (pumping lemma) を使う。

正規言語を代数学的に定義するには、二つの方法がある。Σ を有限のアルファベットとし、Σ* を Σ 上の自由モノイド(Σ によって作られる記号列全て)とすると、f : Σ* → M はモノイド同型となる。ただしここで M有限のモノイドである。そして、SM の部分集合とすると、f−1(S) は正規言語となる。任意の正規言語はこのようにして構成することができる。

もう一つの方法として、L が Σ 上の言語であるとき、Σ* 上の同値関係 ~ を次のように定義する。

すると、L が正規言語であることは、同値関係 ~ の作る同値類の指標(濃度)が有限であることと同値になる。そして、同値類の指標は L を受理する最小の決定性有限オートマトンの状態の個数に一致する。

脚注

[編集]
  1. ^ つまり正規演算に閉じている
{{bottomLinkPreText}} {{bottomLinkText}}
正規言語
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?