Test 1 Flashcards
In formal language theory, an __________ is a finite, non-empty set.
alphabet
The elements of the set are called:
symbols
A finite sequence of symbols a 1 a 2 …a n from an alphabet is called a ________ over that alphabet.
string
the length of a string is the number of symbols in it. The notation for the length of is:
|x|
the concatenation of two strings
XY
reversal: the reverse of a string x=ab
ba
Similarly, language theory has a special symbol epsilon which is used to represent the __________, the string with no symbols in it .
empty string
Denoted as “zero or more”:
Sigma*
Always infinite
Sigma*
Is sigma = {1}, then what is sigma*?
{Epsilon, 1, 11, 111, …}
If we take the union S^ 0 union S^ 1 union S^ 2 union… then the resulting set is the set of all strings formed by concatenating zero or more strings from S, and is denoted S. The set S is called the ___________ of S, and the operator is called the __________ operator .
Kleene closure
Kleene star
One way of describing the grammatical structure of the strings in a language is to use a mathematical formalism called:
regular expression
A language is this if it is generated by a regular expression:
Regular
of the alphabet and special symbols such a and that are used to construct expressions. These special symbols, which are not part of the language being described but are used in the description, are called:
meta-characters
To make it easier to deal with the large number of characters in the alphabet, _____________ are introduced. This consists of a list of characters enclosed between brackets and [ and ]
character classes
A meta-character to match the end of the line:
$
is a machine which takes as input, a finite string of symbols from some alphabet sigma
finite-state automaton (FSA)
There is a finite set of ________ in which the machine can find itself.
states
The state it is in before consuming any input is called the:
start state.
Some of the states are _________ or _________ . If the machine ends in such a state after completely consuming an input string, the string is said to be ____________ by the machine
accepting or final
Accepted
The actual functioning of the machine is described by something called a ________________, which specifies what happens if the machine is in a particular state and looking at a particular input symbol.
transition function
The start state of the compiler when parsing a function declaration might be “expecting a return type” then with no input consumed, the compiler can move to the state “ expecting a legal function name “. To model this, it might seem reasonable to allow transitions that do not require the consumption of input. such transitions are called:
Enigma- transition
is the same as a deterministic finite-state automaton except that the transition function is no longer a function that maps a state-input pair to a state; rather, it maps a state-input pair or a state-pair to a set of states.
nondeterministic finite-state automaton (NFA)
Every languages that is accepted by an ______ is accepted by a _____
NFA
DFA