Języki, automaty i obliczenia/Ćwiczenia 7: Twierdzenie Kleene'ego. Własności języków i gramatyk regularnych: Różnice pomiędzy wersjami
m Zastępowanie tekstu – „<math> ” na „<math>” |
m Zastępowanie tekstu – „ </math>” na „</math>” |
||
Linia 12: | Linia 12: | ||
\hline a & s_2 & s_1 & s_2 \\ \hline b & s_1 & s_1 & s_2\\ | \hline a & s_2 & s_1 & s_2 \\ \hline b & s_1 & s_1 & s_2\\ | ||
\hline \end{array} \begin{array} {c|c|c|} f_{\mathcal C} &s_{\mathcal C} &s \\ \hline a & s & s \\ | \hline \end{array} \begin{array} {c|c|c|} f_{\mathcal C} &s_{\mathcal C} &s \\ \hline a & s & s \\ | ||
\hline b & s_{\mathcal C} & s_{\mathcal C} \\ \hline \end{array} </math></center> | \hline b & s_{\mathcal C} & s_{\mathcal C} \\ \hline \end{array}</math></center> | ||
skonstruuj automat <math>\mathcal A</math> taki, że <center><math>L({\mathcal A}) = L({\mathcal B}) \cap L({\mathcal C})</math>,</center> | skonstruuj automat <math>\mathcal A</math> taki, że <center><math>L({\mathcal A}) = L({\mathcal B}) \cap L({\mathcal C})</math>,</center> | ||
Linia 39: | Linia 39: | ||
<center><math>\begin{array} {c|c|c|c|} f_{\mathcal B} &s_{\mathcal B} &s_1 & s_2 \\ | <center><math>\begin{array} {c|c|c|c|} f_{\mathcal B} &s_{\mathcal B} &s_1 & s_2 \\ | ||
\hline a & s_1 & s_2 & s_2 \\ \hline b & s_1 & s_{\mathcal{B}} & s_1\\ | \hline a & s_1 & s_2 & s_2 \\ \hline b & s_1 & s_{\mathcal{B}} & s_1\\ | ||
\hline \end{array} </math></center> | \hline \end{array}</math></center> | ||
skonstruuj automat deterministyczny <math>\mathcal A</math> taki, że | skonstruuj automat deterministyczny <math>\mathcal A</math> taki, że | ||
Linia 93: | Linia 93: | ||
# Jeśli <math>|w|>p</math>, to z lematu o pompowaniu wynika, że <math>\exists v_1 v_2 \in A^*</math>, <math>\exists u \in A^+</math> takie, że <math>w=v_1 uv_2</math>, <math>v_1 v_2 \in L(\mathcal{C})</math> i <math>|v_1v_2|<|w|</math>. | # Jeśli <math>|w|>p</math>, to z lematu o pompowaniu wynika, że <math>\exists v_1 v_2 \in A^*</math>, <math>\exists u \in A^+</math> takie, że <math>w=v_1 uv_2</math>, <math>v_1 v_2 \in L(\mathcal{C})</math> i <math>|v_1v_2|<|w|</math>. | ||
<center><math>(f\times g)((s_0,t_0),w) = (f\times g)((s_0,t_0),v_1 v_2)=(f(s_0,v_1v_2),g(t_0,v_1v_2)) | <center><math>(f\times g)((s_0,t_0),w) = (f\times g)((s_0,t_0),v_1 v_2)=(f(s_0,v_1v_2),g(t_0,v_1v_2)) | ||
\in S\times F \cup T\times Q | \in S\times F \cup T\times Q </math></center> | ||
Mamy dwie możliwości: | Mamy dwie możliwości: | ||
Linia 161: | Linia 161: | ||
\hline a & s_2 & s_1 & s_2 \\ \hline b & s_1 & s_1 & s_2\\ \hline \end{array} | \hline a & s_2 & s_1 & s_2 \\ \hline b & s_1 & s_1 & s_2\\ \hline \end{array} | ||
\begin{array} {c|c|c|c|} f_{\mathcal C} &s_{\mathcal C} &{s'}_1&{s'}_2 \\ \hline a & {s'}_1 & {s'}_1& {s'}_2 \\ | \begin{array} {c|c|c|c|} f_{\mathcal C} &s_{\mathcal C} &{s'}_1&{s'}_2 \\ \hline a & {s'}_1 & {s'}_1& {s'}_2 \\ | ||
\hline b & {s'}_2 & {s'}_1& {s'}_2 \\ \hline \end{array} </math></center> | \hline b & {s'}_2 & {s'}_1& {s'}_2 \\ \hline \end{array}</math></center> | ||
2. <math>L({\mathcal A}) = L({\mathcal B})^*</math>, gdzie <center><math>{\mathcal B} = | 2. <math>L({\mathcal A}) = L({\mathcal B})^*</math>, gdzie <center><math>{\mathcal B} = | ||
(S_{\mathcal B},A,f_{\mathcal B},s_{\mathcal B},F_{\mathcal B})</math>,</center> | (S_{\mathcal B},A,f_{\mathcal B},s_{\mathcal B},F_{\mathcal B})</math>,</center> | ||
Linia 170: | Linia 170: | ||
<center><math>\begin{array} {c|c|c|c|c|} f_{\mathcal B} &s_{\mathcal B} &s_1 & s_2 & s_3\\ \hline a & s_1 & s_3 & s_3 & s_3 \\ | <center><math>\begin{array} {c|c|c|c|c|} f_{\mathcal B} &s_{\mathcal B} &s_1 & s_2 & s_3\\ \hline a & s_1 & s_3 & s_3 & s_3 \\ | ||
\hline b & s_3 & s_2 & s_3 &s_3\\ \hline \end{array} </math></center> | \hline b & s_3 & s_2 & s_3 &s_3\\ \hline \end{array}</math></center> | ||
Podaj dwie konstrukcje: | Podaj dwie konstrukcje: |
Wersja z 10:51, 5 wrz 2023
Ćwiczenia 7
Ćwiczenie 1
gdzie
Ćwiczenie 2
gdzie
a funkcja przejść zdefiniowana jest następująco:
skonstruuj automat deterministyczny taki, że
Ćwiczenie 3
Dane są dwa automaty nad tym samym alfabetem
i . Udowodnij,
że istnieje liczba taka, że jeśli dla każdego słowa o długości spełniona jest implikacja
,
to
Ćwiczenie 4
Niech będzie dowolnym alfabetem, a językiem regularnym. Udowodnij, że język jest też językiem regularnym.
Ćwiczenie 5
Udowodnij, że następujące języki nie są regularne:
- ,
- .
Ćwiczenie 6
Niech . Skonstruuj automat , taki że
1. , gdzie
Podaj dwie konstrukcje:
- opartą na dowodzie twierdzenia Kleene'ego,
- z wykorzystaniem automatu z pustymi przejściami.
Ćwiczenie 7
Skonstruuj minimalny automat , taki że , gdzie opisany jest
poniższym grafem:
Ćwiczenie 8
Udowodnij, że następujące języki nie są regularne:
- ,
- .
Ćwiczenie 9
Zbuduj automat akceptujący język będący ogółem skończonych sekwencji binarnych, w których liczba zer jest podzielna przez dwa, a liczba jedynek przez 3, a następnie gramatykę generującą ten język.