Test GR2: Różnice pomiędzy wersjami

Z Studia Informatyczne
Przejdź do nawigacjiPrzejdź do wyszukiwania
Rogoda (dyskusja | edycje)
Nie podano opisu zmian
Rogoda (dyskusja | edycje)
Nie podano opisu zmian
Linia 2: Linia 2:
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
   1  Wejście: <math>\displaystyle \mathcal{A}=(S, A, f, s_0, T)</math> - automat taki, że <math>\displaystyle L=L(\mathcal{A})</math>.
<math>\displaystyle 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>\displaystyle \mathcal{A}'=(S',A',f', s_0',
T')</math> dla <math>\displaystyle \mathcal{A}</math>.
T')</math> dla <math>\displaystyle \mathcal{A}</math>.
Linia 9: Linia 8:
   4  <math>\displaystyle i \leftarrow 1</math>;
   4  <math>\displaystyle 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>\displaystyle \slash \slash</math> oblicz <math>\displaystyle \overline{\rho}_i</math>: <math>\displaystyle 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>\displaystyle i \leftarrow i+1</math>;
   8   '''empty'''<math>\displaystyle (\overline{\rho}_i)</math>  
   8 '''empty'''<math>\displaystyle (\overline{\rho}_i)</math>  
   9   '''for''' '''each''' <math>\displaystyle (s_1,s_2)\in S\times S</math>  
   9 '''for''' '''each''' <math>\displaystyle (s_1,s_2)\in S\times S</math>  
   10     flag<math>\displaystyle \leftarrow</math>'''true''';
   10 flag<math>\displaystyle \leftarrow</math>'''true''';
   11     '''for''' '''each''' <math>\displaystyle a\in A</math>  
   11 '''for''' '''each''' <math>\displaystyle a\in A</math>  
   12       '''if''' '''not''' <math>\displaystyle f(s_1, a) \overline{\rho}_{i-1} f(s_2,a)</math>  
   12 '''if''' '''not''' <math>\displaystyle f(s_1, a) \overline{\rho}_{i-1} f(s_2,a)</math>  
   13         flag<math>\displaystyle \leftarrow</math>'''false''';
   13 flag<math>\displaystyle \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>\displaystyle 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>\displaystyle \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>\displaystyle \overline{\rho}_i = \overline{\rho}_{i-1}</math>}
   21  <math>\displaystyle S' \leftarrow S \slash \overline{\rho}_i</math>;
   21  <math>\displaystyle 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>\displaystyle [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>\displaystyle a \in A</math> '''do'''
   24 <math>\displaystyle f'([s]_{\overline{\rho}_i},a) \leftarrow
   24     <math>\displaystyle 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>\displaystyle s_0' \leftarrow [s_0]_{\overline{\rho}_i}</math>;

Wersja z 09:36, 24 sie 2006

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 \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 
 10      flagtrue;
 11      for each aA 
 12        if not f(s1,a)ρi1f(s2,a) 
 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 \displaystyle S' \leftarrow S \slash \overline{\rho}_i}
;
 22  for each Parser nie mógł rozpoznać (nieznana funkcja „\slash”): {\displaystyle \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 
Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{p}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{q}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{p} \wedge \textnormal{q}} ¬(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


Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{p}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{q}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{r}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle (\textnormal{p} \wedge \textnormal{q})} (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   Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{p}}
4 0 1 0 0   ¬(qp)
5 0 1 0 1   Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{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


Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{p}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{q}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{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


Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{p}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{q}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{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


Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{p}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{q}} Parser nie mógł rozpoznać (błąd składni): {\displaystyle \textnormal{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


Parser nie mógł rozpoznać (nieznana funkcja „\begincases”): {\displaystyle g(C)=\begincases C\cup \{f(C')\} C \endcases }


Parser nie mógł rozpoznać (nieznana funkcja „\aligned”): {\displaystyle \displaystyle g(C)=\left\{\aligned C\cup \{f(C')\}\\C\endaligned \right}

Parser nie mógł rozpoznać (nieznana funkcja „\aligned”): {\displaystyle \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\{\aligned \forall c \forall d\; &(c\in C\land d\in C) \implies (c\sqsubseteq d \iff c\sqsubseteq' d) \textrm{ oraz }\\ \forall c \forall d\; &(c\in C\land d\in C'\setminus C) \implies c\sqsubseteq' d \endaligned \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