正規言語と非正規言語の交差と結合


12

してみましょう、規則的でL 1 ∩ L 2の正規、L 2規則的ではありません。ことを示し、L 1 ∪ LをL1L1∩L2L2、正規ではないか、反例を与えます。L1∪L2

私はこれを試してみました:を見。これは定期的です。私はこのために、有限オートマトンを構築することができる:L 1は規則的であり、L 2 ∩ L 1が規則的であるのでためのすべてのパス(有限量)を削除L 1 ∩ L 2のパスの有限量からL 1。そのため、この全体に使用できるパスの数には限りがあります。このことはL 2から切り離されていますが、L 1 ∖ (LL1∖(L2∩L1)L1L2∩L1L1∩L2L1L2L1∖(L1∩L2)(通常)およびL2(規則的ではない)が正規ではありませんか?


「そうするためのすべてのパス(有限量)を削除のパスの有限量からL 1」 -ことを意味するものとなっていますか?差のためにオートマトンを構築する通常の方法で使用することであるA ∖ B = A ∩ ¯ Bおよび補体との交点のためのよく知られた構成を。L1∩L2L1A∖B=A∩B¯
— ラファエル

この質問のタイトルを変更することを好みます。それ自体で質問のタイトルは間違った記述です。
— nitishch 14

回答:


19

L1¯=Σ∗∖L1L2

L2=((L1∪L2)∖L1)∪(L1∩L2)=((L1∪L2)∩L1¯)∪(L1∩L2)

私たちは知っています:

  • 通常の言語は、結合、交差、補完の下で閉じられます
  • L1¯L1∩L2 are regular
  • L2 is not regular

Now assume L1∪L2 is regular: Then ((L1∪L2)∩L1¯)∪(L1∩L2) is regular (as it is only a union/intersection of regular languages), so L2 would be regular. That is a contradiction, therefore our assumption is false, and L1∪L2 can not be regular.


I think I got it. But why is the complement of a regular language regular? I don't get that part.
— Kevin

1
@Kevin This is a well-known lemma, so you should find a proof in any textbook. One proof method is to take a finite automaton and swap the accepting and non-accepting states: you get an automaton that recognizes the complement language.
— Gilles 'SO- stop being evil'

And what for non-deterministic finite automata? Suppose we have an automata. A={a,b}, one initial state, two arrows from that state with a to another state. One of those states is accepting and one not. So L(M)={a}. If we now swap the accepting states, it will still accept {a}, so it does not hold that it that accepts the complement language!
— Kevin

Gilles' proof works only for deterministic finite automata, which - for regular languages - isn't a restriction. But as he said, this lemma can be found in any textbook.
— Mike B.

1
@Kevin: Mike means that every regular language has a deterministic automaton to recognize it so you can always use one.
— reinierpost

-4

That is wrong. Consider L1={a,b}∗, L2={anbn:n≥0}. L1 is regular, L2 isn't; but L1∪L2=L1.


5
You have failed to satisfy the condition that L1∩L2 is regular.
— Andrej Bauer
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.