Test GR2: Różnice pomiędzy wersjami

Z Studia Informatyczne
Przejdź do nawigacjiPrzejdź do wyszukiwania
Rogoda (dyskusja | edycje)
Nie podano opisu zmian
m Zastępowanie tekstu – „<math> ” na „<math>”
 
(Nie pokazano 12 wersji utworzonych przez 2 użytkowników)
Linia 1: Linia 1:
<quiz type="exclusive">
Jeśli <math>\displaystyle M</math> jest termem rachunku lambda, zaś <math>\displaystyle x</math> jest zmienną, to <math>\displaystyle \lambda M.x</math> nazywamy:
<rightoption reply="Dobrze">abstrakcją</rightoption>
<wrongoption reply="Źle">aplikacją</wrongoption>
<wrongoption reply="Źle">termem wolnym</wrongoption>
<wrongoption reply="Źle">to w ogóle nie jest term rachunku lambda</wrongoption>
</quiz>
<quiz type="exclusive">
W termie <math>\displaystyle \lambda xy.yz</math> wolna jest zmienna:
<wrongoption reply="Źle"><math>\displaystyle x</math></wrongoption>
<wrongoption reply="Źle"><math>\displaystyle y</math></wrongoption>
<rightoption reply="Dobrze"><math>\displaystyle z</math></rightoption>
<wrongoption reply="Źle">żadna</wrongoption>
</quiz>
<quiz type="exclusive">
Który term jest wynikiem <math>\displaystyle \alpha</math>-konwersji termu <math>\displaystyle \lambda x.xy</math>?
<wrongoption reply="Źle"><math>\displaystyle \lambda x.xz</math></wrongoption>
<wrongoption reply="Źle"><math>\displaystyle \lambda y.yy</math></wrongoption>
<rightoption reply="Dobrze"><math>\displaystyle \lambda z.zy</math></rightoption>
<wrongoption reply="Źle">żaden z wymienionych</wrongoption>
</quiz>
<quiz type="exclusive">
Wynikiem <math>\displaystyle \beta</math>-redukcji termu <math>\displaystyle (\lambda xy.xy)z</math> jest term:
<wrongoption reply="Źle"><math>\displaystyle \lambda x.xz</math></wrongoption>
<rightoption reply="Dobrze"><math>\displaystyle \lambda y.zy</math></rightoption>
<wrongoption reply="Źle"><math>\displaystyle \lambda zy.zy</math></wrongoption>
<wrongoption reply="Źle">żaden z wymienionych</wrongoption>
</quiz>
<quiz type="exclusive">
Aplikacja <math>\displaystyle PQ</math> zwana jest redeksem, jeśli:
<rightoption reply="Dobrze"><math>\displaystyle P</math> jest w postaci abstrakcji</rightoption>
<wrongoption reply="Źle"><math>\displaystyle Q</math> jest w postaci bstrakcji</wrongoption>
<wrongoption reply="Źle"><math>\displaystyle P</math> nie zawiera zmiennych wolnych</wrongoption>
<wrongoption reply="Źle"><math>\displaystyle Q</math> nie zawiera zmiennych wolnych</wrongoption>
</quiz>
<quiz type="exclusive">
Mówimy, że term jest w postaci normalnej, jeśli:
<rightoption reply="Dobrze">żaden jego podterm nie jest redeksem</rightoption>
<wrongoption reply="Źle">zawiera dokładnie jeden redeks</wrongoption>
<wrongoption reply="Źle">zawiera co najmniej jeden redeks</wrongoption>
<wrongoption reply="Źle">nie zawiera zmiennych wolnych</wrongoption>
</quiz>
<quiz type="exclusive">
Postać normalna (o ile istnieje) jest unikalna z dokładnością do:
<rightoption reply="Dobrze"><math>\displaystyle \alpha</math>-konwersji</rightoption>
<wrongoption reply="Źle"><math>\displaystyle \beta</math>-redukcji</wrongoption>
<wrongoption reply="Źle">i <math>\displaystyle \alpha</math>-konwersji, i <math>\displaystyle \beta</math>-redukcji</wrongoption>
<wrongoption reply="Źle">jest bezwzględnie unikalna</wrongoption>
</quiz>
<quiz type="exclusive">
Przymując standardową reprezentację liczb naturalnych w rachunku lambda,
term <math>\displaystyle \lambda mnsx.(ms)(nsx)</math> reprezentuje:
<rightoption reply="Dobrze">dodawanie</rightoption>
<wrongoption reply="Źle">mnożenie</wrongoption>
<wrongoption reply="Źle">potęgowanie</wrongoption>
<wrongoption reply="Źle">żadne z wymienionych tu działań</wrongoption>
</quiz>
<quiz type="exclusive">
Funkcje reprezentowalne w rachunku lambda (klasycznym, beztypowym)
odpowiadają dokładnie modelowi:
<rightoption reply="Dobrze">funkcji obliczalnych totalnych (nieczęściowych)</rightoption>
<wrongoption reply="Źle">funkcji obliczalnych częściowych</wrongoption>
<wrongoption reply="Źle">funkcji dających się obliczyć w stałej pamięci</wrongoption>
<wrongoption reply="Źle">żadnemu z wymienionych</wrongoption>
</quiz>
<quiz type="exclusive">
Operator punktu stałego to term <math>\displaystyle Y</math> taki, że dla dowolnego termu <math>\displaystyle M</math> aplikacja <math>\displaystyle YM</math> jest równa, modulo <math>\displaystyle \beta</math>-redukcja:
<wrongoption reply="Źle"><math>\displaystyle M</math></wrongoption>
<rightoption reply="Dobrze"><math>\displaystyle M(YM)</math></rightoption>
<wrongoption reply="Źle"><math>\displaystyle Y</math></wrongoption>
<wrongoption reply="Źle"><math>\displaystyle YM</math></wrongoption>
</quiz>
{| border="1" cellspacing="0"
{| border="1" cellspacing="0"
! <math>\phi</math>!! <math>\psi</math>!! <math>\psi \Rightarrow \phi</math>!! <math>\displaystyle (\phi \Rightarrow (\psi \Rightarrow \phi))</math>!!
! <math>\phi</math>!! <math>\psi</math>!! <math>\psi \Rightarrow \phi</math>!! <math>(\phi \Rightarrow (\psi \Rightarrow \phi))</math>!!
|-
|-
| &nbsp;0&nbsp;|| &nbsp;0&nbsp;|| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
| &nbsp;0&nbsp;|| &nbsp;0&nbsp;|| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Linia 105: Linia 13:




<center><math> \displaystyle \left| x \right|\ = \left\{ \begin{array}{rll} x & \text{ gdy }, x\geq 0 \\ -x & \text{ w przeciwnym przypadku}.
<center><math>\left| x \right|\ = \left\{ \begin{array}{rll} x & \text{ gdy }, x\geq 0 \\ -x & \text{ w przeciwnym przypadku}.
\end{array} </math></center>
\end{array}</math></center>






<center><math>\displaystyle \nonumber w_3 &\rightarrow  bv_3v_2w_3v_1v_3v_3v_2\ |\
<center><math>w_3 &\rightarrow  bv_3v_2w_3v_1v_3v_3v_2\ |\
aw_3v_1v_3v_3v_2\ |\ bv_3v_2v_1v_3v_3v_2 \\
aw_3v_1v_3v_3v_2\ |\ bv_3v_2v_1v_3v_3v_2 \\
\begin{array}{lll}\nonumber & & |\ av_1v_3v_3v_2\ |\ bv_3v_3v_2
\begin{array}{lll} & & |\ av_1v_3v_3v_2\ |\ bv_3v_3v_2
\end{array}</math></center>
\end{array}</math></center>


oraz
oraz


<center><math>\displaystyle \nonumber w_3 &\rightarrow  bv_3v_2w_3v_1v_3v_3v_2w_3\ |\
<center><math>w_3 &\rightarrow  bv_3v_2w_3v_1v_3v_3v_2w_3\ |\
aw_3v_1v_3v_3v_2w_3\ |\ bv_3v_2v_1v_3v_3v_2w_3 \\
aw_3v_1v_3v_3v_2w_3\ |\ bv_3v_2v_1v_3v_3v_2w_3 \\
\begin{array}{lll}\nonumber & & |\ av_1v_3v_3v_2w_3\ |\ bv_3v_3v_2w_3
\begin{array}{lll} & & |\ av_1v_3v_3v_2w_3\ |\ bv_3v_3v_2w_3
\end{array}</math></center>
\end{array}</math></center>


Ostatecznie, gramatyka w postaci Greibach ma postać:
Ostatecznie, gramatyka w postaci Greibach ma postać:


<center><math> \displaystyle  \nonumber v_1 &\rightarrow  bv_3v_2w_3v_1v_3\ |\ aw_3v_1v_3\ |\ bv_3v_2v_1v_3\ |\ av_1v_3\ |\ bv_3 \\
<center><math> v_1 &\rightarrow  bv_3v_2w_3v_1v_3\ |\ aw_3v_1v_3\ |\ bv_3v_2v_1v_3\ |\ av_1v_3\ |\ bv_3 \\
\nonumber v_2 &\rightarrow  bv_3v_2w_3v_1\ |\ aw_3v_1\ |\ bv_3v_2v_1\ |\ av_1\ |\ b \\
v_2 &\rightarrow  bv_3v_2w_3v_1\ |\ aw_3v_1\ |\ bv_3v_2v_1\ |\ av_1\ |\ b \\
\nonumber v_3 &\rightarrow  bv_3v_2w_3\ |\ aw_3\ |\ bv_3v_2\ |\ a
v_3 &\rightarrow  bv_3v_2w_3\ |\ aw_3\ |\ bv_3v_2\ |\ a
\\
\\
\nonumber w_3 &\rightarrow  bv_3v_2w_3v_1v_3v_3v_2\ |\
w_3 &\rightarrow  bv_3v_2w_3v_1v_3v_3v_2\ |\
aw_3v_1v_3v_3v_2\ |\ bv_3v_2v_1v_3v_3v_2 \\
aw_3v_1v_3v_3v_2\ |\ bv_3v_2v_1v_3v_3v_2 \\
\begin{array}{lll}\nonumber & & |\ av_1v_3v_3v_2\ |\ bv_3v_3v_2 bv_3v_2w_3v_1v_3v_3v_2w_3 \\
\begin{array}{lll} & & |\ av_1v_3v_3v_2\ |\ bv_3v_3v_2 bv_3v_2w_3v_1v_3v_3v_2w_3 \\
\nonumber & & |\ aw_3v_1v_3v_3v_2w_3\ |\ bv_3v_2v_1v_3v_3v_2w_3\ \\
& & |\ aw_3v_1v_3v_3v_2w_3\ |\ bv_3v_2v_1v_3v_3v_2w_3\ \\
\nonumber & & |\ av_1v_3v_3v_2w_3\ |\ bv_3v_3v_2w_3
& & |\ av_1v_3v_3v_2w_3\ |\ bv_3v_3v_2w_3
\end{array}</math></center>
\end{array}</math></center>


Linia 139: Linia 47:




<center><math>\displaystyle \begin{array} {c|c|c|c|c|} Krok & dodane\quad do\quad S' & okreslenie\quad f' & dodane\quad do\quad T'\\
<center><math>\begin{array} {c|c|c|c|c|} Krok & dodane\quad do\quad S' & okreslenie\quad f' & dodane\quad do\quad T'\\
\hline 0 & \{q_0\} &  & \emptyset\\
\hline 0 & \{q_0\} &  & \emptyset\\
\hline 1 & \{q_0,q_3\} & f'(\{q_0\},a)=\{q_0,q_3\} & \emptyset\\
\hline 1 & \{q_0,q_3\} & f'(\{q_0\},a)=\{q_0,q_3\} & \emptyset\\
Linia 159: Linia 67:
\hline  &  & f'(\{q_0,q_2,q_3,q_4\},a)=\{q_0,q_2,q_3,q_4\} & \\
\hline  &  & f'(\{q_0,q_2,q_3,q_4\},a)=\{q_0,q_2,q_3,q_4\} & \\
\hline  &  & f'(\{q_0,q_2,q_3,q_4\},b)=\{q_0,q_1,q_2,q_4\} & \\
\hline  &  & f'(\{q_0,q_2,q_3,q_4\},b)=\{q_0,q_1,q_2,q_4\} & \\
\hline \end{array} </math></center>
\hline \end{array} </math></center>








<center><math>\displaystyle \begin{array} {c|c|c|c|c|} (s_0,\sharp)\mapsto (s_A,\sharp,0) & (s_0,0)\mapsto (r_0,\sharp,1) & (s_0,1)\mapsto (r_1,\sharp,1)\\
<center><math>\begin{array} {c|c|c|c|c|} (s_0,\sharp)\mapsto (s_A,\sharp,0) & (s_0,0)\mapsto (r_0,\sharp,1) & (s_0,1)\mapsto (r_1,\sharp,1)\\
\hline (r_0,\sharp)\mapsto (s_R,\sharp,0) & (r_0,0)\mapsto (r_0',0,1) & (r_0,1)\mapsto (r_0',1,1)\\
\hline (r_0,\sharp)\mapsto (s_R,\sharp,0) & (r_0,0)\mapsto (r_0',0,1) & (r_0,1)\mapsto (r_0',1,1)\\
\hline (r_0',\sharp)\mapsto (q_0,\sharp,-1) & (r_0',0)\mapsto (r_0',0,1) & (r_0',1)\mapsto (r_0',1,1)\\
\hline (r_0',\sharp)\mapsto (q_0,\sharp,-1) & (r_0',0)\mapsto (r_0',0,1) & (r_0',1)\mapsto (r_0',1,1)\\
Linia 174: Linia 82:
\hline (s_R,\sharp)\mapsto (s_R,\sharp,0) &  & \\
\hline (s_R,\sharp)\mapsto (s_R,\sharp,0) &  & \\
\hline (s_A,\sharp)\mapsto (s_A,\sharp,0) &  & \\
\hline (s_A,\sharp)\mapsto (s_A,\sharp,0) &  & \\
\hline \end{array} </math></center>
\hline \end{array} </math></center>




Linia 182: Linia 90:




<center><math>\displaystyle \begin{array} {c|c|c|c|c|} (s_0,\sharp)\mapsto (s_R,\sharp,0) & (s_1,\diamondsuit)\mapsto(s1,\diamondsuit,1)\\
<center><math>\begin{array} {c|c|c|c|c|} (s_0,\sharp)\mapsto (s_R,\sharp,0) & (s_1,\diamondsuit)\mapsto(s1,\diamondsuit,1)\\
\hline (s_0,0)\mapsto(s_1,\clubsuit,1) & (s_1,0) \mapsto(s_2,\diamondsuit,1)\\
\hline (s_0,0)\mapsto(s_1,\clubsuit,1) & (s_1,0) \mapsto(s_2,\diamondsuit,1)\\
\hline  & (s_1,\sharp)\mapsto(s_A,\sharp,0)\\
\hline  & (s_1,\sharp)\mapsto(s_A,\sharp,0)\\
Linia 192: Linia 100:
\hline (s_4,\clubsuit)\mapsto(s_2,\clubsuit,1) & \\
\hline (s_4,\clubsuit)\mapsto(s_2,\clubsuit,1) & \\
\hline (s_A,\sharp)\mapsto(s_A,\sharp,0) & (s_R,\sharp)\mapsto(s_R,\sharp,0)\\
\hline (s_A,\sharp)\mapsto(s_A,\sharp,0) & (s_R,\sharp)\mapsto(s_R,\sharp,0)\\
\hline \end{array} </math></center>
\hline \end{array} </math></center>




Linia 201: Linia 109:




<center><math>\displaystyle \begin{array} {c|c|c|c|c|}  & s_0 & s_1 & s_2\\
<center><math>\begin{array} {c|c|c|c|c|}  & s_0 & s_1 & s_2\\
\hline \tau _{\mathcal{A}}(1) & s_0 & s_1 & s_2\\
\hline \tau _{\mathcal{A}}(1) & s_0 & s_1 & s_2\\
\hline \tau _{\mathcal{A}}(a) & s_1 & s_2 & s_2\\
\hline \tau _{\mathcal{A}}(a) & s_1 & s_2 & s_2\\
Linia 211: Linia 119:
\hline \tau _{\mathcal{A}}(aba) & s_1 & s_1 & s_2\\
\hline \tau _{\mathcal{A}}(aba) & s_1 & s_1 & s_2\\
\hline ... & ... & ... & ...\\
\hline ... & ... & ... & ...\\
\hline \end{array} </math></center>
\hline \end{array} </math></center>




<center><math>\displaystyle \begin{array} {c|c|c|c|c|} f & s_0 & s_1 & s_2 & s_3\\
<center><math>\begin{array} {c|c|c|c|c|} f & s_0 & s_1 & s_2 & s_3\\
\hline a & s_1 & s_2 & s_0 & s_2\\
\hline a & s_1 & s_2 & s_0 & s_2\\
\hline b & s_3 & s_2 & s_2 & s_2\\
\hline b & s_3 & s_2 & s_2 & s_2\\
\hline \end{array} </math></center>
\hline \end{array} </math></center>




Linia 223: Linia 131:
wykorzystujący stabilizujący się ciąg relacji|algorytm minimalizacji automatu wykorzystujący stabilizujący się ciąg relacji|
wykorzystujący stabilizujący się ciąg relacji|algorytm minimalizacji automatu wykorzystujący stabilizujący się ciąg relacji|


   1  Wejście: <math>\displaystyle \mathcal{A}=(S, A, f, s_0, T)</math> - automat taki, że <math>\displaystyle L=L(\mathcal{A})</math>.
   1  Wejście: <math>\mathcal{A}=(S, A, f, s_0, T)</math> - automat taki, że <math>L=L(\mathcal{A})</math>.
   2  Wyjście: automat minimalny <math>\displaystyle \mathcal{A}'=(S',A',f', s_0',
   2  Wyjście: automat minimalny <math>\mathcal{A}'=(S',A',f', s_0',
T')</math> dla <math>\displaystyle \mathcal{A}</math>.
T')</math> dla <math>\mathcal{A}</math>.
   3  <math>\displaystyle \overline{\rho}_1\displaystyle \leftarrow\displaystyle \approx_{\mathcal{A}}</math>;
   3  <math>\overline{\rho}_1\leftarrow\approx_{\mathcal{A}}</math>;
   4  <math>\displaystyle i \leftarrow 1</math>;
   4  <math>i \leftarrow 1</math>;
   5  '''repeat'''
   5  '''repeat'''
   6    <math>\displaystyle \slash \slash</math> oblicz <math>\displaystyle \overline{\rho}_i</math>: <math>\displaystyle s_1  
   6    <math>\slash \slash</math> oblicz <math>\overline{\rho}_i</math>: <math>s_1  
\overline{\rho}_i s_2 \Leftrightarrow (s_1 \overline{\rho}_{i-1}  
\overline{\rho}_i s_2 \Leftrightarrow (s_1 \overline{\rho}_{i-1}  
s_2) \wedge (\forall a \in A\ f(s_1, a) \overline{\rho}_{i-1}  
s_2) \wedge (\forall a \in A\ f(s_1, a) \overline{\rho}_{i-1}  
f(s_2,a))</math>;
f(s_2,a))</math>;
   7    <math>\displaystyle i \leftarrow i+1</math>;
   7    <math>i \leftarrow i+1</math>;
   8    '''empty'''<math>\displaystyle (\overline{\rho}_i)</math>  
   8    '''empty'''<math>(\overline{\rho}_i)</math>  
   9    '''for''' '''each''' <math>\displaystyle (s_1,s_2)\in S\times S</math> '''do'''
   9    '''for''' '''each''' <math>(s_1,s_2)\in S\times S</math> '''do'''
   10      flag<math>\displaystyle \leftarrow</math>'''true''';
   10      flag<math>\leftarrow</math>'''true''';
   11      '''for''' '''each''' <math>\displaystyle a\in A</math>  
   11      '''for''' '''each''' <math>a\in A</math>  
   12        '''if''' '''not''' <math>\displaystyle f(s_1, a) \overline{\rho}_{i-1} f(s_2,a)</math> '''then'''
   12        '''if''' '''not''' <math>f(s_1, a) \overline{\rho}_{i-1} f(s_2,a)</math> '''then'''
   13          flag<math>\displaystyle \leftarrow</math>'''false''';
   13          flag<math>\leftarrow</math>'''false''';
   14        '''end''' '''if'''
   14        '''end''' '''if'''
   15      '''end''' '''for'''
   15      '''end''' '''for'''
   16      '''if''' flag<nowiki>=</nowiki>'''true''' '''and''' <math>\displaystyle s_1 \overline{\rho}_{i-1} s_2</math> '''then'''
   16      '''if''' flag<nowiki>=</nowiki>'''true''' '''and''' <math>s_1 \overline{\rho}_{i-1} s_2</math> '''then'''
   17        <math>\displaystyle \overline{\rho}_{i} \leftarrow \overline{\rho}_{i} \cup \{(s_1,s_2)\}</math>;
   17        <math>\overline{\rho}_{i} \leftarrow \overline{\rho}_{i} \cup \{(s_1,s_2)\}</math>;
   18      '''end''' '''if'''
   18      '''end''' '''if'''
   19    '''end''' '''for'''
   19    '''end''' '''for'''
   20  '''until''' <math>\displaystyle \overline{\rho}_i = \overline{\rho}_{i-1}</math>
   20  '''until''' <math>\overline{\rho}_i = \overline{\rho}_{i-1}</math>
   21  <math>\displaystyle S' \leftarrow S \slash \overline{\rho}_i</math>;
   21  <math>S' \leftarrow S \slash \overline{\rho}_i</math>;
   22  '''for''' '''each''' <math>\displaystyle [s]_{\overline{\rho}_i} \in S \slash \overline{\rho}_i</math> '''do'''
   22  '''for''' '''each''' <math>[s]_{\overline{\rho}_i} \in S \slash \overline{\rho}_i</math> '''do'''
   23    '''for''' '''each''' <math>\displaystyle a \in A</math> '''do'''
   23    '''for''' '''each''' <math>a \in A</math> '''do'''
   24      <math>\displaystyle f'([s]_{\overline{\rho}_i},a) \leftarrow
   24      <math>f'([s]_{\overline{\rho}_i},a) \leftarrow
[f(s,a)]_{\overline{\rho}_i}</math>;
[f(s,a)]_{\overline{\rho}_i}</math>;
   25    '''end''' '''for'''
   25    '''end''' '''for'''
   26  '''end''' '''for'''
   26  '''end''' '''for'''
   27  <math>\displaystyle s_0' \leftarrow [s_0]_{\overline{\rho}_i}</math>;
   27  <math>s_0' \leftarrow [s_0]_{\overline{\rho}_i}</math>;
   28  <math>\displaystyle T' \leftarrow \{[t]_{\overline{\rho}_i}:\ t \in T\}</math>;
   28  <math>T' \leftarrow \{[t]_{\overline{\rho}_i}:\ t \in T\}</math>;
   29  '''return''' <math>\displaystyle \mathcal{A}'=(S', A, f', s_0', T')</math>;
   29  '''return''' <math>\mathcal{A}'=(S', A, f', s_0', T')</math>;


}}
}}
Linia 267: Linia 175:
|  
|  
||  
||  
<math>\displaystyle s_{0} </math>  ||  
<math>s_{0} </math>  ||  
<math>\displaystyle s_{1} </math>  ||  
<math>s_{1} </math>  ||  
<math>\displaystyle s_{2} </math>  
<math>s_{2} </math>  
|-
|-
|  
|  


<math>\displaystyle \tau _{\mathcal{A}}(1) </math>  ||  
<math>\tau _{\mathcal{A}}(1) </math>  ||  
<math>\displaystyle s_{0} </math>  ||  
<math>s_{0} </math>  ||  
<math>\displaystyle s_{1} </math>  ||  
<math>s_{1} </math>  ||  
<math>\displaystyle s_{2} </math>  
<math>s_{2} </math>  
|-
|-
|  
|  
<math>\displaystyle \tau _{\mathcal{A}}(a) </math>  ||  
<math>\tau _{\mathcal{A}}(a) </math>  ||  
<math>\displaystyle s_{1} </math>  ||  
<math>s_{1} </math>  ||  
<math>\displaystyle s_{2} </math>  ||  
<math>s_{2} </math>  ||  
<math>\displaystyle s_{2} </math>  
<math>s_{2} </math>  
|-
|-
|  
|  
<math>\displaystyle \tau _{\mathcal{A}}(b) </math>  ||  
<math>\tau _{\mathcal{A}}(b) </math>  ||  
<math>\displaystyle s_{0} </math>  ||  
<math>s_{0} </math>  ||  
<math>\displaystyle s_{0} </math>  ||  
<math>s_{0} </math>  ||  
<math>\displaystyle s_{0} </math>  
<math>s_{0} </math>  
|-
|-
|  
|  
<math>\displaystyle \tau _{\mathcal{A}}(a^{2}) </math>  ||  
<math>\tau _{\mathcal{A}}(a^{2}) </math>  ||  
<math>\displaystyle s_{2} </math>  ||  
<math>s_{2} </math>  ||  
<math>\displaystyle s_{2} </math>  ||  
<math>s_{2} </math>  ||  
<math>\displaystyle s_{2} </math>  
<math>s_{2} </math>  
|-
|-
|  
|  
<math>\displaystyle \tau _{\mathcal{A}}(ab) </math>  ||  
<math>\tau _{\mathcal{A}}(ab) </math>  ||  
<math>\displaystyle s_{0} </math>  ||  
<math>s_{0} </math>  ||  
<math>\displaystyle s_{0} </math>  ||  
<math>s_{0} </math>  ||  
<math>\displaystyle s_{2} </math>  
<math>s_{2} </math>  
|-
|-
|  
|  
<math>\displaystyle \tau _{\mathcal{A}}(ba) </math>  ||  
<math>\tau _{\mathcal{A}}(ba) </math>  ||  
<math>\displaystyle s_{1} </math>  ||  
<math>s_{1} </math>  ||  
<math>\displaystyle s_{1} </math>  ||  
<math>s_{1} </math>  ||  
<math>\displaystyle s_{1} </math>   
<math>s_{1} </math>   
|-
|-
|  
|  
<math>\displaystyle \tau _{\mathcal{A}}(b^{2}) </math>  ||  
<math>\tau _{\mathcal{A}}(b^{2}) </math>  ||  
<math>\displaystyle s_{0} </math>  ||  
<math>s_{0} </math>  ||  
<math>\displaystyle s_{0} </math>  ||  
<math>s_{0} </math>  ||  
<math>\displaystyle s_{0} </math>  
<math>s_{0} </math>  
|-
|-
|  
|  
<math>\displaystyle \tau _{\mathcal{A}}(aba) </math>  ||  
<math>\tau _{\mathcal{A}}(aba) </math>  ||  
<math>\displaystyle s_{1} </math>  ||  
<math>s_{1} </math>  ||  
<math>\displaystyle s_{1} </math>  ||  
<math>s_{1} </math>  ||  
<math>\displaystyle s_{2} </math>  
<math>s_{2} </math>  
|-
|-
|  
|  
Linia 331: Linia 239:




<math>  
<math>
\begin{array}{lll}
\begin{array}{lll}
\displaystyle \textrm{b) } \lim_{x\rightarrow 2^+} (x-2)e^{\frac{1}{x-2}}&=& \displaystyle \lim_{x\rightarrow
\text{b) } \lim_{x\rightarrow 2^+} (x-2)e^{\frac{1}{x-2}}&=&\lim_{x\rightarrow
2^+} \frac{e^{\frac{1}{x-2}}}{(x-2)^{-1}}\begin{array} {c}\left[\frac{\infty}{\infty}\right]\\=\\H\end{array}  
2^+} \frac{e^{\frac{1}{x-2}}}{(x-2)^{-1}}\begin{array} {c}\left[\frac{\infty}{\infty}\right]\\=\\H\end{array}  
\lim_{x\rightarrow 2^+}
\lim_{x\rightarrow 2^+}
\frac{-(x-2)^{-2}e^{\frac{1}{x-2}}}{-(x-2)^{-2}}=\\
\frac{-(x-2)^{-2}e^{\frac{1}{x-2}}}{-(x-2)^{-2}}=\\
&=& \displaystyle \lim_{x\rightarrow 2^+} e^{\frac{1}{x-2}}=+\infty;
&=&\lim_{x\rightarrow 2^+} e^{\frac{1}{x-2}}=+\infty;
\end{array}
\end{array}
</math><br>
</math><br>
Linia 397: Linia 305:


{| border="1"
{| border="1"
! <math>\textnormal{p}</math>!! <math>\textnormal{q}</math>!! <math>\textnormal{p} \wedge \textnormal{q}</math>!! <math>\neg( p \wedge q)</math>!! <math>\neg p</math>!! <math>\neg q</math>!! <math>\neg p \vee \neg q</math>
! <math>\text{p}</math>!! <math>\text{q}</math>!! <math>\text{p} \wedge \text{q}</math>!! <math>\neg( p \wedge q)</math>!! <math>\neg p</math>!! <math>\neg q</math>!! <math>\neg p \vee \neg q</math>
|-
|-
| &nbsp;0&nbsp;|| &nbsp;0&nbsp;|| 0|| 1|| 1|| 1|| 1
| &nbsp;0&nbsp;|| &nbsp;0&nbsp;|| 0|| 1|| 1|| 1|| 1
Linia 410: Linia 318:


{| border="1"
{| border="1"
! <math>\textnormal{p}</math>!! <math>\textnormal{q}</math>!! <math>\textnormal{r}</math>!!<math>(\textnormal{p} \wedge \textnormal{q})</math>!! <math>( p \wedge r)</math>!! <math>( q \wedge \neg r)</math>!! <math>(p \wedge r) \vee (q \wedge \neg r)</math>!! <math>(p \wedge q) \Rightarrow ((p \wedge r) \vee (q \wedge \neg r))</math>
! <math>\text{p}</math>!! <math>\text{q}</math>!! <math>\text{r}</math>!!<math>(\text{p} \wedge \text{q})</math>!! <math>( p \wedge r)</math>!! <math>( q \wedge \neg r)</math>!! <math>(p \wedge r) \vee (q \wedge \neg r)</math>!! <math>(p \wedge q) \Rightarrow ((p \wedge r) \vee (q \wedge \neg r))</math>
|-
|-
| 0|| 0|| 0|| 0|| 0|| 0|| 0|| 1
| 0|| 0|| 0|| 0|| 0|| 0|| 0|| 1
Linia 439: Linia 347:
| 2|| 0|| 0|| 1|| 0|| &nbsp;|| <math>\neg (p \Rightarrow q)</math>
| 2|| 0|| 0|| 1|| 0|| &nbsp;|| <math>\neg (p \Rightarrow q)</math>
|-
|-
| 3|| 0|| 0|| 1|| 1|| &nbsp;|| <math>\textnormal{p}</math>
| 3|| 0|| 0|| 1|| 1|| &nbsp;|| <math>\text{p}</math>
|-
|-
| 4|| 0|| 1|| 0|| 0|| &nbsp;|| <math>\neg (q \Rightarrow p)</math>
| 4|| 0|| 1|| 0|| 0|| &nbsp;|| <math>\neg (q \Rightarrow p)</math>
|-
|-
| 5|| 0|| 1|| 0|| 1|| &nbsp;|| <math>\textnormal{q}</math>
| 5|| 0|| 1|| 0|| 1|| &nbsp;|| <math>\text{q}</math>
|-
|-
| 6|| 0|| 1|| 1|| 0|| &nbsp;|| <math>XOR</math>
| 6|| 0|| 1|| 1|| 0|| &nbsp;|| <math>XOR</math>
Linia 468: Linia 376:


{| border="1"
{| border="1"
! <math>\textnormal{p}</math>!! <math>\textnormal{q}</math>!! <math>\textnormal{r}</math>!!<math>(p \leftrightarrow q)</math>!! <math>(p \leftrightarrow q) \leftrightarrow r</math>!! <math>(q \leftrightarrow r)</math>!! <math>p \leftrightarrow (q \leftrightarrow r)</math>
! <math>\text{p}</math>!! <math>\text{q}</math>!! <math>\text{r}</math>!!<math>(p \leftrightarrow q)</math>!! <math>(p \leftrightarrow q) \leftrightarrow r</math>!! <math>(q \leftrightarrow r)</math>!! <math>p \leftrightarrow (q \leftrightarrow r)</math>
|-
|-
| 0|| 0|| 0|| 1|| 0|| 1|| 0
| 0|| 0|| 0|| 1|| 0|| 1|| 0
Linia 489: Linia 397:


{| border="1"
{| border="1"
! <math>\textnormal{p}</math>!! <math>\textnormal{q}</math>!! <math>\textnormal{r}</math>!!<math>\circ (p, q, r)</math>
! <math>\text{p}</math>!! <math>\text{q}</math>!! <math>\text{r}</math>!!<math>\circ (p, q, r)</math>
|-
|-
| 0|| 0|| 0|| 0
| 0|| 0|| 0|| 0
Linia 510: Linia 418:


{| border="1"
{| border="1"
! <math>\textnormal{p}</math>!! <math>\textnormal{q}</math>!! <math>\textnormal{r}</math>!!<math>f_{p \rightarrow _(q \rightarrow r)}</math>
! <math>\text{p}</math>!! <math>\text{q}</math>!! <math>\text{r}</math>!!<math>f_{p \rightarrow _(q \rightarrow r)}</math>
|-
|-
| 0|| 0|| 0|| 1
| 0|| 0|| 0|| 1
Linia 562: Linia 470:




<center><math>g(C)=\begincases C\cup \{f(C')\} C \endcases
<center><math>g(C)=\begin{cases} C\cup \{f(C')\} C \end{cases}
</math></center>
</math></center>




<math> \displaystyle g(C)=\left\{\aligned C\cup \{f(C')\}\\C\endaligned \right</math>
<math>g(C)=\left\{\begin{align} C\cup \{f(C')\}\\C\end{align} \right</math>


<math> \displaystyle c\forall d\; c\in C \land d\in C \land c\sqsubseteq d\implies c\sqsubseteq' d,
<math>c\forall d\; c\in C \land d\in C \land c\sqsubseteq d\implies c\sqsubseteq' d,
(C,\sqsubseteq) \preccurlyeq (C',\sqsubseteq') \iff C\subset C' \land \left\{\aligned \forall c \forall d\; &(c\in C\land d\in C) \implies (c\sqsubseteq d \iff c\sqsubseteq' d) \textrm{ oraz }\\
(C,\sqsubseteq) \preccurlyeq (C',\sqsubseteq') \iff C\subset C' \land \left\{\begin{align} \forall c \forall d\; &(c\in C\land d\in C) \implies (c\sqsubseteq d \iff c\sqsubseteq' d) \text{ oraz }\\
\forall c \forall d\; &(c\in C\land d\in C'\setminus C) \implies c\sqsubseteq' d \endaligned \right</math>
\forall c \forall d\; &(c\in C\land d\in C'\setminus C) \implies c\sqsubseteq' d \end{align} \right</math>





Aktualna wersja na dzień 22:16, 11 wrz 2023

ϕ ψ ψϕ (ϕ(ψϕ))
 0   0       1                  1            
 0   1       0                  1            
 1   0       1                  1            
 1   1       1                  1            


Parser nie mógł rozpoznać (błąd składni): {\displaystyle \left| x \right|\ = \left\{ \begin{array}{rll} x & \text{ gdy }, x\geq 0 \\ -x & \text{ w przeciwnym przypadku}. \end{array}}


Parser nie mógł rozpoznać (błąd składni): {\displaystyle w_3 &\rightarrow bv_3v_2w_3v_1v_3v_3v_2\ |\ aw_3v_1v_3v_3v_2\ |\ bv_3v_2v_1v_3v_3v_2 \\ \begin{array}{lll} & & |\ av_1v_3v_3v_2\ |\ bv_3v_3v_2 \end{array}}

oraz

Parser nie mógł rozpoznać (błąd składni): {\displaystyle w_3 &\rightarrow bv_3v_2w_3v_1v_3v_3v_2w_3\ |\ aw_3v_1v_3v_3v_2w_3\ |\ bv_3v_2v_1v_3v_3v_2w_3 \\ \begin{array}{lll} & & |\ av_1v_3v_3v_2w_3\ |\ bv_3v_3v_2w_3 \end{array}}

Ostatecznie, gramatyka w postaci Greibach ma postać:

Parser nie mógł rozpoznać (błąd składni): {\displaystyle v_1 &\rightarrow bv_3v_2w_3v_1v_3\ |\ aw_3v_1v_3\ |\ bv_3v_2v_1v_3\ |\ av_1v_3\ |\ bv_3 \\ v_2 &\rightarrow bv_3v_2w_3v_1\ |\ aw_3v_1\ |\ bv_3v_2v_1\ |\ av_1\ |\ b \\ v_3 &\rightarrow bv_3v_2w_3\ |\ aw_3\ |\ bv_3v_2\ |\ a \\ w_3 &\rightarrow bv_3v_2w_3v_1v_3v_3v_2\ |\ aw_3v_1v_3v_3v_2\ |\ bv_3v_2v_1v_3v_3v_2 \\ \begin{array}{lll} & & |\ av_1v_3v_3v_2\ |\ bv_3v_3v_2 bv_3v_2w_3v_1v_3v_3v_2w_3 \\ & & |\ aw_3v_1v_3v_3v_2w_3\ |\ bv_3v_2v_1v_3v_3v_2w_3\ \\ & & |\ av_1v_3v_3v_2w_3\ |\ bv_3v_3v_2w_3 \end{array}}



KrokdodanedoSokresleniefdodanedoT0{q0}1{q0,q3}f({q0},a)={q0,q3}{q0,q1}f({q0},b)={q0,q1}2{q0,q3,q4}f({q0,q3},a)={q0,q3,q4}{q0,q3,q4}f({q0,q3},b)={q0,q1}f({q0,q1},a)={q0,q3}{q0,q1,q2}f({q0,q1},b)={q0,q1,q2}{q0,q1,q2}3f({q0,q3,q4},a)={q0,q3,q4}{q0,q1,q4}f({q0,q3,q4},b)={q0,q1,q4}{q0,q1,q4}{q0,q2,q3}f({q0,q1,q2},a)={q0,q2,q3}{q0,q2,q3}f({q0,q1,q2},b)={q0,q1,q2}4f({q0,q1,q4},a)={q0,q3,q4}{q0,q1,q2,q4},f({q0,q1,q4},b)={q0,q1,q2,q4}{q0,q1,q2,q4}{q0,q2,q3,q4}f({q0,q2,q3},a)={q0,q2,q3,q4}{q0,q2,q3,q4}f({q0,q2,q3},b)={q0,q1,q2}5f({q0,q1,q2,q4},a)={q0,q2,q3,q4}f({q0,q1,q2,q4},b)={q0,q1,q2,q4}f({q0,q2,q3,q4},a)={q0,q2,q3,q4}f({q0,q2,q3,q4},b)={q0,q1,q2,q4}



(s0,)(sA,,0)(s0,0)(r0,,1)(s0,1)(r1,,1)(r0,)(sR,,0)(r0,0)(r0,0,1)(r0,1)(r0,1,1)(r0,)(q0,,1)(r0,0)(r0,0,1)(r0,1)(r0,1,1)(q0,0)(l,,1)(q0,1)(sR,,1)(r1,)(sR,,0)(r1,0)(r1,0,1)(r1,1)(r1,1,1)(r1,)(q1,,1)(r1,0)(r1,0,1)(r1,1)(r1,1,1)(q1,0)(sR,,0)(q1,1)(l,,1)(l,)(s0,,1)(l,0)(l,0,1)(l,1)(l,1,1)(sR,)(sR,,0)(sA,)(sA,,0)




(s0,)(sR,,0)(s1,)(s1,,1)(s0,0)(s1,,1)(s1,0)(s2,,1)(s1,)(sA,,0)(s2,)(s2,,1)(s3,0)(s2,,1)(s2,)(s4,,1)(s3,)(s3,,1)(s2,0)(s3,0,1)(s3,)(sR,,0)(s4,0)(s4,0,1)(s4,)(s4,,1)(s4,)(s2,,1)(sA,)(sA,,0)(sR,)(sR,,0)





s0s1s2τ𝒜(1)s0s1s2τ𝒜(a)s1s2s2τ𝒜(b)s0s0s0τ𝒜(a2)s2s2s2τ𝒜(ab)s0s0s2τ𝒜(ba)s1s1s1τ𝒜(b2)s0s0s0τ𝒜(aba)s1s1s2............


fs0s1s2s3as1s2s0s2bs3s2s2s2


Algorytm Minimalizuj2 - algorytm minimalizacji automatu wykorzystujący stabilizujący się ciąg relacji



  1  Wejście: 𝒜=(S,A,f,s0,T) - automat taki, że L=L(𝒜).
  2  Wyjście: automat minimalny 𝒜=(S,A,f,s0,T) dla 𝒜.
  3  ρ1𝒜;
  4  i1;
  5  repeat
  6    Parser nie mógł rozpoznać (nieznana funkcja „\slash”): {\displaystyle \slash \slash}
 oblicz ρi: s1ρis2(s1ρi1s2)(aA f(s1,a)ρi1f(s2,a));
  7    ii+1;
  8    empty(ρi) 
  9    for each (s1,s2)S×S do
 10      flagtrue;
 11      for each aA 
 12        if not f(s1,a)ρi1f(s2,a) then
 13          flagfalse;
 14        end if
 15      end for
 16      if flag=true and s1ρi1s2 then
 17        ρiρi{(s1,s2)};
 18      end if
 19    end for
 20  until ρi=ρi1
 21  Parser nie mógł rozpoznać (nieznana funkcja „\slash”): {\displaystyle S' \leftarrow S \slash \overline{\rho}_i}
;
 22  for each Parser nie mógł rozpoznać (nieznana funkcja „\slash”): {\displaystyle [s]_{\overline{\rho}_i} \in S \slash \overline{\rho}_i}
 do
 23    for each aA do
 24      f([s]ρi,a)[f(s,a)]ρi;
 25    end for
 26  end for
 27  s0[s0]ρi;
 28  T{[t]ρi: tT};
 29  return 𝒜=(S,A,f,s0,T);



Uzupelnij tytul

s0 || s1 || s2

τ𝒜(1) || s0 || s1 || s2

τ𝒜(a) || s1 || s2 || s2

τ𝒜(b) || s0 || s0 || s0

τ𝒜(a2) || s2 || s2 || s2

τ𝒜(ab) || s0 || s0 || s2

τ𝒜(ba) || s1 || s1 || s1

τ𝒜(b2) || s0 || s0 || s0

τ𝒜(aba) || s1 || s1 || s2

... || ... || ... || ...


b) limx2+(x2)e1x2=limx2+e1x2(x2)1[]=Hlimx2+(x2)2e1x2(x2)2==limx2+e1x2=+;


 alalalalaa
alala
Złożoność czasowa Złożoność pamięciowa
Maszyna dodająca f(0)=1
f(1)=3
f(n)=n+3;n2
f(0)=2
f(1)=3
f(n)=n+1;n2
Maszyna rozpoznająca ww f(n)=6+8++(n+3)+2;n=2k+1
f(n)=5+7++(n+3)+1;n=2k
f(n)=n+1


0 1 ... ...
Cell1 Cell2


0 1
 0   1   1 
 1   0   1 


p ¬p
 0   1 
 1   0 


0 1
 0   0   0 
 1   0   1 
0 1
 0   0   1 
 1   1   1 
p q pq ¬(pq) ¬p ¬q ¬p¬q
 0   0  0 1 1 1 1
 0   1  0 1 1 0 1
 1   0  0 1 0 1 1
 1   1  1 0 0 0 0


p q r (pq) (pr) (q¬r) (pr)(q¬r) (pq)((pr)(q¬r))
0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 1
0 1 0 0 0 1 1 1
0 1 1 0 0 0 0 1
1 0 0 0 0 0 0 1
1 0 1 0 1 0 1 1
1 1 0 1 0 1 1 1
1 1 1 1 1 0 1 1


Numer
funkcji
p=0
q=0
p=0
q=1
p=1
q=0
p=1
q=1
   
0 0 0 0 0   F
1 0 0 0 1  
2 0 0 1 0   ¬(pq)
3 0 0 1 1   p
4 0 1 0 0   ¬(qp)
5 0 1 0 1   q
6 0 1 1 0   XOR
7 0 1 1 1  
8 1 0 0 0   NOR
9 1 0 0 1  
10 1 0 1 0   ¬q
11 1 0 1 1   qp
12 1 1 0 0   ¬p
13 1 1 0 1   pq
14 1 1 1 0   NAND
15 1 1 1 1   T


p q r (pq) (pq)r (qr) p(qr)
0 0 0 1 0 1 0
0 0 1 1 1 0 1
0 1 0 0 1 0 1
0 1 1 0 0 1 0
1 0 0 0 1 1 1
1 0 1 0 0 0 0
1 1 0 1 0 0 0
1 1 1 1 1 1 1


p q r (p,q,r)
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1


p q r fp(qr)
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1


0 1 2
 0   2   2   2 
 1   0   2   2 
 2   0   1   2 

σ^(f(t0,..,tn))=I(f)(σ^(t0),..,σ^(tn))


X*={1}XX2...Xn=i=0Xi






Nagroda Goedla
Zobacz Nagroda Goedla]]

Nagroda Turinga
Zobacz Nagroda Turinga

Nagroda Knutha
Zobacz Nagroda Knutha


g(C)={C{f(C)}C


Parser nie mógł rozpoznać (błąd składni): {\displaystyle g(C)=\left\{\begin{align} C\cup \{f(C')\}\\C\end{align} \right}

Parser nie mógł rozpoznać (błąd składni): {\displaystyle c\forall d\; c\in C \land d\in C \land c\sqsubseteq d\implies c\sqsubseteq' d, (C,\sqsubseteq) \preccurlyeq (C',\sqsubseteq') \iff C\subset C' \land \left\{\begin{align} \forall c \forall d\; &(c\in C\land d\in C) \implies (c\sqsubseteq d \iff c\sqsubseteq' d) \text{ oraz }\\ \forall c \forall d\; &(c\in C\land d\in C'\setminus C) \implies c\sqsubseteq' d \end{align} \right}


h(0,a)=f(a) dla każdego Parser nie mógł rozpoznać (błąd składni): {\displaystyle a \in A \\h(n', a) = g(h(n, a), n, a)} dla każdego aA i n


e(0,a)=f(a) dla każdego Parser nie mógł rozpoznać (błąd składni): {\displaystyle a \in A \\ e(g(n, a), n, a)} dla każdego aA i nm