Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

563501 views
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
3
<!-- $Id: schutzenberger.xml,v 0.998 Exp $ -->
4
<Chapter>
5
<Heading>User friendly ways to give semigroups and automata</Heading>
6
This chapter describes two Tcl/Tk graphical interfaces that can be used to
7
define and edit semigroups and automata.
8
9
10
<Section>
11
<Heading>
12
Finite automata
13
</Heading>
14
<ManSection>
15
<Func Arg="[A]" Name="XAutomaton" />
16
<Description>
17
The function <C> Xautomaton </C> without arguments opens a new window where
18
an automaton may be specified. A finite automaton (which may then be edited)
19
may be given as argument.
20
</Description>
21
</ManSection>
22
<Example><![CDATA[
23
gap> XAutomaton();
24
]]></Example>
25
It opens a window like the following:
26
<P />
27
<Alt Only="LaTeX">
28
\begin{center}
29
\includegraphics[width=0.4\textwidth]{images/xaut.png}
30
\end{center}
31
</Alt>
32
<Alt Only="HTML">
33
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xaut.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
34
</Alt>
35
<C> Var </C> is the &GAP; name of the automaton, <C> States </C> is the
36
number of states, <C> Alphabet </C> represents the alphabet and may be given
37
through a positive integer (in this case the alphabet is understood to be <C>
38
a,b,c,... </C>) or through a string whose symbols, in order, being the letters
39
of the alphabet. The numbers corresponding to the initial
40
and accepting states are placed in the respective boxes. The automaton may be
41
specified to be deterministic, non deterministic or with epsilon
42
transitions. After pressing the <B> transition matrix </B> button the window
43
gets larger and the
44
transition matrix of the automaton may be given.
45
The <E>i</E>th row of the matrix describes the action of the
46
<E>i</E>th letter on the states.
47
<Alt Only="LaTeX">
48
\begin{center}
49
\includegraphics[width=0.4\textwidth]{images/xautoma.png}
50
\end{center}
51
</Alt>
52
<Alt Only="HTML">
53
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xautoma.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
54
</Alt>
55
A non deterministic automaton may be given as follows:
56
<Alt Only="LaTeX">
57
\begin{center}
58
\includegraphics[width=0.4\textwidth]{images/xndAUT.png}
59
\end{center}
60
</Alt>
61
<Alt Only="HTML">
62
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xndAUT.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
63
</Alt>
64
<P/>
65
By pressing the button <B> Ok </B> the &GAP; shell aquires the aspect shown
66
in the following picture and the automaton <C> ndAUT </C> may be used to do
67
computations. Some computations such as getting a rational expression
68
representing the language of the automaton, the (complete) minimal automaton
69
representing the same language or the transition semigroup of the automaton,
70
may be done directly after pressing the <B> Functions</B> button.
71
<Alt Only="LaTeX">
72
\begin{center}
73
\includegraphics[width=0.4\textwidth]{images/xndAUTok.png}
74
\end{center}
75
</Alt>
76
<Alt Only="HTML">
77
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xndAUTok.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
78
</Alt>
79
<P/>
80
By pressing the button <B> View </B> an image representing the automaton is
81
displayed in a new window.
82
<Alt Only="LaTeX">
83
\begin{center}
84
\includegraphics[width=0.4\textwidth]{images/ndAutImage.png}
85
\end{center}
86
</Alt>
87
<Alt Only="HTML">
88
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/ndAutImage.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
89
</Alt>
90
An automaton with epsilon transitions may be given as follows shown in the
91
following picture. The last letter of the alphabet is always considered to be
92
the <M> \epsilon</M>. In the images it is represented by @.
93
<Alt Only="LaTeX">
94
\begin{center}
95
\includegraphics[width=0.4\textwidth]{images/EpsTrAut.png}
96
\end{center}
97
</Alt>
98
<Alt Only="HTML">
99
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/EpsTrAut.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
100
</Alt>
101
<P/>
102
A new window with an image representing the automaton may be obtained by pressing the button <B> View </B>.
103
<Alt Only="LaTeX">
104
\begin{center}
105
\includegraphics[width=0.4\textwidth]{images/EpsTrAutImage.png}
106
\end{center}
107
</Alt>
108
<Alt Only="HTML">
109
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/EpsTrAutImage.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
110
</Alt>
111
112
<P/>
113
In the next example it is given an argument to the function <C>XAutomaton</C>.
114
<Example><![CDATA[
115
gap> A := RandomAutomaton("det",2,2);
116
< deterministic automaton on 2 letters with 2 states >
117
gap> XAutomaton(A);
118
]]></Example>
119
It opens a window like the following:
120
<P />
121
<Alt Only="LaTeX">
122
\begin{center}
123
\includegraphics[width=0.4\textwidth]{images/xautgiven.png}
124
\end{center}
125
</Alt>
126
<Alt Only="HTML">
127
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xautgiven.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
128
</Alt>
129
130
</Section>
131
<Section>
132
<Heading> Finite semigroups </Heading>
133
The most common ways to give a semigroup to are through generators and
134
relations, a set of (partial) transformations as generating set and as
135
syntactic semigroups of automata or rational languages.
136
<ManSection>
137
<Func Arg="[S]" Name="XSemigroup" />
138
<Description>
139
The function <C> XSemigroup </C> without arguments opens a new window where
140
a semigroup (or monoid) may be specified. A finite semigroup (which may then be edited) may be given as argument.
141
</Description>
142
</ManSection>
143
<Example><![CDATA[
144
gap> XSemigroup();
145
]]></Example>
146
It opens a window like the following:
147
<Alt Only="LaTeX">
148
\begin{center}
149
\includegraphics[width=0.4\textwidth]{images/xsgp.png}
150
\end{center}
151
</Alt>
152
<Alt Only="HTML">
153
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xsgp.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
154
</Alt>
155
where one may choose how to give the semigroup.
156
157
<Subsection>
158
<Heading>
159
Semigroups given through generators and relations
160
</Heading>
161
In the window opened by <C>XSemigroup</C>, by pressing the button
162
<B>Proceed</B> the window should enlarge and have the following aspect.
163
(If the window does not enlarge automatically, use the mouse to do it.)
164
165
<P />
166
<Alt Only="LaTeX">
167
\begin{center}
168
\includegraphics[width=0.4\textwidth]{images/xb211.png}
169
\end{center}
170
</Alt>
171
<Alt Only="HTML">
172
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xb211.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
173
</Alt>
174
<C> GAP variable </C> is the &GAP; name of the semigroup. One has then to specify the
175
number of generators, the number of relations (which does not to be exact)
176
and whether one wants to produce a monoid or a semigroup.
177
Pressing the <B>Proceed</B> button one gets:
178
<Alt Only="LaTeX">
179
\begin{center}
180
\includegraphics[width=0.4\textwidth]{images/xb212.png}
181
\end{center}
182
</Alt>
183
<Alt Only="HTML">
184
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xb212.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
185
</Alt>
186
187
<Alt Only="LaTeX">
188
\begin{center}
189
\includegraphics[width=0.4\textwidth]{images/xb21.png}
190
\end{center}
191
</Alt>
192
<Alt Only="HTML">
193
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/xb21.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
194
195
When giving the relations, the usual abbreviations "0" and "1" may be used.
196
<P/>
197
Pressing the <B>Done</B> button would output the following to the shell where <Package>GAP</Package>
198
is running:
199
</Alt>
200
<Alt Only="LaTeX">
201
\begin{center}
202
\includegraphics[width=0.4\textwidth]{images/gapb21.png}
203
\end{center}
204
</Alt>
205
<Alt Only="HTML">
206
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/gapb21.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
207
</Alt>
208
<Alt Only="LaTeX">
209
<P/>
210
The menu button <B>Functions</B> has the following commands:
211
\begin{center}
212
\includegraphics[width=0.4\textwidth]{images/funcsind.png}
213
\includegraphics[width=0.4\textwidth]{images/funcsmenu.png}
214
\end{center}
215
216
The interface allows to add and remove &GAP; functions to the menu. When
217
adding a function, the name of the function should be provided.
218
(In its current version, it works only with functions that have
219
as only argument a semigroup.)
220
221
<P/>
222
223
By pressing the menu button <B>Functions</B> and selecting "Draw Schutzenberger Graphs" would
224
pop up the following window:
225
\begin{center}
226
\includegraphics[width=0.4\textwidth]{images/ShuzenbergerGraphb21.png}
227
\end{center}
228
</Alt>
229
230
<Alt Only="HTML">
231
<P/>
232
The menu button <B>Functions</B> has the following commands:
233
&#60;br&#62;&#60;center&#62;
234
&#60;img src=&#34;images/funcsind.png&#34;&#62;
235
&#60;img src=&#34;images/funcsmenu.png&#34;&#62;
236
&#60;/center&#62;&#60;br&#62;
237
238
The interface allows to add and remove &GAP; functions to the menu. When
239
adding a function, the name of the function should be provided.
240
(In its current version, it works only with functions that have
241
as only argument a semigroup.)
242
243
<P/>
244
245
By pressing the menu button <B>Functions</B> and selecting "Draw Schutzenberger Graphs" would
246
pop up the following window:
247
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/ShuzenbergerGraphb21.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
248
</Alt>
249
250
<Alt Only="LaTeX">
251
\begin{center}
252
\includegraphics[width=0.4\textwidth]{images/CayleyGraphb21.png}
253
\end{center}
254
</Alt>
255
<Alt Only="HTML">
256
By pressing the menu button <B>Functions</B> and selecting "Draw Cayley Graph" would
257
pop up the following window:
258
259
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/CayleyGraphb21.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
260
</Alt>
261
262
<Alt Only="LaTeX">
263
\begin{center}
264
\includegraphics[width=0.4\textwidth]{images/DClassesb21.png}
265
\end{center}
266
</Alt>
267
<Alt Only="HTML">
268
By pressing the menu button <B>Functions</B> and selecting "Draw D-Classes" would
269
pop up the following window:
270
271
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/DClassesb21.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
272
</Alt>
273
</Subsection>
274
275
<Subsection>
276
<Heading>
277
Semigroups given by partial transformations
278
</Heading>
279
280
<Code>XSemigroup(poi3);</Code> would pop up the following window, where everything should be clear:
281
282
<Alt Only="LaTeX">
283
\begin{center}
284
\includegraphics[width=0.4\textwidth]{images/Xsemigroup1.png}
285
\end{center}
286
</Alt>
287
<Alt Only="HTML">
288
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/Xsemigroup1.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
289
</Alt>
290
291
292
</Subsection>
293
294
295
<Subsection>
296
<Heading>
297
Syntatic semigroups
298
</Heading>
299
300
<Code>XSemigroup();</Code> would pop up the following window, where we would select "Syntatic semigroup",
301
press the <B>Proceed</B> button and then choose either to give a "Rational expression" or an "Automaton"
302
by pressing one of those buttons:
303
304
<Alt Only="LaTeX">
305
\begin{center}
306
\includegraphics[width=0.4\textwidth]{images/Xsemigroup2.png}
307
\end{center}
308
</Alt>
309
<Alt Only="HTML">
310
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/Xsemigroup2.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
311
</Alt>
312
313
If "Rational expression" is chosen, a new window pops up where the expression can be specified:
314
<Alt Only="LaTeX">
315
\begin{center}
316
\includegraphics[width=0.4\textwidth]{images/regexp.png}
317
\end{center}
318
</Alt>
319
<Alt Only="HTML">
320
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/regexp.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
321
</Alt>
322
323
After pressing the <B>Ok</B> button, notice that the menu button <B>Functions</B>
324
appears on the main window (lower right corner) meaning that <Package>GAP</Package>
325
already recognizes the given semigroup:
326
<Alt Only="LaTeX">
327
\begin{center}
328
\includegraphics[width=0.4\textwidth]{images/regexp2.png}
329
\end{center}
330
</Alt>
331
<Alt Only="HTML">
332
&#60;br&#62;&#60;center&#62;&#60;img src=&#34;images/regexp2.png&#34;&#62;&#60;/center&#62;&#60;br&#62;
333
</Alt>
334
335
336
</Subsection>
337
338
339
340
</Section>
341
342
</Chapter>
343
344