-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
273 lines (254 loc) · 9.28 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DFA Simulator: Build and Test custom Machines</title>
<!-- Stylesheet and Bootstrap -->
<link rel="stylesheet" href="./styles.css" />
<link rel="stylesheet" href="./bootstrap/css/bootstrap.css" />
<!-- Jquery-->
<link rel="stylesheet" href="./jquery-ui/jquery-ui.css" />
<link rel="stylesheet" href="jquery-ui/jquery-ui.theme.css" />
<link rel="stylesheet" href="jquery-ui/jquery-ui.structure.css" />
</head>
<body style="background-color: #b4c3eb;">
<div
class="jumbotron"
style="background-color: aliceblue; padding: 4px; margin-top: 3px;"
>
<div class="hd container">
<h1 class="hd1 display-6">DFA - Simulator</h1>
<p class="lead">
Deterministic Finite Machine tester and simulator. Create and Test DFA
</p>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xl-10">
<!--Control pannel -->
<div class="btn-container container">
<input
type="button"
id="add-state"
class="btn-sm btn-primary"
value="Add State"
/>
<input
type="button"
id="connect-state"
class="btn-sm btn-primary"
value="State Transition"
/>
<input
type="button"
id="del-state"
class="btn-sm btn-primary"
value="Delete State"
/>
<input
type="button"
id="final-btn"
class="btn-sm btn-info"
value="Make Final State"
/>
<input
type="button"
id="test-btn"
class="btn btn-warning"
value="Test String"
/>
</div>
<!--Console -->
<div class="console container">
<p>Console: <span id="msg"></span></p>
</div>
<!-- Drawing Area -->
<div class="draw-area container">
<div id="q0" class="node">
<p>Q0</p>
<p id="q0-input-details" class="input-details"></p>
</div>
<!-- Modal for state connection -->
<div
class="modal fade"
id="connect-form"
tabindex="-1"
role="dialog"
aria-labelledby="State Transition"
aria-hidden="true"
>
<!--State Input detail form will append here -->
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">
Add a State Transition
</h5>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label id="from-state-lbl">From </label>
<input
type="text"
class="form-control form-control-sm"
id="from-state"
placeholder="Name of the state which takes the input"
/>
<p id="frm-validate" class="validators"></p>
</div>
<hr />
<div class="form-group">
<label id="from-state-lbl">Input </label>
<input
type="text"
class="form-control form-control-sm"
id="state-input"
placeholder="State Input"
/>
<p id="input-validate" class="validators"></p>
</div>
<hr />
<div class="form-group">
<label id="to-state-lbl">To State </label>
<input
type="text"
class="form-control form-control-sm"
id="to-state"
placeholder="Name of the state where the transition takes"
/>
<p id="to-validate" class="validators"></p>
</div>
</form>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
data-dismiss="modal"
>
Cancel
</button>
<button
type="button"
id="add-transition-btn"
class="btn btn-primary"
>
Connect states
</button>
</div>
</div>
</div>
</div>
<!--Modal for Simulate-->
<div
class="modal fade"
id="test-form"
tabindex="-1"
role="dialog"
aria-labelledby="Test-DFA"
aria-hidden="true"
>
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">
Test Your DFA
</h5>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label id="tst-str">Input String </label>
<input
type="text"
class="form-control form-control-sm"
id="input-str"
placeholder="Enter the input string to test machine"
/>
<p id="input-str-validator" class="validators"></p>
</div>
</form>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-secondary"
data-dismiss="modal"
>
Cancel
</button>
<button type="button" id="run-btn" class="btn btn-success">
Run Simulation
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Input string Display-->
<div class="input-info container">
<p id="test-string-disp">String Test Info</p>
</div>
</div>
<!-- Rules container -->
<div id="rule-box" class="col-xl-2" style="padding: 4px;">
<h3 id="rule-header">DFA Rules</h3>
<ul class="list-group">
<li class="list-group-item">
DFA refers to deterministic finite automata. Deterministic refers
to the uniqueness of the computation. The finite automata are
called deterministic finite automata if the machine is read an
input string one symbol at a time.
</li>
<li class="list-group-item">
In DFA, there is only one path for specific input from the current
state to the next state.
</li>
<li class="list-group-item">
DFA does not accept the null move, i.e., the DFA cannot change
state without any input character.
</li>
<li class="list-group-item">
DFA can contain multiple final states.
</li>
</ul>
</div>
<!-- Rules container Ends-->
</div>
</div>
<!-- Scripts-->
<script src="./js/jquery-3.4.1.min.js"></script>
<script src="jquery.connections.js"></script>
<script src="./divVars.js"></script>
<script src="./simulator.js"></script>
<script src="./jquery-ui/jquery-ui.js"></script>
<script src="./bootstrap/js/bootstrap.min.js"></script>
<hr />
<!-- Footer
<footer class="page-footer font-small blue pt-4">
<div class="footer-copyright text-center py-3">
© 2020 Copyright:
<a href="http://bing101.github.io"> Bing</a>
</div>
</footer> -->
</body>
</html>