-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
728 lines (714 loc) · 46.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
<!doctype html>
<html lang="en" class="h-100">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<!-- Jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Custom styles for this template -->
<link href="sticky-footer-navbar.css" rel="stylesheet">
<link href="custom.css" rel="stylesheet">
<link href="svg_style.css" rel="stylesheet">
<link rel="icon" type="image/png" href="nanotechnology.png"/>
<title>Teoria de Linguagens</title>
</head>
<body class="d-flex flex-column h-100">
<header>
<!-- Fixed navbar -->
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="#"><img src="nanotechnology.png" alt="logo" style="width: 30px;"></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse"
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav me-auto mb-2 mb-md-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#explain">Conteúdo</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#automatos">Implementação</a>
</li>
<!-- <li class="nav-item">-->
<!-- <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>-->
<!-- </li>-->
</ul>
</div>
</div>
</nav>
</header>
<!-- Begin page content -->
<main id="home" class="flex-shrink-0">
<div class="container">
<h1 class="mt-5 text-center">Teoria de Linguagens</h1>
<p class="lead text-center">Neste trabalho é possível testar palavras para um automato finito determinístico
derivado da expressão regular 7(0b + 9a)+7 através de arquivos em formato especifico ou por inputs
individuais.
Dessa maneira, é possível verificar se as palavras testadas são aceitas ou não pelo autômato. Todo o
conteúdo para obter o AFD a partir da ER pode ser verificado logo a seguir.
</p>
</div>
</main>
<section id="explain">
<div class="container">
<hr>
<h1 class="mt-5">Conteúdo</h1>
<div class="d-flex align-items-start my-tabs m-3">
<div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<a class="nav-link active" id="er-tab" data-bs-toggle="pill" href="#er-pill" role="tab"
aria-controls="v-pills-home" aria-selected="true">ER</a>
<a class="nav-link" id="afne-tab" data-bs-toggle="pill" href="#afne-pill" role="tab"
aria-controls="v-pills-profile" aria-selected="false">AFN-e</a>
<a class="nav-link" id="afn-tab" data-bs-toggle="pill" href="#afn-pill" role="tab"
aria-controls="v-pills-profile" aria-selected="false">AFN</a>
<a class="nav-link" id="afd-tab" data-bs-toggle="pill" href="#afd-pill" role="tab"
aria-controls="v-pills-profile" aria-selected="false">AFD</a>
<!-- <a class="nav-link" id="v-pills-messages-tab" data-bs-toggle="pill" href="#v-pills-messages" role="tab" aria-controls="v-pills-messages" aria-selected="false">Automato 3</a>-->
</div>
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="er-pill" role="tabpanel" aria-labelledby="er-tab">
<div class="row">
<div class="col-lg-6">
<h4>Expressões Regulares</h4>
Toda linguagem regular pode ser descrita por uma ER, pois ela é um formalismo denotacional
(gerador) e é definida a partir de conjuntos (linguagens) básicos, concatenação e união.
Em compiladores, por exemplo, ao projetar linguagens de programação, as ER são úteis no
processo de análise sintática. Além de serem adequadas para a comunicação entre humanos ou
de humanos com as máquinas.
</div>
<div class="col-lg-6">
<div class="card mt-2">
<div class="card-body">
<h5 class="card-title"><span class="badge rounded-pill bg-secondary">ER</span></h5>
<!-- Title: afn Pages: 1 -->
<table class="tg">
<thead>
<tr>
<th class="tg-fymr">ER</th>
<th class="tg-fymr">Linguagem Gerada</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tg-0pky">aa</td>
<td class="tg-0pky">Somente a palavra aa</td>
</tr>
<tr>
<td class="tg-0pky">ba*</td>
<td class="tg-0pky">Palavras iniciadas em b, seguido por zero ou mais a</td>
</tr>
<tr>
<td class="tg-0pky">(a + b)*</td>
<td class="tg-0pky">Todas as palavras sobre { a, b }</td>
</tr>
<tr>
<td class="tg-0pky">(a + e)(b + ba)*</td>
<td class="tg-0pky">Todas as palavras que não possuem dois a consecutivos
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="afne-pill" role="tabpanel" aria-labelledby="afne-tab">
<div class="row">
<div class="col-lg-6">
<h4>AFN com Mov. Vazio</h4>
A computação de um AFN-e é análoga à de um AFN, assim, ele é também não-determinístico
assumindo simultaneamente mais de um estado. No caso do processamento de uma transição vazia
ele assume ao mesmo tempo os estados destino e origem, e a sua leitura não consome nenhum
simbolo da fita.
</div>
<div class="col-lg-6">
<div class="card mt-2">
<div class="card-body">
<h5 class="card-title"><span class="badge rounded-pill bg-secondary">AFN_e</span>
</h5>
<!-- Title: afne Pages: 1 -->
<svg width="223pt" height="169pt"
viewBox="0.00 0.00 223.39 168.90" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph"
transform="scale(1 1) rotate(0) translate(4 164.9)">
<title>afne</title>
<polygon fill="white" stroke="transparent"
points="-4,4 -4,-164.9 219.39,-164.9 219.39,4 -4,4"/>
<!-- qf -->
<g id="node1" class="node">
<title>qf</title>
<ellipse fill="none" stroke="black" cx="191.24" cy="-136.75" rx="24.3"
ry="24.3"/>
<ellipse fill="none" stroke="black" cx="191.24" cy="-136.75" rx="18.27"
ry="18.27" style="stroke-width: 3;"/>
<text text-anchor="middle" x="191.24" y="-133.05"
font-family="Times,serif"
font-size="14.00">qf
</text>
</g>
<!-- qi -->
<g id="node2" class="node">
<title>qi</title>
<ellipse fill="black" stroke="black" cx="1.8" cy="-22.75" rx="1.8"
ry="1.8"/>
</g>
<!-- q0 -->
<g id="node3" class="node">
<title>q0</title>
<ellipse fill="none" stroke="black" cx="63.35" cy="-22.75" rx="23"
ry="23"/>
<text text-anchor="middle" x="63.35" y="-19.05"
font-family="Times,serif"
font-size="14.00">q0
</text>
</g>
<!-- qi->q0 -->
<g id="edge1" class="edge">
<title>qi->q0</title>
<path fill="none" stroke="black"
d="M3.83,-22.75C7.23,-22.75 18.48,-22.75 30.22,-22.75"/>
<polygon fill="black" stroke="black"
points="30.48,-26.25 40.48,-22.75 30.48,-19.25 30.48,-26.25"/>
</g>
<!-- q1 -->
<g id="node4" class="node">
<title>q1</title>
<ellipse fill="none" stroke="black" cx="191.24" cy="-60.75" rx="23"
ry="23"/>
<text text-anchor="middle" x="191.24" y="-57.05"
font-family="Times,serif"
font-size="14.00">q1
</text>
</g>
<!-- q0->q1 -->
<g id="edge2" class="edge">
<title>q0->q1</title>
<path fill="none" stroke="black"
d="M86.04,-18.9C103.65,-16.73 128.81,-15.83 149.1,-23.75 156.23,-26.53 162.92,-31.17 168.74,-36.24"/>
<polygon fill="black" stroke="black"
points="166.46,-38.9 176.1,-43.29 171.29,-33.85 166.46,-38.9"/>
<text text-anchor="middle" x="126.6" y="-27.55"
font-family="Times,serif"
font-size="14.00">7
</text>
</g>
<!-- q2 -->
<g id="node5" class="node">
<title>q2</title>
<ellipse fill="none" stroke="black" cx="63.35" cy="-98.75" rx="23"
ry="23"/>
<text text-anchor="middle" x="63.35" y="-95.05"
font-family="Times,serif"
font-size="14.00">q2
</text>
</g>
<!-- q1->q2 -->
<g id="edge3" class="edge">
<title>q1->q2</title>
<path fill="none" stroke="black"
d="M168.52,-56.79C150.58,-54.49 124.79,-53.47 104.1,-61.75 97.39,-64.43 91.14,-68.82 85.67,-73.65"/>
<polygon fill="black" stroke="black"
points="82.96,-71.41 78.26,-80.91 87.85,-76.42 82.96,-71.41"/>
<text text-anchor="middle" x="126.6" y="-65.55"
font-family="Times,serif"
font-size="14.00">0b, 9a
</text>
</g>
<!-- q2->qf -->
<g id="edge5" class="edge">
<title>q2->qf</title>
<path fill="none" stroke="black"
d="M85.42,-105.11C105.3,-111.11 135.37,-120.19 158.22,-127.08"/>
<polygon fill="black" stroke="black"
points="157.24,-130.44 167.83,-129.98 159.27,-123.74 157.24,-130.44"/>
<text text-anchor="middle" x="126.6" y="-126.55"
font-family="Times,serif"
font-size="14.00">7
</text>
</g>
<!-- q2->q1 -->
<g id="edge4" class="edge">
<title>q2->q1</title>
<path fill="none" stroke="black"
d="M85.79,-93.91C103.04,-89.85 127.83,-83.62 149.1,-76.75 152.74,-75.57 156.53,-74.25 160.26,-72.87"/>
<polygon fill="black" stroke="black"
points="161.8,-76.03 169.9,-69.2 159.31,-69.49 161.8,-76.03"/>
<text text-anchor="middle" x="126.6" y="-93.55"
font-family="Times,serif"
font-size="14.00">ℰ
</text>
</g>
</g>
</svg>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="afn-pill" role="tabpanel" aria-labelledby="afn-tab">
<div class="row">
<div class="col-lg-6">
<div class="card mt-2">
<div class="card-body">
<h5 class="card-title"><span class="badge rounded-pill bg-secondary">AFN</span></h5>
<!-- Title: afn Pages: 1 -->
<svg width="223pt" height="169pt"
viewBox="0.00 0.00 223.39 168.90" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph"
transform="scale(1 1) rotate(0) translate(4 164.9)">
<title>afn</title>
<polygon fill="white" stroke="transparent"
points="-4,4 -4,-164.9 219.39,-164.9 219.39,4 -4,4"/>
<!-- qf -->
<g id="node1" class="node">
<title>qf</title>
<ellipse fill="none" stroke="black" cx="191.24" cy="-136.75" rx="24.3"
ry="24.3"/>
<ellipse fill="none" stroke="black" cx="191.24" cy="-136.75" rx="18.27"
ry="18.27" style="stroke-width: 3;"/>
<text text-anchor="middle" x="191.24" y="-133.05"
font-family="Times,serif"
font-size="14.00">qf
</text>
</g>
<!-- qi -->
<g id="node2" class="node">
<title>qi</title>
<ellipse fill="black" stroke="black" cx="1.8" cy="-22.75" rx="1.8"
ry="1.8"/>
</g>
<!-- q0 -->
<g id="node3" class="node">
<title>q0</title>
<ellipse fill="none" stroke="black" cx="63.35" cy="-22.75" rx="23"
ry="23"/>
<text text-anchor="middle" x="63.35" y="-19.05"
font-family="Times,serif"
font-size="14.00">q0
</text>
</g>
<!-- qi->q0 -->
<g id="edge1" class="edge">
<title>qi->q0</title>
<path fill="none" stroke="black"
d="M3.83,-22.75C7.23,-22.75 18.48,-22.75 30.22,-22.75"/>
<polygon fill="black" stroke="black"
points="30.48,-26.25 40.48,-22.75 30.48,-19.25 30.48,-26.25"/>
</g>
<!-- q1 -->
<g id="node4" class="node">
<title>q1</title>
<ellipse fill="none" stroke="black" cx="191.24" cy="-60.75" rx="23"
ry="23"/>
<text text-anchor="middle" x="191.24" y="-57.05"
font-family="Times,serif"
font-size="14.00">q1
</text>
</g>
<!-- q0->q1 -->
<g id="edge2" class="edge">
<title>q0->q1</title>
<path fill="none" stroke="black"
d="M86.04,-18.9C103.65,-16.73 128.81,-15.83 149.1,-23.75 156.23,-26.53 162.92,-31.17 168.74,-36.24"/>
<polygon fill="black" stroke="black"
points="166.46,-38.9 176.1,-43.29 171.29,-33.85 166.46,-38.9"/>
<text text-anchor="middle" x="126.6" y="-27.55"
font-family="Times,serif"
font-size="14.00">7
</text>
</g>
<!-- q2 -->
<g id="node5" class="node">
<title>q2</title>
<ellipse fill="none" stroke="black" cx="63.35" cy="-98.75" rx="23"
ry="23"/>
<text text-anchor="middle" x="63.35" y="-95.05"
font-family="Times,serif"
font-size="14.00">q2
</text>
</g>
<!-- q1->q2 -->
<g id="edge3" class="edge">
<title>q1->q2</title>
<path fill="none" stroke="black"
d="M168.52,-56.79C150.58,-54.49 124.79,-53.47 104.1,-61.75 97.39,-64.43 91.14,-68.82 85.67,-73.65"/>
<polygon fill="black" stroke="black"
points="82.96,-71.41 78.26,-80.91 87.85,-76.42 82.96,-71.41"/>
<text text-anchor="middle" x="126.6" y="-65.55"
font-family="Times,serif"
font-size="14.00">0b, 9a
</text>
</g>
<!-- q2->qf -->
<g id="edge6" class="edge">
<title>q2->qf</title>
<path fill="none" stroke="black"
d="M85.42,-105.11C105.3,-111.11 135.37,-120.19 158.22,-127.08"/>
<polygon fill="black" stroke="black"
points="157.24,-130.44 167.83,-129.98 159.27,-123.74 157.24,-130.44"/>
<text text-anchor="middle" x="126.6" y="-126.55"
font-family="Times,serif"
font-size="14.00">7
</text>
</g>
<!-- q2->q1 -->
<g id="edge4" class="edge">
<title>q2->q1</title>
<path fill="none" stroke="black"
d="M85.79,-93.91C103.04,-89.85 127.83,-83.62 149.1,-76.75 152.74,-75.57 156.53,-74.25 160.26,-72.87"/>
<polygon fill="black" stroke="black"
points="161.8,-76.03 169.9,-69.2 159.31,-69.49 161.8,-76.03"/>
<text text-anchor="middle" x="126.6" y="-93.55"
font-family="Times,serif"
font-size="14.00">0b, 9a
</text>
</g>
<!-- q2->q2 -->
<g id="edge5" class="edge">
<title>q2->q2</title>
<path fill="none" stroke="black"
d="M56,-120.55C55.19,-130.66 57.64,-139.5 63.35,-139.5 67,-139.5 69.32,-135.87 70.3,-130.6"/>
<polygon fill="black" stroke="black"
points="73.8,-130.68 70.7,-120.55 66.81,-130.4 73.8,-130.68"/>
<text text-anchor="middle" x="63.35" y="-143.3"
font-family="Times,serif"
font-size="14.00">0b, 9a
</text>
</g>
</g>
</svg>
</div>
</div>
</div>
<div class="col-lg-6">
<h4>Autômato Finito Não Determinístico</h4>
Contudo, é possível construir um AFN a partir de um AFN-e, de maneira simplificada as
seguintes etapas foram seguidas:
<ul>
<li>Quais serão os estados finais?</li>
O único estado final será 'qf'.
<li>Fecho vazio de cada estado?</li>
O único estado com transição vazia é o estado 'q2', assim seu fecho vazio corresponde
a (q2,ε)∪((q2,ε),{9a, 0b, 7,ε}) = {q1, q2}
<li>Substituição das transições vazias</li>
O estado q2 lendo os símbolos {9a, 0b} tem como destino o
próprio q2 e o estado q1, assim a substituição da transição vazia resulta em um
self-loop
para q2, e uma aresta para q1.
</ul>
</div>
</div>
</div>
<div class="tab-pane fade" id="afd-pill" role="tabpanel" aria-labelledby="afd-tab">
<div class="row">
<div class="col-lg-6">
<h4>Autômato Finito Determinístico</h4>
A partir de um AFN qualquer é possível construir um AFD que realiza as mesmas combinações,
fazendo com que o segundo simule o primeiro. Os estados do AFD simulam combinações de
estados alternativos do AFD, assim, é possível verificar através de uma tabela
as combinações necessárias para que o autômato AFD seja gerado. Além disso, é preciso
destacar que diferentemente do AFN, o AFD não assume simultaneamente mais de um estado.
</div>
<div class="col-lg-6">
<div class="card mt-2">
<div class="card-body">
<h5 class="card-title"><span class="badge rounded-pill bg-secondary">Tabela de Transformação</span>
</h5>
<!-- Title: afn Pages: 1 -->
<table class="tg">
<thead>
<tr>
<th class="tg-0pky"></th>
<th class="tg-0pky" colspan="3"><b>Símbolos</b></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tg-0pky"><b>Estados</b></td>
<td class="tg-0pky">7</td>
<td class="tg-0pky">0b</td>
<td class="tg-0pky">9a</td>
</tr>
<tr>
<td class="tg-0pky">q0</td>
<td class="tg-0pky">q1</td>
<td class="tg-0pky">--</td>
<td class="tg-0pky">--</td>
</tr>
<tr>
<td class="tg-0pky">q1</td>
<td class="tg-0pky">--</td>
<td class="tg-0pky">q2</td>
<td class="tg-0pky">q2</td>
</tr>
<tr>
<td class="tg-0pky">q2</td>
<td class="tg-0pky">qf*</td>
<td class="tg-0pky">q1q2</td>
<td class="tg-0pky">q1q2</td>
</tr>
<tr>
<td class="tg-0pky">q1q2</td>
<td class="tg-0pky">qf*</td>
<td class="tg-0pky">q1q2</td>
<td class="tg-0pky">q1q2</td>
</tr>
<tr>
<td class="tg-0pky">qf*</td>
<td class="tg-0pky">--</td>
<td class="tg-0pky">--</td>
<td class="tg-0pky">--</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="automatos">
<div class="container">
<hr>
<h1 class="mt-5">Implementação do AFD</h1>
<div class="p">
Nesta seção é possível interagir com o AFD implementado de duas maneiras:
<ul>
<li>
Arquivo de Entrada: 1 palavra por linha.
</li>
<li>
Inputs de uma palavra por vez.
</li>
</ul>
Observe que os símbolos da palavra devem ser separados por vírgula.<br>
O alfabeto deste automato é {7, 0b, 9a}, assim uma entrada válida seria: <b>7,0b,7</b>.
</div>
<!-- Espaço para input de arquivos -->
<div class="row mt-4">
<div class="col-lg-6">
<div class="row">
<div class="col-lg-12">
<input type="file" name="inputfile" id="inputfile">
</div>
<div class="col-lg-12 mt-3">
<button id="file-btn" class="btn btn-primary" onclick="inicia_afd('arquivo')">Inicia AFD por
Arquivo
</button>
</div>
</div>
</div>
<div class="col-lg-6 output-col">
<div class="output-area">
<div id='file-output' class="out-text-area">
</div>
</div>
</div>
</div>
<hr>
<!-- Espaço para input de palavras separadamente -->
<div class="row mt-4">
<div class="col-lg-6">
<div class="row">
<div class="col-lg-5">
<label for="inputEntrada" class="sr-only">Ex. Entrada: 7,0b,7</label>
<input type="text" class="form-control mt-2" id="inputEntrada" placeholder="Digite aqui..">
</div>
<div class="col-lg-12 mt-3">
<button id="input-btn" class="btn btn-primary" onclick="inicia_afd('input')">Inicia AFD por
Input
</button>
</div>
</div>
</div>
<div class="col-lg-6 output-col">
<div class="output-area">
<div id="single-output" class="out-text-area">
</div>
</div>
</div>
</div>
<hr>
<!-- Display SVG do AFD -->
<div class="row mt-4">
<div class="col-lg-12">
<div class="card mt-2">
<div class="card-body">
<h5 class="card-title"><span class="badge rounded-pill bg-secondary">AFD</span></h5>
<!-- Title: afd Pages: 1 -->
<svg id="afd_plot" width="556pt" height="135pt"
viewBox="0.00 0.00 556.28 135.45" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph-afd" class="graph" transform="scale(1 1) rotate(0) translate(4 131.45)">
<title>afd</title>
<polygon fill="white" stroke="transparent"
points="-4,4 -4,-131.45 552.28,-131.45 552.28,4 -4,4"/>
<!-- qf -->
<g id="qf" class="node">
<title>qf</title>
<ellipse fill="none" stroke="black" cx="524.13" cy="-86.45" rx="24.3"
ry="24.3"/>
<ellipse fill="none" stroke="black" cx="524.13" cy="-86.45" rx="18.27"
ry="18.27" style="stroke-width: 3;"/>
<text text-anchor="middle" x="524.13" y="-82.75" font-family="Times,serif"
font-size="14.00">qf
</text>
</g>
<!-- qi -->
<g id="qi" class="node">
<title>qi</title>
<ellipse fill="black" stroke="black" cx="1.8" cy="-86.45" rx="1.8"
ry="1.8"/>
</g>
<!-- q0 -->
<g id="q0" class="node">
<title>q0</title>
<ellipse fill="none" stroke="black" cx="63.35" cy="-86.45" rx="23" ry="23"/>
<text text-anchor="middle" x="63.35" y="-82.75" font-family="Times,serif"
font-size="14.00">q0
</text>
</g>
<!-- qi->q0 -->
<g id="edgeqi" class="edge">
<title>qi->q0</title>
<path fill="none" stroke="black"
d="M3.83,-86.45C7.23,-86.45 18.48,-86.45 30.22,-86.45"/>
<polygon fill="black" stroke="black"
points="30.48,-89.95 40.48,-86.45 30.48,-82.95 30.48,-89.95"/>
</g>
<!-- q1 -->
<g id="q1" class="node">
<title>q1</title>
<ellipse fill="none" stroke="black" cx="154.84" cy="-86.45" rx="23"
ry="23"/>
<text text-anchor="middle" x="154.84" y="-82.75" font-family="Times,serif"
font-size="14.00">q1
</text>
</g>
<!-- q0->q1 -->
<g id="q0-q1" class="edge">
<title>q0->q1</title>
<path fill="none" stroke="black"
d="M86.47,-86.45C97.09,-86.45 110.02,-86.45 121.7,-86.45"/>
<polygon fill="black" stroke="black"
points="121.98,-89.95 131.98,-86.45 121.98,-82.95 121.98,-89.95"/>
<text text-anchor="middle" x="109.1" y="-90.25" font-family="Times,serif"
font-size="14.00">7
</text>
</g>
<!-- q2 -->
<g id="q2" class="node">
<title>q2</title>
<ellipse fill="none" stroke="black" cx="281.34" cy="-86.45" rx="23"
ry="23"/>
<text text-anchor="middle" x="281.34" y="-82.75" font-family="Times,serif"
font-size="14.00">q2
</text>
</g>
<!-- q1->q2 -->
<g id="q1-q2" class="edge">
<title>q1->q2</title>
<path fill="none" stroke="black"
d="M177.81,-86.45C197.37,-86.45 226.22,-86.45 248.34,-86.45"/>
<polygon fill="black" stroke="black"
points="248.59,-89.95 258.59,-86.45 248.59,-82.95 248.59,-89.95"/>
<text text-anchor="middle" x="218.09" y="-90.25" font-family="Times,serif"
font-size="14.00">0b, 9a
</text>
</g>
<!-- q2->qf -->
<g id="q2-qf" class="edge">
<title>q2->qf</title>
<path fill="none" stroke="black"
d="M303.01,-93.42C335.31,-103.4 399.69,-119.6 453.98,-110.45 466.9,-108.27 480.64,-103.95 492.43,-99.57"/>
<polygon fill="black" stroke="black"
points="493.76,-102.81 501.82,-95.92 491.23,-96.28 493.76,-102.81"/>
<text text-anchor="middle" x="419.53" y="-116.25" font-family="Times,serif"
font-size="14.00">7
</text>
</g>
<!-- q1q2 -->
<g id="q1q2" class="node">
<title>q1q2</title>
<ellipse fill="none" stroke="black" cx="419.53" cy="-34.45" rx="34.39"
ry="34.39"/>
<text text-anchor="middle" x="419.53" y="-30.75" font-family="Times,serif"
font-size="14.00">q1q2
</text>
</g>
<!-- q2->q1q2 -->
<g id="q2-q1q2" class="edge">
<title>q2->q1q2</title>
<path fill="none" stroke="black"
d="M302.73,-78.66C322.45,-71.13 352.89,-59.51 377.62,-50.07"/>
<polygon fill="black" stroke="black"
points="379.03,-53.28 387.12,-46.44 376.53,-46.74 379.03,-53.28"/>
<text text-anchor="middle" x="344.59" y="-75.25" font-family="Times,serif"
font-size="14.00">0b, 9a
</text>
</g>
<!-- q1q2->qf -->
<g id="q1q2-qf" class="edge">
<title>q1q2->qf</title>
<path fill="none" stroke="black"
d="M450.49,-49.63C463.81,-56.38 479.48,-64.32 492.84,-71.1"/>
<polygon fill="black" stroke="black"
points="491.6,-74.39 502.1,-75.79 494.76,-68.15 491.6,-74.39"/>
<text text-anchor="middle" x="476.98" y="-69.25" font-family="Times,serif"
font-size="14.00">7
</text>
</g>
<!-- q1q2->q1q2 -->
<g id="q1q2-q1q2" class="edge">
<title>q1q2->q1q2</title>
<path fill="none" stroke="black"
d="M409.04,-67.48C409.09,-78.29 412.59,-86.89 419.53,-86.89 424.09,-86.89 427.17,-83.19 428.76,-77.59"/>
<polygon fill="black" stroke="black"
points="432.25,-77.84 430.03,-67.48 425.31,-76.96 432.25,-77.84"/>
<text text-anchor="middle" x="419.53" y="-90.69" font-family="Times,serif"
font-size="14.00">0b, 9a
</text>
</g>
</g>
</svg>
</div>
</div>
</div>
</div>
<!-- Espaço para saida final de aceita ou rejeita palavra -->
<div id="saida-afd" class="row mt-2">
</div>
</div>
</section>
<footer class="footer mt-auto py-3 bg-light">
<div class="container">
<span class="text-muted">
<small>Desenvolvido por Bárbara Boechat, código disponível em <a href="https://github.com/Niehaus/teoria-linguagens" target="_blank">niehaus/teoria</a>.</small>
</span>
</div>
</footer>
<!-- Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW"
crossorigin="anonymous"></script>
<script type="text/javascript" src="https://unpkg.com/vis-data@latest/peer/umd/vis-data.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/vis-network@latest/peer/umd/vis-network.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/vis-network/styles/vis-network.min.css"/>
<script src="custom.js"></script>
<script src="automato.js"></script>
</body>
</html>