-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnfa-example.vtf
More file actions
24 lines (21 loc) · 1.52 KB
/
nfa-example.vtf
File metadata and controls
24 lines (21 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Example of the VATA format for storing or exchanging automata
#
# comments start with '#'
@NFA # denotes the type of the automaton that will follow
# (nondeterministic finite automaton); the @type preamble starts a
# section that will (in this case) define one automaton; the section
# ends either with an end-of-file, or with another @type preamble
# now, we follow with the definition of components of an automaton
%Name nfa1 # name of the automaton (optional, can be used to refer to the automaton)
%Alphabet a b c d # alphabet (optional) (a whitespace before % is OK)
%Initial q1 q2 # initial states (required); a definition spans until the end of line
%Initial q3 # a key can be repeated, the result should be the same as if in a single line
%Initial "a state" # when in ", names can have whitespaces (and also " if escaped with backslash '\')
%Initial "\"we're here,\" he said"# a state with the name |"we're here," he said| ('|' are not part of the name)
# names cannot span multiple lines
%Final q2 # final states (required)
q1 a q1 # transitions occur when there is no keyword
q1 a q2 # the format is <source> <symbol> <target>
"q1" b "a state" # note that "q1" and q1 are the same
"\"we're here,\" he said" c q1
q1 () q2 # () is used for epsilon transitions