2023-10-29 22:59:51 +01:00
|
|
|
Deterministic automaton III
|
|
|
|
===========================
|
|
|
|
|
|
|
|
Read a description of a finite-state automaton in the AT&T format
|
|
|
|
(without weights) from the file in the first argument. Then, read strings from the
|
|
|
|
standard input. If a string is
|
2023-11-12 15:41:40 +01:00
|
|
|
accepted by the automaton, write TRUE, a space and the string on the
|
|
|
|
standard output, otherwise — write FALSE, a space and the string.
|
2023-10-29 22:59:51 +01:00
|
|
|
|
|
|
|
If there is a non-determinism in the automaton, the first transition should be chosen.
|
|
|
|
|
|
|
|
The automaton can contain epsilon transitions ("<eps>" instead of a
|
|
|
|
character). They should be interpreted as follows: an epsilon
|
|
|
|
transition can be used (without "eating" a character from the input),
|
|
|
|
if there is no other transition applicable. You can assume that there
|
|
|
|
is at most one epsilon transition from a given state and that there
|
|
|
|
are no cycles with epsilon transition.
|
|
|
|
|
|
|
|
Your program does not have to check whether the description is correct
|
2023-11-12 15:41:40 +01:00
|
|
|
and whether the automaton is deterministic.
|
2023-10-29 22:59:51 +01:00
|
|
|
|
2023-11-24 20:39:14 +01:00
|
|
|
long.arg - this automaton accepts two texts - "aaaa" and "a" replicated 4038 times.
|
|
|
|
simple1.arg - simple automaton accepting only text "abc"
|
|
|
|
simple2.arg - automaton accepting text "ab*c" (b replicated any number of times) and "kot"
|
|
|
|
|
2023-10-29 22:59:51 +01:00
|
|
|
POINTS: 3
|
|
|
|
DEADLINE: 2023-11-12 23:59:59
|
|
|
|
REMAINDER: 0/3
|