#+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