blob: 01bc3cecc426eda27640339416313612c6332b39 (
plain)
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
|
#+title: Regular expressions
#+subtitle: Non-deterministic and deterministic finite state machines
#+date: 2025H1
* Task
:PROPERTIES:
:CUSTOM_ID: task
:END:
Construct a regular expression, then a non-deterministic finite state
machine, and determinize it (transitions can be specified using
ranges). Implement a program that checks the entered text using the
finite state machine implementation (output options: the string
matches, does not match, characters are not from the alphabet). It is
also necessary to implement a function for randomly generating a valid
string based on the resulting finite state machine.
Examples of correct strings:
#+begin_example
https://docs.google.com/document/d/1poUMiPBYm/edit?usp=sharing&sd=true
https://docs.google.com/document/d/1poUMiPm-wfYTyTf6NFtPwbWEae_/preview
http://docs.google.com/document/d/1po-MiPBwUfY5MUTyTf6NFtPwbWEae_/copy
docs.google.com/document/d/1po-UMiPBYmfY5MlaksjdshUTywTf6NFtPwbWEae_/export?
docs.google.com/document/d/1po-UMiPBYmfY5MUsdfTywTf6NFtPwbWEae_
docs.new
http://docs.new/
https://docs.new//
#+end_example
There are 3 possible protocol specifications:
- an empty string
- =http​://=
- =https​://=
There are 2 different inputs:
- =docs.new= -- only the characters =/=.
- =docs.google.com=, then:
1. must be =/document/d/=,
2. must be a document identifier
3. an optional path command after =/=
4. optional options after =?=
* Documentation
:PROPERTIES:
:CUSTOM_ID: documentation
:END:
The exported report can be found at [[https://git.michalec.dev/files/uni/term-06/math-logic/lab-02/report.pdf][this link]].
* Showcase
:PROPERTIES:
:CUSTOM_ID: showcase
:END:
* Unlicense
:PROPERTIES:
:CUSTOM_ID: unlicense
:END:
#+include: UNLICENSE verse
|